Skip to main content

Get your Advent of Code puzzle input and much more!

Project description

Advent

Advent is a Python package that contains useful functions for Advent of Code eg getting puzzle input or getting all integers present in a string.

Installation

Use the package manager pip to install advent.

pip install advent

Setup

To use this tool you need to create a .env file in your project directory and place there your session ID.

# .env file
SESSION_ID="your-session-id"

It's stored in a cookie called session. You can find it by entering Inspect Mode in your browser, Application -> Cookies. Check out picture below: where to find session id

Usage

from advent.functions import get_puzzle_input, get_ints

# returns "B X\nB Y\nA Y\nB Y\n..."
get_puzzle_input(2022, 22)

# returns [2, 3]
list(get_ints("Point x=2, y=3"))

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

advent-1.0.3.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

advent-1.0.3-py3-none-any.whl (5.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page