TermCap
TermCap 是一个 Python 终端录制与渲染工具:把 PTY 会话保存为 asciicast v2,并输出 SVG 动画、静态 SVG 帧或 GIF。
核心能力
- 交互 shell 与单命令 PTY 录制
- 兼容 asciinema 的
.cast格式 - ANSI 颜色、光标、文本样式和宽字符渲染
- 模板化 SVG 动画与 16 套内置主题
- CAST→SVG、CAST→GIF、SVG→GIF
- 关键帧确定性采样和 Chrome viewport 自动校正
安装
TermCap 支持 Linux、macOS 和 BSD,需要 Python 3.8 或更高版本。GIF 导出需要 Google Chrome。
python -m pip install termcap
termcap --version
最短工作流
termcap record demo.cast -g 80x20
termcap render demo.cast demo.svg
termcap render demo.cast demo.gif --format gif
录制单条命令:
termcap record tests.cast -g 100x24 -c "python -m pytest -q"
已有 SVG 转 GIF:
termcap svg2gif demo.svg demo.gif --speed 1 --loop 0
文档开发
python -m pip install -e '.[dev,docs]'
mkdocs serve
mkdocs build --strict
许可证
MIT License
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file termcap-0.2.1.tar.gz.
File metadata
- Download URL: termcap-0.2.1.tar.gz
- Upload date:
- Size: 144.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c2cd62d8735e439ea8861344f42b6e5e0a25c4c3cd9294cade68c4034ab084c
|
|
| MD5 |
32203f563dd3992e2b1327727b53a1bd
|
|
| BLAKE2b-256 |
4dcb4da9678aeae40d2b046ec7249000b58bca800829fb712aa17ebfabbfaa18
|
Provenance
The following attestation bundles were made for termcap-0.2.1.tar.gz:
Publisher:
publish.yml on ChatArch/TermCap
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
termcap-0.2.1.tar.gz -
Subject digest:
2c2cd62d8735e439ea8861344f42b6e5e0a25c4c3cd9294cade68c4034ab084c - Sigstore transparency entry: 2297973148
- Sigstore integration time:
-
Permalink:
ChatArch/TermCap@ff87c0c378927a39446511df264cb223c9d1efec -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/ChatArch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ff87c0c378927a39446511df264cb223c9d1efec -
Trigger Event:
push
-
Statement type:
File details
Details for the file termcap-0.2.1-py3-none-any.whl.
File metadata
- Download URL: termcap-0.2.1-py3-none-any.whl
- Upload date:
- Size: 150.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2818d12710fe11f7918876bd90a471fe1e57c3b7c6bb1a1caa66d70837841b6
|
|
| MD5 |
7df0f754e50e70ba4618c773b7d79750
|
|
| BLAKE2b-256 |
4b1507a9e64172e07f4e27249006b612a4fecc2ec4e173eb0b39cac241a62017
|
Provenance
The following attestation bundles were made for termcap-0.2.1-py3-none-any.whl:
Publisher:
publish.yml on ChatArch/TermCap
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
termcap-0.2.1-py3-none-any.whl -
Subject digest:
f2818d12710fe11f7918876bd90a471fe1e57c3b7c6bb1a1caa66d70837841b6 - Sigstore transparency entry: 2297973171
- Sigstore integration time:
-
Permalink:
ChatArch/TermCap@ff87c0c378927a39446511df264cb223c9d1efec -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/ChatArch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ff87c0c378927a39446511df264cb223c9d1efec -
Trigger Event:
push
-
Statement type: