Module advent_of_code_hhoppe
Python library to process Advent-of-Code puzzles in a Jupyter notebook. See a complete example.
Install it using pip install advent-of-code-hhoppe.
Usage summary:
-
The preamble optionally specifies reference inputs and answers for the puzzles, here using a
.tar.gzfile that is downloaded and extracted into the directory./data:YEAR = 2021 PROFILE = 'google.Hugues_Hoppe.965276' TAR_URL = f'https://github.com/hhoppe/advent_of_code/raw/main/{YEAR}/data/{PROFILE}.tar.gz' advent = advent_of_code_hhoppe.Advent(year=YEAR, tar_url=TAR_URL) -
For each day (numbered 1..25, or 1..12 starting in 2025), the first notebook cell defines a
puzzleobject:puzzle = advent.puzzle(day=1)The puzzle input string is automatically read into the attribute
puzzle.input. This input string is unique to each Advent participant.For each of the two puzzle parts, a function (e.g.
process1) takes an input string and returns a string or integer answer. Using calls like the following, we time the execution of each function and verify the answers:puzzle.verify(1, process1) puzzle.verify(2, process2) -
At the end of the notebook,
advent.show_times()prints a table of the timing results.
Alternative ways to specify puzzle inputs/answers
-
The puzzle inputs and answers can be read from individual files (or URLs), specified using patterns with the fields
year,day,part, andpart_letter:INPUT_URL = 'data/{year}_{day:02d}_input.txt' ANSWER_URL = 'data/{year}_{day:02d}{part_letter}_answer.txt' advent = advent_of_code_hhoppe.Advent( year=2021, input_url=INPUT_URL, answer_url=ANSWER_URL) -
The puzzle inputs and answers can be obtained directly from adventofcode.com using a web-browser session cookie and the
advent-of-code-dataPyPI package (a dependency of this package):# Fill in the session cookie in the following: !mkdir -p ~/.config/aocd && echo 53616... >~/.config/aocd/token advent = advent_of_code_hhoppe.Advent(year=2021)If the token file exists,
use_aocddefaults toTrue, and the results for parts without a known answer are submitted to adventofcode.com automatically (passuse_aocd=Falseto prevent this).
Metadata
Release files for advent-of-code-hhoppe 1.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| advent_of_code_hhoppe-1.1.7.tar.gz | 7.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| advent_of_code_hhoppe-1.1.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.1 kB
Release files / advent_of_code_hhoppe-1.1.7.tar.gz
| Download URL | advent_of_code_hhoppe-1.1.7.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a8dfea12477fd115c2349b4c4bf031ff686d6f92a94c9af82922591ca3228e4d
|
|
BLAKE2b-256 checksum How to use checksums |
4da2bdbd49f9d6d0279e15e108dcea60a0b442c0ea760196d3c32defca69531a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / advent_of_code_hhoppe-1.1.7-py3-none-any.whl
| Download URL | advent_of_code_hhoppe-1.1.7-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b1912ede80fca5483b027e576b3adab324b5f0238c6d1a2a6dd9267dac1c056c
|
|
BLAKE2b-256 checksum How to use checksums |
2f245280831d71e11fbb221bf8a465a67cd69daf2fbd9859c4f16fc6bc6b86aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency log