🖼️ ansi stdio
Terminal text composition and animation library.
$ uvx ansi_stdio
Tools
ansi-quantize- runs a program and quantizes its terminal output down to a frame rate. Char-level diffs courtesy ofplansiandbittty.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
Metadata
Release files for ansi-stdio 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ansi_stdio-0.0.3.tar.gz | 15.7 kB | Without provenance | Details for ansi_stdio-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ansi_stdio-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for ansi_stdio-0.0.3-py3-none-any.whl |
Total release size: 35.3 kB
Release files / ansi_stdio-0.0.3.tar.gz
| Download URL | ansi_stdio-0.0.3.tar.gz |
|---|---|
| Size | 15.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e8f91f4100e964cf89c36e01fabedd77c6462399189026c4fde22ddaade33253
|
|
BLAKE2b-256 checksum How to use checksums |
dfefee9179cc053ab5398cbc9b35eb1e5a8e8dcc78f32246753618fb50ebf66e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.20
|
Release files / ansi_stdio-0.0.3-py3-none-any.whl
| Download URL | ansi_stdio-0.0.3-py3-none-any.whl |
|---|---|
| Size | 19.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
15360cf7f18f17e7039ec0fd50cf8e801f41a61c9d0655bd33b14e6a94587e2d
|
|
BLAKE2b-256 checksum How to use checksums |
7a8b91da87e516c43d12d95aa2a9d2eb2f619754c03160b0c1fe3fec87c37174
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.20
|
Security for ansi-stdio 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.