Skip to main content

anihmm

anihmm draws small HMM-style animations in a terminal. Use it as a loading indicator, build a custom state path, or render individual frames with Rich.

<img src="https://raw.githubusercontent.com/leightonpayne/anihmm/main/docs/assets/anihmm-demo.gif" alt="Terminal animation progressing through an HMM path" width="100%"

Install

pip install anihmm

Python 3.10 or newer is required.

Use

Wrap the work you want to animate:

from anihmm import ProcessingOptions, processing_animation

with processing_animation(ProcessingOptions.random()):
    run_your_work()

The animation runs in the background and stops when the block exits. When output is redirected or captured, anihmm stays quiet automatically.

When the work finishes, you can replace the animation with a final frame and print the results:

<img src="https://raw.githubusercontent.com/leightonpayne/anihmm/main/docs/assets/processing-results.gif" alt="Processing animation handing off to HMM result counts" width="100%"

To show fixed text on a random path:

with processing_animation(
    ProcessingOptions.random(emissions="SEARCHING", seed=7)
):
    run_your_work()

Async code uses the matching context manager:

from anihmm import ProcessingOptions, async_processing_animation

async with async_processing_animation(ProcessingOptions.random()):
    await run_your_work()

Advance a predetermined path as individual units of work complete:

from anihmm import progress_animation

with progress_animation(columns=3) as progress:
    for state, emission in (("M", "A"), ("D", None), ("M", "C")):
        run_one_step()
        progress.advance(state, emission=emission)
    progress.finish()

<img src="https://raw.githubusercontent.com/leightonpayne/anihmm/main/docs/assets/progress-indicator.gif" alt="Work advancing a predetermined HMM path" width="100%"

Build a sequence

Use HMMSequence when a preset is not enough:

from anihmm import HMMSequence, compile_steps

sequence = HMMSequence()
for symbol in "SEARCH":
    sequence.settle("M")
    sequence.emit(symbol)
sequence.finish()

frames = compile_steps(sequence.build())

More examples

Generate an exact number of random emissions:

<img src="https://raw.githubusercontent.com/leightonpayne/anihmm/main/docs/assets/random-emissions.gif" alt="Random amino-acid emissions" width="100%"

Keep fixed text while generating a different path on each loop:

<img src="https://raw.githubusercontent.com/leightonpayne/anihmm/main/docs/assets/changing-paths.gif" alt="WAITING emitted on changing random paths" width="100%"

Complete the unused columns of a bounded sequence with deletion states:

<img src="https://raw.githubusercontent.com/leightonpayne/anihmm/main/docs/assets/delete-completion.gif" alt="Automatic deletion-state completion" width="100%"

Preview every possible transition before settling on one:

<img src="https://raw.githubusercontent.com/leightonpayne/anihmm/main/docs/assets/transition-previews.gif" alt="Candidate transition previews" width="100%"

The runnable versions are in examples/, with explanations in the examples guide.

Documentation

Metadata

Release files for anihmm 0.1.0

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

Source distribution (sdist)

Source distribution for anihmm 0.1.0
File Size Uploaded Provenance Actions
anihmm-0.1.0.tar.gz 25.6 kB With provenance Details for anihmm-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for anihmm 0.1.0
File Interpreter ABI Platform Actions
anihmm-0.1.0-py3-none-any.whl Python 3 none any Details for anihmm-0.1.0-py3-none-any.whl

Total release size: 59.7 kB

Release files / anihmm-0.1.0.tar.gz

Download URL anihmm-0.1.0.tar.gz
Size 25.6 kB
Tags Source
SHA-256 checksum
How to use checksums
00f8eb59eac03390e4ee3e71df1a67344b4f7ebe85ac1d026fdf00654b65f96c
BLAKE2b-256 checksum
How to use checksums
01d17610faf65d1ff0422d6f1f0dda29ca8e482b848876b1a181770055f90660
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / anihmm-0.1.0-py3-none-any.whl

Download URL anihmm-0.1.0-py3-none-any.whl
Size 34.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ce5c9deba2fb52ff59671dbb1fefcd8fad2911054bae75b2b26b0c61a7a97df8
BLAKE2b-256 checksum
How to use checksums
bbbee093d8e9600476c58418604a3195b5aa11a9d048d7a4016c8e438b60a10f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Security for anihmm 0.1.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for anihmm-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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