Convert Advent of Code ASCII art
Project description
Advent of Code® OCR
This Python module helps with converting Advent of Code ASCII art letters into plain characters. At the moment, it only supports 6-pixel-tall characters as seen in 2016 Day 8 and 2019 Days 8 and 11.
Support for 10-pixel-tall characters (2018 Day 10) is coming soon.
Put simply, it converts this to ABC
:
██ ███ ██
█ █ █ █ █ █
█ █ ███ █
████ █ █ █
█ █ █ █ █ █
█ █ ███ ██
Installation
This module can be installed from PyPI:
$ pip install advent-of-code-ocr
Usage
Using this module is pretty easy. By default, this module recognizes #
as a filled pixel and .
as an empty pixel. However, you can change this using the fill_pixel
and empty_pixel
keywork arguments respectively.
from advent_of_code_ocr import convert_6
print(convert_6(".##.\n#..#\n#..#\n####\n#..#\n#..#"))
# A
print(convert_6(" $$ \n$ $\n$ $\n$$$$\n$ $\n$ $", fill_pixel="$", empty_pixel=" "))
# A
Note that letters must be separated by one or more columns of empty pixels, as they are displayed in Advent of Code answers that way.
Advent of Code is a registered trademark of Eric K Wastl in the United States.
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
Hashes for advent_of_code_ocr-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbc08c02b09c73b0e9ce623d00d1d6e29bec7d480ba878f9786d944de25b81c2 |
|
MD5 | 3c5f41941bf09beeaa4d25f5fe586b87 |
|
BLAKE2b-256 | 0acf5b9a2638f5bd48b3f198fe8a45df4e23c3f90dee890502160e4a41a03434 |