Skip to main content

Module advent_of_code_hhoppe

CI PyPI License

Python library to process Advent-of-Code puzzles in a Jupyter notebook. See a complete example.

Usage summary:

  • The preamble optionally specifies reference inputs and answers for the puzzles:

      BASE_URL = 'https://github.com/hhoppe/advent_of_code_2021/blob/main/data/google.Hugues_Hoppe.965276/'
      INPUT_URL = BASE_URL + '2021_{day:02}_input.txt'
      ANSWER_URL = BASE_URL + '2021_{day:02}{part_letter}_answer.txt'
      advent = advent_of_code_hhoppe.Advent(
          year=2021, input_url=INPUT_URL, answer_url=ANSWER_URL)
    
  • For each day (numbered 1..25), 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(part=1, func=process1)
      puzzle.verify(part=2, func=process2)
    
  • At the end of the notebook, a table summarizes timing results.

Alternative ways to specify puzzle inputs/answers

  • The puzzle inputs and answers can be more efficiently downloaded using a single ZIP file:

      PROFILE = 'google.Hugues_Hoppe.965276'
      ZIP_URL = f'https://github.com/hhoppe/advent_of_code_2021/raw/main/data/{PROFILE}.zip'
      !if [[ ! -d {PROFILE} ]]; then wget -q {ZIP_URL} && unzip -q {PROFILE}; fi
      INPUT_URL = f'{PROFILE}/{{year}}_{{day:02d}}_input.txt'
      ANSWER_URL = f'{PROFILE}/{{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:

      !pip install -q advent-of-code-data
      import aocd
      # 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)
    

Metadata

Release files for advent-of-code-hhoppe 1.1.5

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.5
File Size Uploaded
advent_of_code_hhoppe-1.1.5.tar.gz 6.8 kB Details

Built distribution (wheel)

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

Total release size: 13.3 kB

Release files / advent_of_code_hhoppe-1.1.5.tar.gz

Download URL advent_of_code_hhoppe-1.1.5.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
526a148230e4d16b641f2e8c9547467ff3c1512b07b75fef4a4fcf8b9ea559fa
BLAKE2b-256 checksum
How to use checksums
68f52b6c8efed9cefd0c07bfb8411d10a438c598a6a4db64eaa2d79676b9b1f0
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 Sep 30, 2026.

Transparency log

Release files / advent_of_code_hhoppe-1.1.5-py3-none-any.whl

Download URL advent_of_code_hhoppe-1.1.5-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82c62a958014fdf92b2df122c7c357885f4774a2f12df0e4dfb91cb3bcafa873
BLAKE2b-256 checksum
How to use checksums
33e4e884dc1d252a48396c203ae7c5ceebbe029057db6a646e3566ab14e9106f
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 Sep 30, 2026.

Transparency log

Release history Release notifications | RSS feed

1.1.7

2 release files

1.1.6

2 release files

This release

1.1.5 This release

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.9

2 release files

0.5.8

2 release files

0.5.7

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

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