Observed since 20 Oct, 20:01 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
A library to parse Advent of Code ASCII art
This Python module converts Advent of Code ASCII art letters to plain characters.
At the moment, it supports 6-pixel-tall characters as seen in 2016 Day 8, 2019 Days 8 and 11, and 2021 Day 13. (Support for 10-pixel-tall characters, as seen in 2018 Day 10, is coming soon.)
Put simply, it converts something like this to plain text:
██ ███ ██
█ █ █ █ █ █
█ █ ███ █
████ █ █ █
█ █ █ █ █ █
█ █ ███ ██
Advent of Code OCR is available on PyPI:
$ pip install advent-of-code-ocr
Advent of Code OCR officially supports Python 3.7+.
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
You can also convert data that you have in a NumPy array or a nested list:
from advent_of_code_ocr import convert_array_6
array = [
[0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0],
[1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1],
[1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0],
[1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0],
[1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1],
[1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0],
]
print(convert_array_6(array, fill_pixel=1, empty_pixel=0))
# AOC
Advent of Code is a registered trademark of Eric K Wastl in the United States.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.1.0 | 25 Jul 2025 | 1 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 20:01 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:e0b25861f4b855a5e8a03bfd7ca868af09c69cf6705f57baa530030460ef9434