Skip to main content

Advent Of Code to Markdown

Total number of downloads PyPI PyPI - Python Version

Parses Advent Of Code problem statement to markdown with option to also download the input while keeping everything organised.

Features

  1. Parses the problem statement to Markdown.

  2. Easily organize your solutions with the input and a markdown description.

  3. Boilerplate can be copied next to the input and the problem statement.

  4. You can execute this script for the same day as many times as you want and feel confident that the boilerplate will not change what you have done so far.

Organisation

Each day goes inside a folder with the syntax day-<day> as you can check below.

|____day-01
| |____README.md
| |____input.txt
|____day-02
| |____README.md
| |____input.txt
...
|____day-15
| |____README.md
| |____input.txt
|____day-16
| |____README.md
| |____input.txt
...
|____day-24
| |____README.md
| |____input.txt
|____day-25
| |____README.md
| |____input.txt

This was generated by executing aoc-to-markdown -i -s 25 times. Additional arguments could have been provided to copy a directory/file inside the folder (useful to set up everything for you to solve). You can also specify the output directory (where the folders will be created), but, in this example, this was also not given.

Installation

If you want to install directly from this repository, then install the dependencies and you are good to go:

pip install -r requirements.txt

python aoc_to_markdown.py -h

If you want even simpler, then download from PyPi and you are good to go:

pip install aoc-to-markdown

aoc_to_markdown -h

Arguments

Usage: aoc-to-markdown [-h] [-y <year>] [-d <day>] [-o <output_dir>] [-b <boilerplate_dir>] [-s] [-i]
 -h, --help          Optional parameter to print this message
 -y, --year          Optional parameter to indicate the year of the problem
 -d, --day           Optional parameter to indicate the day of the problem
 -o, --output        Optional parameter to indicate the path of the output (default = ".")
 -b, --boilerplate   Optional parameter to copy a directory/file to the output
 -s, --save          Optional argument to indicate that the markdown should not be printed to stdout, but to a file
 -i, --input         Optional argument to indicate that the input is to be downloaded and saved to a file

SESSION_ID environment flag is required to download part 2 of the problem. This session id can be copied from the requests made on the Advent Of Code website after you login.

Extended description:
--year, if not given, defaults to the current year if in december; otherwise is the current year
--day, if not given, defaults to the first day which has not been retrieved (checks for directories named "day-<day>"); if all days have been retrieved, then go drink some hot chocolate and enjoy the rest of the day
--output is the prefix path where the folder (syntax: "day-<day>") will be created
--boilerplate is an argument useful to copy the solution boilerplate to help you get started
--save is only necessary if you want to save directly to a file and --output is not given

Example:
aoc-to-markdown -y 2018 -d 1 -o my-solution-directory -b my-boilerplate -i

Similar

Metadata

Release files for aoc-to-markdown 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aoc-to-markdown 0.2.3
File Size Uploaded
aoc-to-markdown-0.2.3.tar.gz 5.3 kB Details

Release files / aoc-to-markdown-0.2.3.tar.gz

Download URL aoc-to-markdown-0.2.3.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
efc4d54eba91fe4a3c7fbc94d445dcc1662805cef207dfabf5f567282c5fe4bc
BLAKE2b-256 checksum
How to use checksums
6334eba661d2cf332443d14cd8330b8ace15d0c1b968515ec2aaa5d9ed2c80d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.2

Release history Release notifications | RSS feed

This release

0.2.3 This release

1 release file

0.2.2

1 release file

0.2.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page