Skip to main content

Module advent_of_code_hhoppe

CI PyPI Python License

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.gz file 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 puzzle object:

      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, and part_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-data PyPI 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_aocd defaults to True, and the results for parts without a known answer are submitted to adventofcode.com automatically (pass use_aocd=False to 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)

Source distribution for advent-of-code-hhoppe 1.1.7
File Size Uploaded Provenance Actions
advent_of_code_hhoppe-1.1.7.tar.gz 7.2 kB With provenance Details for advent_of_code_hhoppe-1.1.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for advent-of-code-hhoppe 1.1.7
File Interpreter ABI Platform Actions
advent_of_code_hhoppe-1.1.7-py3-none-any.whl Python 3 none any Details for advent_of_code_hhoppe-1.1.7-py3-none-any.whl

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 log

Release 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

Security for advent-of-code-hhoppe 1.1.7

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for advent_of_code_hhoppe-1.1.7.tar.gz

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

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.7 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page