Skip to main content

Adventkit -- Advent of Code in Python

These are my solutions in Python to some of the Advent of Code puzzles. My goal is to make the code readable while also making it reasonably fast.

Installation

You can install Adventkit using pip:

pip install adventkit

Alternatively, after cloning the Adventkit repository, the code can be run as is.

Requirements

  • Python 3.6.1+
  • Puzzle input files placed in the right locations: the input for day 1 of Advent of Code 2019 is read from input/year2019/day01.txt (relative to the current working directory).

Optional, to run src/run.sh after cloning the repository:

  • A POSIX-compliant shell (/bin/sh)
  • A shell command python3 to run Python 3.6.1+ (any implementation)
  • If extra speed is desired on selected puzzles: A shell command pypy3 to invoke PyPy 3.6+

How to run

After installing Adventkit, you can run a single day's solver like this:

adventkit 2019 10

Cloning the repository gives you more options:

  • Run a single day's solver: src/run.sh 2019 10 (or python3 src/run.py 2019 10)
  • Run all solvers: src/run.sh
  • Run all solvers from one year: src/run.sh 2019

When invoked with the optional argument --time, src/run.sh prints the execution time for each day. If the command pypy3 invokes a suitable version of PyPy, src/run.sh uses it for any solvers that are expected to run faster under PyPy than CPython.

Testing

To run the tests, first install pytest and pytest-subtests, as well as your local copy of adventkit. Then run the command pytest.

Release files for adventkit 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for adventkit 0.2.0
File Size Uploaded
adventkit-0.2.0.tar.gz 19.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for adventkit 0.2.0
File Interpreter ABI Platform
adventkit-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 45.5 kB

Release files / adventkit-0.2.0.tar.gz

Download URL adventkit-0.2.0.tar.gz
Size 19.6 kB
Tags Source
SHA-256 checksum
How to use checksums
89aa7192d11937108dcf72b80172934f42d5354d803d72933b2b449f71263785
BLAKE2b-256 checksum
How to use checksums
e08d1828360073cf8be26a91490b7f863af755eb35aa4841145220fc8e493ad5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.7

Release files / adventkit-0.2.0-py3-none-any.whl

Download URL adventkit-0.2.0-py3-none-any.whl
Size 25.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a374214ccb87129d8c6c94b8b48a692cf0b02e743251d25a434019e1d52c3fe6
BLAKE2b-256 checksum
How to use checksums
45a7b2a5b449e68e283b13025ff2b1d39f90a14245efe8114d3db3d93208ccd2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.7

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.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