Modular CLI helpers for Advent of Code workflows.
Project description
PySleigh
pysleigh is a Typer-driven CLI assistant for Advent of Code. It keeps all IO, scaffolding, runs, and submissions beside your solutions and gives you dry-run previews before any change lands on disk or on the AoC website.
How the CLI behaves
- Every command runs in a clear scope: you point it at a project root and a year/day, then ask it to fetch input, fetch the article, run or test a solution, submit an answer, or scaffold files.
- Actions follow the “scope → action → artifact” pattern: they operate on one concern, do a single thing, and report the created or updated artifact (inputs, articles, answers, solution templates).
- Dry-run flags (
--dry-run) appear on each command so you can observe what would change without touching your repo or the Advent of Code site. - Helper modules (
paths,context,loader,session) stay outside the CLI decorators so the commands remain declarative and easier to script or test.
Key commands
pysleigh data fetch-input <year> <day>downloads the day’s input (supports--overwrite,--dry-run).pysleigh data fetch-article <year> <day>saves the article HTML plus a title line so scaffolding knows the correct header.pysleigh data refresh-answers <year> <day>reruns your solution, rewritesanswers/year_{n}/answer_{n}_day_{d}.txt, or dry-runs the write.pysleigh solution run|test|submitexecutes, validates, or submits your solution; they log each step, honor dry-run, and explain success/failure details.pysleigh solution scaffold <year> <day>bootstraps a template undersolutions/year_{n}/solution_{n}_day_{d}.pyusing the guessed title.pysleigh solution preparebatches input/article fetch plus scaffold with optional overwrites.
Installation & invocation
- Install straight from PyPI (
pip install pysleigh) or, for hacking on the CLI, usepip install -e .. - Run
pysleighdirectly once it’s on your PATH, or wrap it inuv(uv run pysleigh -- solution run 2023 1) to isolate dependencies and leverage tooling helpers. - Use
--project-root /path/to/advent-of-code-pythonwhen invoking the CLI from outside your AoC repo so the built-inPathConfigcan resolve inputs, answers, and article directories.
Configuration
PathConfigexpects the usual layout (inputs/year_{n}/input_{n}_day_{d}.txt,articles/year_{n}/article_{n}_day_{d}.md,answers/year_{n}/answer_{n}_day_{d}.txt,solutions/year_{n}/solution_{n}_day_{d}.py). Commands will create missing parent directories automatically.- Set
SESSION_TOKENbefore running networked commands:export SESSION_TOKEN="$(security find-generic-password -s adventofcode -w)"
Any secure credential store (security,pass,keyring, etc.) works; combine it withdirenv,dotenv, oruvsecrets so the token never appears in source control. PySleigh reports a clear error if the variable is missing or empty. - Dry-run flags on every command let you confirm submit candidates, file writes, and fetches before touching the file system or AoC.
Development & testing
pytest --cov=src --cov-report=term-missingruns the suite; tests mirror the CLI modules so behavior stays aligned with production commands.- Lint via
ruff check .and type-check withty check(configured inpyproject.toml), keeping 100-char lines and Python 3.12 typing idioms. - Mutation testing via
mutmut runis recommended after behavior changes—the existing suite already kills every mutant in commands/loaders/session helpers.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pysleigh-0.1.9a3.tar.gz.
File metadata
- Download URL: pysleigh-0.1.9a3.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36fe60988f3773101c9108edc664cd145e4536af5a40362addd20c56bce4af40
|
|
| MD5 |
d601056116fad3e73b200c75d947bc25
|
|
| BLAKE2b-256 |
a713c6dcab0f8a30bc07bdf6e21c0d151ce679f6a1f5b41c7cb30ae8d2d18ca1
|
Provenance
The following attestation bundles were made for pysleigh-0.1.9a3.tar.gz:
Publisher:
release.yml on Dheebz/pysleigh
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pysleigh-0.1.9a3.tar.gz -
Subject digest:
36fe60988f3773101c9108edc664cd145e4536af5a40362addd20c56bce4af40 - Sigstore transparency entry: 768224145
- Sigstore integration time:
-
Permalink:
Dheebz/pysleigh@967060d67b5ebbbceee37baed1b0e724fc5f3fec -
Branch / Tag:
refs/tags/v0.1.9a3 - Owner: https://github.com/Dheebz
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@967060d67b5ebbbceee37baed1b0e724fc5f3fec -
Trigger Event:
push
-
Statement type:
File details
Details for the file pysleigh-0.1.9a3-py3-none-any.whl.
File metadata
- Download URL: pysleigh-0.1.9a3-py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5b2d9f7876aa4059aa19963e4f59dba122742becdc0c163db7a0b9233b93527
|
|
| MD5 |
e0459df82d37e9e6257724d98e488368
|
|
| BLAKE2b-256 |
3445f097d37d8d646f1d12d9d05a8cbc7c28f224e45e331fe20b0283a219c944
|
Provenance
The following attestation bundles were made for pysleigh-0.1.9a3-py3-none-any.whl:
Publisher:
release.yml on Dheebz/pysleigh
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pysleigh-0.1.9a3-py3-none-any.whl -
Subject digest:
c5b2d9f7876aa4059aa19963e4f59dba122742becdc0c163db7a0b9233b93527 - Sigstore transparency entry: 768224147
- Sigstore integration time:
-
Permalink:
Dheebz/pysleigh@967060d67b5ebbbceee37baed1b0e724fc5f3fec -
Branch / Tag:
refs/tags/v0.1.9a3 - Owner: https://github.com/Dheebz
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@967060d67b5ebbbceee37baed1b0e724fc5f3fec -
Trigger Event:
push
-
Statement type: