Install & Compatibility
Where this runs
tested against v2.4.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.1MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 1.6s · import 0.000s · 19MB
16MB installed
● package 16MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
asciinema
✓ asciinema rec my_session.cast
✗ import asciinema; asciinema.record()
Asciinema is primarily a command-line tool. Direct programmatic import and control of recording/playback features as a Python library are not commonly documented or intended for end-users. It's mainly used by executing the `asciinema` command in the shell or via `subprocess` calls in Python.
Record a terminal session, save it locally, play it back in the terminal, and then upload it to asciinema.org. The `rec` command starts a new shell where your actions are recorded. To end the recording, type `exit` or press `Ctrl+D`.
asciinema rec demo.cast
# Type some commands, then press Ctrl+D or type 'exit'
echo "Hello from Asciinema!"
pwd
ls -la
exit
asciinema play demo.cast
asciinema upload demo.cast # Will prompt for confirmation to upload to asciinema.org
asciinema --version
Debug
Known issues
breakingAsciinema CLI version 3.x (a complete rewrite in Rust, not this Python package) introduces several breaking changes from 2.x, including a new default asciicast v3 format, required filename for `rec`, and renaming of options like `--stdin` to `--capture-input`, and `--env` to `--capture-env`. If you install 3.x from source or other means, be aware of these changes.fixFor 2.x behavior, explicitly specify `--output-format asciicast-v2` if interacting with older tools, or adjust command-line arguments to the new 3.x equivalents. Stick to `asciinema==2.4.0` from PyPI if 2.x behavior is strictly required.
affects: 3.x (Rust rewrite) vs 2.x (Python)
gotchaThe `asciinema` PyPI package (v2.x) is designed as a standalone command-line application. While it's written in Python, it's not intended for direct `import` and programmatic control of recording/playback features within custom Python scripts. Attempts to import and use internal modules for this purpose may lead to unexpected behavior or API instability.fixUse `subprocess` module to call `asciinema` commands if you need to integrate its functionality into a Python application, or consider alternative Python libraries if low-level terminal interaction/recording is required programmatically.
affects: All versions of the Python package (2.x)
deprecatedThe Python-based `asciinema` CLI (version 2.x, including 2.4.0) is now considered the 'previous generation' by the project maintainers. Primary development for the core `asciinema` CLI has shifted to a Rust rewrite (version 3.x). While 2.x is stable and maintained, new major features are likely to land in the Rust version.fixUsers seeking the absolute latest features or ongoing active development for the CLI might consider the Rust-based version (often installed via `cargo` or package managers for 3.x releases), or continue using 2.x for its stability.
affects: 2.x
gotchaThe default configuration file location changed from `$HOME/.asciinema` to `$HOME/.config/asciinema/config`. If you had custom configurations in the old location, they will not be picked up automatically.fixMove your existing configuration file from `$HOME/.asciinema` to `$HOME/.config/asciinema/config`.
affects: < 1.1
gotchaThe term 'API token' used in older versions (prior to 2.0) has been renamed to 'install ID'. This ID is generated locally and used to associate recordings with your asciinema.org account for management.fixWhen performing `asciinema auth` or managing recordings online, be aware that what was previously called an 'API token' is now referred to as an 'install ID'.
affects: < 2.0
Upgrade
Version history
2.4.0latest on PyPI · released Oct 23, 2023
Audit
Dependencies
No dependency data recorded yet.