Giter Site home page Giter Site logo

advent-of-code-ocr's Introduction

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

Advent of Code is a registered trademark of Eric K Wastl in the United States.

advent-of-code-ocr's People

Contributors

bsoyka avatar renovate-bot avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.