Skip to main content

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

Project description

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

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

aoc-to-markdown-0.2.3.tar.gz (5.3 kB view details)

Uploaded Source

File details

Details for the file aoc-to-markdown-0.2.3.tar.gz.

File metadata

  • Download URL: aoc-to-markdown-0.2.3.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for aoc-to-markdown-0.2.3.tar.gz
Algorithm Hash digest
SHA256 efc4d54eba91fe4a3c7fbc94d445dcc1662805cef207dfabf5f567282c5fe4bc
MD5 147b6478bfa18f032be41377bb1bfc3e
BLAKE2b-256 6334eba661d2cf332443d14cd8330b8ace15d0c1b968515ec2aaa5d9ed2c80d7

See more details on using hashes here.

Supported by

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