Skip to main content

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.

Metadata

Release files for ascii-train 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for ascii-train 0.0.6
File Interpreter ABI Platform
ascii_train-0.0.6-py2.py3-none-any.whl Python 3, Python 2 none any Details

Release files / ascii_train-0.0.6-py2.py3-none-any.whl

Download URL ascii_train-0.0.6-py2.py3-none-any.whl
Size 3.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
84c241e5ff4531bcf0c554d09aebc30d9d26af543fee252441f13e60deb9e507
BLAKE2b-256 checksum
How to use checksums
8c11c171b4b1858516a655b9c0b94d705bff31ccc0ce9e4b55d8f381fed7869f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.0.6 This release

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page