Advent-of-code-py
Advent of Code helper CLI and library for python projects.
Status & Info:
| Code style | License | Project Version |
|---|---|---|
Usage
Installation
To install advent-of-code-py run following command which installs advent-of-code-py CLI and advent_of_code_py library.
pip install advent-of-code-py
OR
poetry add advent-of-code-py
Usage
Initially for advent-of-code-py to work it need session value or session ID which you can obtain by viewing cookie while visiting advent of code server. After collecting session cookie value you need to add those values in config using advent-of-code-py CLI
advent-of-code-py config add <session-name> <session-value>
Now you can import library by using
import advent_of_code_py
After importing a library you can use either two decorator present which are solve and submit decorator for a function of puzzle
For example:-
@advent_of_code_py.submit(2018,3,1,session_list="<session-name>")
def puzzle_2018_3_1(input=None):
# do some calculation with data and return final output
return final_output
Now after decorating function now you can call function like regular function call
puzzle_2018_3_1()
After calling function final_output value will be submitted by library to Advent of Code server for 2018 year day 3
problem, then returns whether the submitted answer was correct or not. If session value is not provided then
the solution will be submitted to all session value present in config file.
You can also use advent-of-code-py builtin Initializer and runner to create appropriate CLI for problem so problem can be run from CLI instead of modifying python file every time to run appropriate function To set advent-of-code-py puzzle as CLI
@advent_of_code_py.advent_runner()
def main_cli():
initializer = advent_of_code_py.Initializer()
initializer.add(<function_alias>=<function>)
# for example to run above function you can write
initializer.add(p_3_1=puzzle_2018_3_1)
# add other functions ...
return initializer
Now you can set main_cli as entry points, and it will create CLI with the appropriate name and function which was added.
So for example to run function puzzle_2018_3_1() you have to run command as entry-point-name run p_3_1 which
will run the appropriate function as well as submit as desired if the function was decorated by submit decorator or else
prints its output if the function was decorated by solve decorator.
Metadata
Release files for advent-of-code-py 0.4.0
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 |
|---|---|---|---|---|
| advent_of_code_py-0.4.0.tar.gz | 9.8 kB | Without provenance | Details for advent_of_code_py-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| advent_of_code_py-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for advent_of_code_py-0.4.0-py3-none-any.whl |
Total release size: 21.6 kB
Release files / advent_of_code_py-0.4.0.tar.gz
| Download URL | advent_of_code_py-0.4.0.tar.gz |
|---|---|
| Size | 9.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5f65e178e40aabc69748534e1f0785af21d1b2b8db095102798c967fe1182edc
|
|
BLAKE2b-256 checksum How to use checksums |
5cfb9c713087935b5ba3f48661fc8ad0121e131faf84b9db0c2cc38d71da9bae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.0 CPython/3.11.2 Linux/5.15.0-1034-azure
|
Release files / advent_of_code_py-0.4.0-py3-none-any.whl
| Download URL | advent_of_code_py-0.4.0-py3-none-any.whl |
|---|---|
| Size | 11.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f7153e406de5c68ee360b80aaa95b8229744c2a5b28759958384ee0abd7e4b32
|
|
BLAKE2b-256 checksum How to use checksums |
185d994d7221a9b93689a2090a68adba8798f8f22da03520a2bc0a1b1a8d561e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.0 CPython/3.11.2 Linux/5.15.0-1034-azure
|
Security for advent-of-code-py 0.4.0
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.