Parsing text output for Advent of Code puzzles
Project description
Advent of Code Optical Character Recognition (adventocr)
Some Advent of Code puzzles provide visual outputs which must be converted into text. This package is a helper to automate this task.
Installation
pip install adventocr
Usage
An example puzzle output may look something like
word = [
'#', '#', '#', '#', ' ', '#', '#', '#', '#', ' ',
'#', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ',
'#', '#', '#', ' ', ' ', '#', '#', '#', ' ', ' ',
'#', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ',
'#', ' ', ' ', ' ', ' ', '#', ' ', ' ', ' ', ' ',
'#', '#', '#', '#', ' ', '#', ' ', ' ', ' ', ' '
]
When tidied and printed, this appears to be
#### ####
# #
### ###
# #
# #
#### #
This process can be automated through:
import adventocr
parsed = adventocr.word(word)
parsed
'EF'
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
adventocr-0.1.tar.gz
(2.9 kB
view details)
Built Distribution
File details
Details for the file adventocr-0.1.tar.gz
.
File metadata
- Download URL: adventocr-0.1.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddc785c64980fa635d7f0a02f5a82b7416b37faa4660507cb3b733667b625c38 |
|
MD5 | ebc5f31caeed6480469143ba2c6df1dd |
|
BLAKE2b-256 | 9e84507e392e20e89361a12fb4f7dcf5a3685924fbde5aa8c2e3e0f689dae064 |
File details
Details for the file adventocr-0.1-py3-none-any.whl
.
File metadata
- Download URL: adventocr-0.1-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d108387e26779fde0b32dcfe7688dca189c8ce09f20eaa3ea04bc9fc0d1074c6 |
|
MD5 | 0b2c67ab19b4046170c390d31c4eee28 |
|
BLAKE2b-256 | f2b88261008bab9f06eba74741d2dda604a4e682e214a167368761d5cdbbe4d6 |