Skip to main content

User-friendly environment management CLI and package for Advent of Code

Project description

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:

  1. Go to adventofcode.com.
  2. Log in to your account.
  3. Open your browser's developer tools (usually by pressing F12 or right-clicking and selecting "Inspect").
  4. Go to the "Application" tab (or "Storage" in some browsers).
  5. Expand "Cookies" and select https://adventofcode.com.
  6. Find the cookie named session and 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 in main.py.
  • aoc bind [name]: Saves the current contents of main.py as 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 into main.py.
  • aoc clear: Resets the contents of main.py to a template.

Example

  1. Initialize the environment:

    aoc init ./aoc-solutions
    
  2. Write your solution for a specific day and part in the main.py file within the ./aoc-solutions directory.

  3. Run your solution:

    aoc run
    
  4. Save your solution:

    aoc bind
    
  5. 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 the main.py file.
  • aoc bind [name]: Binds the contents of main.py.
    • --force: Overwrite an existing solution with the same name.
  • aoc load <year> <day> <part> [name]: Loads a saved solution into main.py.
  • aoc clear: Sets the main.py contents to the default.
  • aoc test: (Coming soon) Runs test cases for your solutions.

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

aocenv-0.1.1.tar.gz (36.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aocenv-0.1.1-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file aocenv-0.1.1.tar.gz.

File metadata

  • Download URL: aocenv-0.1.1.tar.gz
  • Upload date:
  • Size: 36.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.6

File hashes

Hashes for aocenv-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b0fa4e7283e1f2e5bdd70defe6c2fc4cde48ce9245d1102408a8d03f95868ff9
MD5 6868aa0a7ce8243aafb86580ae18b090
BLAKE2b-256 5fe1c6be0f058770a3855d0f995dc322d70a8dd155858f05640d0991a5755c28

See more details on using hashes here.

File details

Details for the file aocenv-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: aocenv-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.6

File hashes

Hashes for aocenv-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 846be03c3c03b530a38c2219bb0fbf68ffbd334017299f874169105a97332d42
MD5 d9ce169885e1ed18ac69c9212e59b84d
BLAKE2b-256 ddb95a779b1923cc178126d30eb855841c1b83ce9e69eb7991a522700d1aded9

See more details on using hashes here.

Supported by

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