Skip to main content

Asciimatics is a package to help people create simple ASCII animations on any platform. It is licensed under the Apache Software Foundation License 2.0.

It originated from some work that I did on PiConga to create a retro text credits roll for the project. This worked so well, I re-used it for another project. At that point I felt it might be fun to share with others.

Why?

Why not? It brings a little joy to anyone who was programming in the 80s… Oh and it provides a single cross-platform Python class to do all the console function you could ask for, including:

  • Coloured/styled text - including 256 colour terminals

  • Cursor positioning

  • Keyboard input (without blocking or echoing)

  • Mouse input (terminal permitting)

  • Detecting and handling when the console resizes

  • Screen scraping

  • Anti-aliased ASCII line-drawing

  • Image to ASCII conversion

  • Many animation effects

Currently this API has been proven to work on CentOS 6 & 7, Raspbian (i.e. Debian wheezy) and Windows 7 & 8, though it should also work for any platform that provides a working curses implementation.

(Please let me know if you successfully verified it on other platforms so that I can update this list).

Installation

To install asciimatics, simply:

$ pip install asciimatics

How to use it?

Create a Screen, put together a Scene using some Effects and then get the Screen to play it.

from asciimatics.effects import Cycle, Stars
from asciimatics.renderers import FigletText
from asciimatics.scene import Scene
from asciimatics.screen import Screen

def demo(screen):
    effects = [
        Cycle(
            screen,
            FigletText("ASCIIMATICS", font='big'),
            screen.height / 2 - 8),
        Cycle(
            screen,
            FigletText("ROCKS!", font='big'),
            screen.height / 2 + 3),
        Stars(screen, 200)
    ]
    screen.play([Scene(effects, 500)])

Screen.wrapper(demo)

And you should see something like this:

asciicast

Documentation

Documentation is available at http://asciimatics.readthedocs.org/

More Examples

More examples of what you can do are available in the project samples directory, hosted on GitHub. See https://github.com/peterbrittain/asciimatics/tree/master/samples.

Alternatively, you can browse the gallery at https://github.com/peterbrittain/asciimatics/wiki.

Bugs and enhancements

You can report bugs and submit enhancement requests at https://github.com/peterbrittain/asciimatics/issues

Contributing to the project

If you’d like to take part in this project (and see your name in the credits!), check out the guidance at http://asciimatics.readthedocs.org/en/latest/intro.html#contributing-to-this-project.

Release files for asciimatics 1.4.2

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

Source distribution (sdist)

Source distribution for asciimatics 1.4.2
File Size Uploaded
asciimatics-1.4.2.tar.gz 30.8 kB Details

Release files / asciimatics-1.4.2.tar.gz

Download URL asciimatics-1.4.2.tar.gz
Size 30.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b91de6a682a228b410fc045b19b46ef5c8692db3dbf25c2f9475c05af85a6a80
BLAKE2b-256 checksum
How to use checksums
e2b0f1494e1ebc4c6c5e1df600406134d9d6eab69ca2b73ab0e2718d4eeec1ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

1.15.0

2 release files

1.14.0

2 release files

1.12.0

2 release files

1.11.0

2 release files

1.10.0

2 release files

1.9.0

1 release file

1.8.0

1 release file

1.7.2

1 release file

1.7.1

2 release files

1.7.0

2 release files

1.6.0

1 release file

1.5.0

2 release files

This release

1.4.2 This release

1 release file

1.4.1

1 release file

1.4.0

1 release file

1.3.0

1 release file

1.2.0

1 release file

1.1.0

1 release file

1.0.0

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.2.0

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