My solutions for Advent of Code in Python with set up tools/utils for multiple years.
A rule for myself is I am going to use no AI besides Copilot tab completions and no hinting at what I want to solve with comments. Only after I solve it myself will I go back and see better ways of doing it with an LLM.
- Day 1 ⭐️ ⭐️
- Day 2 ⭐️ ⭐️
- Day 3 ⭐️ ⭐️
- Day 4 ⭐️ ⭐️
- Day 5 ⭐️ ⭐️
- Day 6 ⭐️ ⭐️
- Day 7 ⭐️ ⭐️
- Day 8 ⭐️ ⭐️
- Day 9 ⭐️ ⭐️
- Day 10 ⭐️ ⭐️
- Day 11 ⭐️ ⭐️
- Day 12 ⭐️ ⭐️
- Python 3.12+
- UV (for dependency management)
- Clone the repository:
git clone https://github.com/ItsMacto/Advent-of-Code-2025.git
cd Advent-of-Code-2025- Sync dependencies with UV:
uv sync- (Optional) Set up automatic input downloading:
-
Get your AOC session cookie:
- Go to https://adventofcode.com/
- Log in
- Open browser DevTools (F12)
- Go to Application/Storage > Cookies
- Find the
sessioncookie and copy its value
-
Create
.aoc_sessionfile in the project root:echo "YOUR_SESSION_COOKIE_HERE" > .aoc_session
-
Or set environment variable:
export AOC_SESSION="YOUR_SESSION_COOKIE_HERE"
-
Create a day for the current year :
uv run main.py create 5Create a day for a past year:
uv run main.py create 5 --year 2024This creates a folder structure:
aoc2025/day5/
├── day5.py (boilerplate with star1() and star2() functions)
├── input.txt (will have your downloaded input if session cookie is set)
└── test.txt (empty, for test data)
Run the current day of the current year (defaults if no arguments):
uv run main.py
# or
uv run main.py runRun a specific day of the current year:
uv run main.py run 5Run a day from a past year:
uv run main.py run 5 --year 2024Advent-of-Code-2025/
├── main.py # CLI for creating and running days
├── download_input.py # Download inputs from AoC
├── boilerplate.py # Template for new days
├── pyproject.toml # UV/Python configuration
├── .aoc_session # Session cookie (git-ignored)
├── README.md
├── .gitignore
├── aoc2024/ # Previous year's solutions
└── aoc2025/ # Current year's solutions
├── __init__.py
├── utils/
│ ├── __init__.py
│ └── utils.py # Helper functions (grid, input reading, etc.)
├── day1/
│ ├── day1.py
│ ├── input.txt
│ └── test.txt
├── day2/
└── ...
The aoc2025/utils/utils.py module provides helpful functions:
from aoc2025.utils.utils import read_input
# Read input.txt as list of lines (default)
data = read_input()
# Read without splitting
data = read_input(split=False)
# Read the test.txt file
data = read_input(test=True)
# Read different file
data = read_input("other.txt")Each day follows this template:
from aoc2025.utils.utils import read_input
def star1() -> int:
data = read_input()
# Your solution for part 1
return result
def star2() -> int:
data = read_input()
# Your solution for part 2
return result
if __name__ == "__main__":
print(f"Star 1: {star1()}")
print(f"Star 2: {star2()}")When you run a day's solution, you'll see output like:
🎄 Running 2025 Day 1:
⭐ Star 1: ####
⭐ Star 2: ####
- Day 1: ⭐️⭐️
- Day 2: ⭐️⭐️
- Day 3: ⭐️⭐️
- Day 4: ⭐️⭐️
- Day 5: ⭐️⭐️
- Day 6: ⭐️⭐️
- Day 7: ⭐️⭐️
- Day 8: ⭐️⭐️
- Day 9: ⭐️⭐️
- Day 10:⭐️⭐️
- Day 11:⭐️⭐️
- Day 12:⭐️
- Day 13:⭐️⭐️
- Day 14:⭐️⭐️
- Day 15:
- Day 16:
- Day 17:
- Day 18:
- Day 19:
- Day 20:
- Day 21:
- Day 22:
- Day 23:
- Day 24:
- Day 25:
- Day 1: ⭐️⭐️
- Day 2: ⭐️⭐️
- Day 3: ⭐️⭐️
- Day 4:
- Day 5:
- Day 6:
- Day 7:
- Day 8:
- Day 9:
- Day 10:
- Day 11:
- Day 12:
- Day 13:
- Day 14:
- Day 15:
- Day 16:
- Day 17:
- Day 18:
- Day 19:
- Day 20:
- Day 21:
- Day 22:
- Day 23:
- Day 24:
- Day 25: