Skip to main content

Print an ascii train!

Project description

PyPI version

ascii-train

Prints out an ascii train, optionally with a text string passed as first arg or via stdin.

Installing

Now deployed to pypi, install with:

pip install ascii-train

Usage

cli

➜ ascii-train "choo choo\!"
                 _-====-__-======-__-========-_____-============-__
               _(                                                 _)
            OO(                    choo choo!                     )_
           0  (_                                                   _)
         o0     (_                                                _)
        o         '=-___-===-_____-========-___________-===-dwb-='
      .o                                _________
     . ______          ______________  |         |      _____
   _()_||__|| ________ |            |  |_________|   __||___||__
  (BNSF 1995| |      | |            | __Y______00_| |_         _|
 /-OO----OO""="OO--OO"="OO--------OO"="OO-------OO"="OO-------OO"=P
#####################################################################echo "all aboard\!" | ascii-train
                 _-====-__-======-__-========-_____-============-__
               _(                                                 _)
            OO(                    all aboard!                    )_
           0  (_                                                   _)
         o0     (_                                                _)
        o         '=-___-===-_____-========-___________-===-dwb-='
      .o                                _________
     . ______          ______________  |         |      _____
   _()_||__|| ________ |            |  |_________|   __||___||__
  (BNSF 1995| |      | |            | __Y______00_| |_         _|
 /-OO----OO""="OO--OO"="OO--------OO"="OO-------OO"="OO-------OO"=P
#####################################################################

Embedding

import ascii_train

print(ascii_train.train("No brakes!"))

Outputs:

# Run the above as cli passed to interpreter
➜ python -c 'import ascii_train; print(ascii_train.train("No brakes!"))'
                 _-====-__-======-__-========-_____-============-__
               _(                                                 _)
            OO(                    No brakes!                     )_
           0  (_                                                   _)
         o0     (_                                                _)
        o         '=-___-===-_____-========-___________-===-dwb-='
      .o                                _________
     . ______          ______________  |         |      _____
   _()_||__|| ________ |            |  |_________|   __||___||__
  (BNSF 1995| |      | |            | __Y______00_| |_         _|
 /-OO----OO""="OO--OO"="OO--------OO"="OO-------OO"="OO-------OO"=P
#####################################################################

Tests

Yeah there are tests WHYNOT!

Prereqs are installed via pip install -e '.[test]'.

To run them:

pytest ascii_train.py -vv --cov=./ --cov-branch --cov-report html:pytest_output

View results by loading pytest_output/index.html in a browser.

Project details


Release history Release notifications

This version
History Node

0.0.6

History Node

0.0.5

History Node

0.0.4

History Node

0.0.3

History Node

0.0.2

History Node

0.0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
ascii_train-0.0.6-py2.py3-none-any.whl (3.5 kB) Copy SHA256 hash SHA256 Wheel py2.py3 May 10, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page