aoc-utils is a standalone Python command-line tool that simplifies interactions with Advent of Code. It allows you to open specific challenge pages, retrieve input data, and automatically create Python templates to get started with your Advent of Code solutions.
read
command and redirection.aoc-utils
provides the following commands:
aoc open 10 2023
This command opens the Advent of Code website for day 10 of the year 2023 in your default web browser.
You can also specify the day and year using flags:
aoc open --day 10 --year 2023
aoc read 10 2023 > inputs.txt
aoc start 10 2023 /path/to/myfile.py
This creates a Python file for day 10 of 2023 at the specified path, pre-filled with the basic template to fetch input data, and opens it with your default editor. If no path is provided, it defaults to the current directory:
aoc start 10 2023
The resulting file will be named aoc_10_2023.py.
aoc-utils has no external dependencies or requirements and is completely standalone. To use it, clone the repository and install the package:
git clone https://github.com/your-username/aoc-utils.git
cd aoc-utils
pip install .
To fetch your personalized inputs, you need to set your Advent of Code session token as an environment variable. You can find your session token by going to any Advent of Code input page, opening your browser's developer tools, and inspecting the cookies. Look for a cookie called session.
Once you have the session token, set it as an environment variable:
export AOC_SESSION=your-session-token
As you can tell this readme is clearly chatgpt generated (: