aocenv
A user-friendly environment management CLI and package for Advent of Code.
aocenv is a command-line tool that helps you manage your Advent of Code solutions. It provides a structured environment to save, load, and run your solutions for different days and parts.
Installation
pip install aocenv
Configuration
To start using aocenv, you need to initialize an environment. This can be done using the init command:
aoc init <path> [session_cookie]
<path>: The directory where you want to store your Advent of Code solutions.[session_cookie]: (Optional) Your Advent of Code session cookie. You can pass this in the configuration wizard. This is required to download puzzle inputs and submit answers.
The init command will create a config.toml file in the specified path and set up the necessary directory structure.
Getting your Advent of Code session cookie
To get your Advent of Code session cookie, follow these steps:
- Go to adventofcode.com.
- Log in to your account.
- Open your browser's developer tools (usually by pressing F12 or right-clicking and selecting "Inspect").
- Go to the "Application" tab (or "Storage" in some browsers).
- Expand "Cookies" and select
https://adventofcode.com. - Find the cookie named
sessionand copy its value. This is your session cookie.
Usage
The main workflow of aocenv revolves around the run, bind, load, and clear commands.
aoc run: Executes your solution inmain.py.aoc bind [name]: Saves the current contents ofmain.pyas a solution. You can optionally provide a name for the solution if you want to store more than one solution (for example version with visuallization).aoc load <year> <day> <part> [name]: Loads a previously saved solution intomain.py.aoc clear: Resets the contents ofmain.pyto a template.
Example
-
Initialize the environment:
aoc init ./aoc-solutions
-
Write your solution for a specific day and part in the
main.pyfile within the./aoc-solutionsdirectory. -
Run your solution:
aoc run -
Save your solution:
aoc bind
-
Load a different solution:
aoc load 2023 1 1
Commands
aoc init <path> [session_cookie]: Initializes the environment.--default: Use default configuration without running the wizard.
aoc run: Runs themain.pyfile.aoc bind [name]: Binds the contents ofmain.py.--force: Overwrite an existing solution with the same name.
aoc load <year> <day> <part> [name]: Loads a saved solution intomain.py.aoc clear: Sets themain.pycontents to the default.aoc test: (Coming soon) Runs test cases for your solutions.
Metadata
Release files for aocenv 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aocenv-0.2.2.tar.gz | 40.8 kB | Without provenance | Details for aocenv-0.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aocenv-0.2.2-py3-none-any.whl | Python 3 | none | any | Details for aocenv-0.2.2-py3-none-any.whl |
Total release size: 60.9 kB
Release files / aocenv-0.2.2.tar.gz
| Download URL | aocenv-0.2.2.tar.gz |
|---|---|
| Size | 40.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
feb44de90bfb5d8745c8eb2c33eeb2995331b7c9f0836d592b4e43328716b552
|
|
BLAKE2b-256 checksum How to use checksums |
0f97705021b2c1674d5b571a9ce45c9ba90a671f902bfec0289eddde74db2d56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.6
|
Release files / aocenv-0.2.2-py3-none-any.whl
| Download URL | aocenv-0.2.2-py3-none-any.whl |
|---|---|
| Size | 20.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7bfd22b0fbf60734c61b1acdaa4828e2d3a4d18e4ce2b4a6879faf83fdfa8e89
|
|
BLAKE2b-256 checksum How to use checksums |
6d08c6967d0dd11f4325347c0bfc861af8a7d77fe688d67996587fe5b7efe169
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.6
|
Security for aocenv 0.2.2
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.