Skip to main content

ANSI text animation library

Project description

🖼️ ansi stdio

Terminal text composition and animation library.

$ uvx ansi_stdio

Tools

  • ansi-quantize - terminal filter to help you strip out log dump noise from asciinema recordings. Currently doesn't do a very good job of it, due to not having char-level diffs.
  • ansi-fonts - lists available monospace fonts on the system.

Design

The thing is a scene graph made of Actor nodes. Each node has a clock and when rendered, can redirect calls. Haven't decided how child relationships and recursion will work yet, so keeping this open. Probably won't call them actors either.

Clocks are chained timers that can be paused and implement time however they like. clock.wall gives you the system time. Clock.time gives the current time etc.

Buffers are sparse grids of rich characters. They track their own size and can be merged (+= and +), queried/set (slice notation) and copied.

Object design

So far we have:

  • 🔢 Versioned - objects that are versioned have a version number that gets updated when they are changed.
  • 📦 Box - a 2d box, used for bounding things.
  • ⏲️ Clock - the workhorse of animation.

Still not figured out:

  • 💾 Saved - a serializable class.
  • 🎞️ The main actor class - is it a View?
  • How buffers, views and time work together with caching.
  • Should "Animation" be a buffer?

Overall plan

  • Build a custom video format with keyframes and delta frames/buffers. This can act as a cache and a rendering format. The encoder can then be used to capture terminal graphics from various sources, including text files, programs or other loaders.
  • Build serialization into the core objects via a generic mixin. The construction parameters will be attribute names by convention, so they can always be (de)serialized.
  • Once the foundations are laid, build in structure for working with a vast library of effects, sources and so on, and filtering it effectively. So we don't end up constrained, with everything dumped in a directory, and can compose the different things in various ways.
  • Make a plugin system for all these things.
  • Build a basic UI that works with this, somewhere between Kdenlive and OBS Studio.
  • Go to town building components that are useful. Idea being to use code generation within the confines of a decent structure, so using AI to add to it doesn't end up like a Glastonbury Festival toilet.

Next Steps

  • Finish the Saved class, figure out how it relates to Versioned.
  • Figure out animation buffers, how they map to buffers, accumulate and can be rendered.
  • Implement a recorder using the above.
  • Figure out how to convert ANSI text into animations when it has no timing info (callbacks that look for cursor movements and/or screen resets).
  • Start work on the UI

Links

Project details


Download files

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

Source Distribution

ansi_stdio-0.0.2.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

ansi_stdio-0.0.2-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file ansi_stdio-0.0.2.tar.gz.

File metadata

  • Download URL: ansi_stdio-0.0.2.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for ansi_stdio-0.0.2.tar.gz
Algorithm Hash digest
SHA256 ff44c9b3b257e3fa4627c9e52a3f70ce21499dbb4552108ce20bcde7c5198d63
MD5 c88cdbde6f0c758f60e4694cbb302e47
BLAKE2b-256 b15c7c6f8fb14507cde28df0342f3a0d80ce3edb92b6b846776c5ad397ec93f9

See more details on using hashes here.

File details

Details for the file ansi_stdio-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: ansi_stdio-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 19.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for ansi_stdio-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 349406b7cb6443ac508330d524b52d380b1ebba7b9fbc7783082915ec5c16e51
MD5 c691fbb8141594eae5db32bb38ddf97c
BLAKE2b-256 0cfc527e62e42f597ce819ae2246e58d95731905fc1da0316ab7973555a231b6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page