Multi-year scaffold for solving Advent of Code challenges with shared utilities.
src/aoc/
├── __init__.py
├── utils/ # Shared utilities across all years
│ ├── __init__.py
│ ├── parse_txt.py # File parsing helpers
│ └── structlog.py # Structured logging setup
│
└── aoc_2025/ # Year-specific solutions
├── __init__.py
├── day_01/
│ ├── main.py # Solution code
│ ├── input.txt # Puzzle input
│ └── example.txt # Example/test input
├── day_02/
└── ...
# Install project in editable mode
uv sync
# Run a specific day solution
uv run python -m aoc.aoc_2025.day_01.mainTo add solutions for a new year (e.g., 2024):
- Create year directory:
src/aoc/year_2024/ - Create
__init__.pyin it - Create day folders:
src/aoc/year_2024/day_01/, etc. - Use the same import pattern for all years
from aoc.utils import get_logger, simple_txt_parser
from pathlib import Path
logger = get_logger(__name__)
def part_1(data: list[str]) -> int:
# Solution
pass
def part_2(data: list[str]) -> int:
# Solution
pass
if __name__ == "__main__":
file_path = Path(__file__).parent / "input.txt"
data = simple_txt_parser(file_path)
logger.info(f"Part 1: {part_1(data)}")
logger.info(f"Part 2: {part_2(data)}")All years share utilities in src/aoc/utils/:
simple_txt_parser(path, parser=None)- Parse input files, optionally apply parser functionseparator_parser(text, separator=",")- Split strings by separator, strip whitespaceget_logger(name)- Get structured logger instance
Always import with: from aoc.utils import get_logger, simple_txt_parser
- Python 3.14+
- uv package manager
- Dependencies listed in
pyproject.toml