Name | agg-python-bindings JSON |
Version |
0.1.4
JSON |
| download |
home_page | None |
Summary | Python bindings for the Rust graph library 'agg' |
upload_time | 2025-08-17 15:11:41 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Asciinema Agg Python Bindings
This is a Python binding for [agg](https://github.com/asciinema/agg) which is a command line tool for converting asciinema recordings into GIF video files.
It requires a modified version of agg (by making some modules public), which is included in this repository at `local_cargo_registry/agg`.
## Installation
From PyPI:
```bash
pip install agg-python-bindings
```
From GitHub:
```bash
pip install git+https://github.com/james4ever0/agg-python-bindings.git
```
Source install:
```bash
git clone https://github.com/james4ever0/agg-python-bindings.git
cd agg-python-bindings
pip install .
```
## Usage
```python
import agg_python_bindings
asciicast_filepath = "asciinema.cast"
# Load asciicast file from path, save terminal screenshots separated by frame_time_min_spacing (seconds) to png_write_dir
# Output png filename format: "{png_filename_prefix}_{screenshot_timestamp}.png"
agg_python_bindings.load_asciicast_and_save_png_screenshots(
asciicast_filepath, # required, path to asciicast file (input)
png_write_dir=".", # optional
png_filename_prefix="screenshot", # optional
frame_time_min_spacing=1.0 # optional
)
# Create a virtual terminal, feed string into it, then get states and take a screenshot
test_input = 'Hello from \x1B[1;3;31mxterm.js\x1B[0m $ '
screenshot_path = "terminal_screenshot.png"
terminal = agg_python_bindings.TerminalEmulator(80, 25)
changed = terminal.feed_str(test_input)
terminal_dump = terminal.text_raw()
cursor_states = terminal.get_cursor()
width, height, success = terminal.screenshot(screenshot_path)
# print a cybergod style terminal text dump with cursor
for index, it in enumerate(terminal_dump):
if index == cursor_states[1]:
it = it[:cursor_states[0]] +"<|cursor|>"+it[cursor_states[0]:]
print(">", it)
```
Raw data
{
"_id": null,
"home_page": null,
"name": "agg-python-bindings",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/95/7a/41e3d2a0e250257d7c03d8e5b508e43db0a2b326b7f5d307ee718e44a1d4/agg_python_bindings-0.1.4.tar.gz",
"platform": null,
"description": "# Asciinema Agg Python Bindings\n\nThis is a Python binding for [agg](https://github.com/asciinema/agg) which is a command line tool for converting asciinema recordings into GIF video files.\n\nIt requires a modified version of agg (by making some modules public), which is included in this repository at `local_cargo_registry/agg`.\n\n## Installation\n\nFrom PyPI:\n\n```bash\npip install agg-python-bindings\n```\n\nFrom GitHub:\n\n```bash\npip install git+https://github.com/james4ever0/agg-python-bindings.git\n```\n\nSource install:\n\n```bash\ngit clone https://github.com/james4ever0/agg-python-bindings.git\ncd agg-python-bindings\npip install .\n```\n\n## Usage\n\n```python\nimport agg_python_bindings\n\nasciicast_filepath = \"asciinema.cast\"\n\n# Load asciicast file from path, save terminal screenshots separated by frame_time_min_spacing (seconds) to png_write_dir\n# Output png filename format: \"{png_filename_prefix}_{screenshot_timestamp}.png\"\nagg_python_bindings.load_asciicast_and_save_png_screenshots(\n asciicast_filepath, # required, path to asciicast file (input)\n png_write_dir=\".\", # optional\n png_filename_prefix=\"screenshot\", # optional\n frame_time_min_spacing=1.0 # optional\n)\n\n# Create a virtual terminal, feed string into it, then get states and take a screenshot\ntest_input = 'Hello from \\x1B[1;3;31mxterm.js\\x1B[0m $ '\nscreenshot_path = \"terminal_screenshot.png\"\nterminal = agg_python_bindings.TerminalEmulator(80, 25)\nchanged = terminal.feed_str(test_input)\nterminal_dump = terminal.text_raw()\ncursor_states = terminal.get_cursor()\nwidth, height, success = terminal.screenshot(screenshot_path)\n\n# print a cybergod style terminal text dump with cursor\nfor index, it in enumerate(terminal_dump):\n if index == cursor_states[1]:\n it = it[:cursor_states[0]] +\"<|cursor|>\"+it[cursor_states[0]:]\n print(\">\", it)\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "Python bindings for the Rust graph library 'agg'",
"version": "0.1.4",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "86c76b48b65bab98cb98ee7321bee294204592abbb0abb84128480981e937a27",
"md5": "7215c046435c25557ac1cb9cb1178fc1",
"sha256": "002238b0e61bcd8900d2ac60cf9269e5a52a66cb0e1a7f18fe2b35ca04931cc8"
},
"downloads": -1,
"filename": "agg_python_bindings-0.1.4-cp310-cp310-manylinux_2_34_x86_64.whl",
"has_sig": false,
"md5_digest": "7215c046435c25557ac1cb9cb1178fc1",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.8",
"size": 1533445,
"upload_time": "2025-08-17T15:11:56",
"upload_time_iso_8601": "2025-08-17T15:11:56.233276Z",
"url": "https://files.pythonhosted.org/packages/86/c7/6b48b65bab98cb98ee7321bee294204592abbb0abb84128480981e937a27/agg_python_bindings-0.1.4-cp310-cp310-manylinux_2_34_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "d86e91be2682de6f7001035404cd3753da1a1ffdd0c513e3325c6cd07a68e9d1",
"md5": "5f2731b0169039838be0be3748c586d6",
"sha256": "e684a8c8ec74ac16f45666763ee4e73e3c17dd5defbd0f2ee63e8fec3f9b49c2"
},
"downloads": -1,
"filename": "agg_python_bindings-0.1.4-cp311-cp311-manylinux_2_34_x86_64.whl",
"has_sig": false,
"md5_digest": "5f2731b0169039838be0be3748c586d6",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.8",
"size": 1532995,
"upload_time": "2025-08-17T15:12:02",
"upload_time_iso_8601": "2025-08-17T15:12:02.034569Z",
"url": "https://files.pythonhosted.org/packages/d8/6e/91be2682de6f7001035404cd3753da1a1ffdd0c513e3325c6cd07a68e9d1/agg_python_bindings-0.1.4-cp311-cp311-manylinux_2_34_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "1b6e93896393a67550c38efe1dfb47af8fd7e9fe1f9738a882bc0eda54e1e69d",
"md5": "70808940c6ba79aaa158077e4454bec9",
"sha256": "3f9a2ab279101267243f499603e1e57afcaae9778cf66e03b6e7670741a81a87"
},
"downloads": -1,
"filename": "agg_python_bindings-0.1.4-cp312-cp312-manylinux_2_34_x86_64.whl",
"has_sig": false,
"md5_digest": "70808940c6ba79aaa158077e4454bec9",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.8",
"size": 1532544,
"upload_time": "2025-08-17T15:12:06",
"upload_time_iso_8601": "2025-08-17T15:12:06.873817Z",
"url": "https://files.pythonhosted.org/packages/1b/6e/93896393a67550c38efe1dfb47af8fd7e9fe1f9738a882bc0eda54e1e69d/agg_python_bindings-0.1.4-cp312-cp312-manylinux_2_34_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "0095618704b2e3d9be502e8c8b238d2c5f7618fc25e90c8716d11d15f2eaa78d",
"md5": "a4d313a27d7c6269e30620758f1fcf44",
"sha256": "0507a5ccba48b7884b0399dc72025e392fe4fae8d652260d8f69ab4dcac695b4"
},
"downloads": -1,
"filename": "agg_python_bindings-0.1.4-cp38-cp38-manylinux_2_34_x86_64.whl",
"has_sig": false,
"md5_digest": "a4d313a27d7c6269e30620758f1fcf44",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.8",
"size": 1533242,
"upload_time": "2025-08-17T15:11:45",
"upload_time_iso_8601": "2025-08-17T15:11:45.685886Z",
"url": "https://files.pythonhosted.org/packages/00/95/618704b2e3d9be502e8c8b238d2c5f7618fc25e90c8716d11d15f2eaa78d/agg_python_bindings-0.1.4-cp38-cp38-manylinux_2_34_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "a31f63dee8efbdceda1f10f754d8ff5a75aee5e8f3ab1726c379bd1f1c5b45a8",
"md5": "5ee893102a08a2d48a013cb0d865ad4c",
"sha256": "ec1dd9d30e30c1e820389fdbd16b8e10754d419c1e555ef7c8527b274eb17305"
},
"downloads": -1,
"filename": "agg_python_bindings-0.1.4-cp39-cp39-manylinux_2_34_x86_64.whl",
"has_sig": false,
"md5_digest": "5ee893102a08a2d48a013cb0d865ad4c",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.8",
"size": 1533917,
"upload_time": "2025-08-17T15:11:50",
"upload_time_iso_8601": "2025-08-17T15:11:50.624036Z",
"url": "https://files.pythonhosted.org/packages/a3/1f/63dee8efbdceda1f10f754d8ff5a75aee5e8f3ab1726c379bd1f1c5b45a8/agg_python_bindings-0.1.4-cp39-cp39-manylinux_2_34_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "957a41e3d2a0e250257d7c03d8e5b508e43db0a2b326b7f5d307ee718e44a1d4",
"md5": "51f3387f677cba64d31d4dd6dd3c8fb3",
"sha256": "f09927eab546f69aa1b602c11481189a09a6f91f7179738a725cee66709cdd42"
},
"downloads": -1,
"filename": "agg_python_bindings-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "51f3387f677cba64d31d4dd6dd3c8fb3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 85095,
"upload_time": "2025-08-17T15:11:41",
"upload_time_iso_8601": "2025-08-17T15:11:41.190452Z",
"url": "https://files.pythonhosted.org/packages/95/7a/41e3d2a0e250257d7c03d8e5b508e43db0a2b326b7f5d307ee718e44a1d4/agg_python_bindings-0.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-17 15:11:41",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "agg-python-bindings"
}