pyghostty
Unofficial (but complete) python bindings for libghostty-vt. libghostty is Ghostty's embeddable terminal emulation core, a headless, high-fidelity VT emulator for Python. These bindings cover terminal state, screen and scrollback snapshots, kitty graphics, and everything else Ghostty's production terminal core handles.
The binding is Python-ABI-independent: pure Python (cffi ABI mode) over a bundled libghostty-vt shared library, so one wheel per platform covers every Python version. No compiler is needed at install time.
Usage
from pyghostty import Terminal
with Terminal(cols=80, rows=24) as t:
t.feed('hello\r\nworld')
t.cursor # (x, y), 0-indexed
t.text() # plain text of the visible screen only
t.contents() # everything: scrollback plus screen, soft-wraps unwrapped
t.resize(120, 24) # reflows the primary screen
The base layer, pyghostty._cdef/_ffi, exposes the complete generated C API as raw ffi/lib (regenerate with gen_cdef.py after moving the pinned ghostty rev).
pyghostty.core.Terminal provides an ergonomic wrapper for commonly used parts.
Building the library
The shared library is built from a ghostty checkout with the Zig toolchain (installed via pip as ziglang):
GHOSTTY_SRC=/path/to/ghostty python build_lib.py
The checkout must be at the revision pinned in pyproject.toml. This runs zig build -Demit-lib-vt=true and copies the resulting shared library into pyghostty/_lib/, where the package loader and wheel builds pick it up.
Development
pip install -e .[dev]
GHOSTTY_SRC=/path/to/ghostty python build_lib.py
pytest -q
Versioning
Version lives in pyghostty/__init__.py as __version__.
Releases
Pushing a v* tag runs .github/workflows/release.yml, which builds and tests one Python-ABI-independent wheel for each supported platform and publishes the wheels to GitHub and PyPI. Releases are wheel-only; source remains available from the corresponding GitHub tag.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
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 pyghostty-0.1.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: pyghostty-0.1.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 2.2 MB
- Tags: Python 3, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9461e0e42d9be8fd0a0afcd0e7c9487d5e900b1e57e64df16adc0ebdbb527194
|
|
| MD5 |
ace70c83766af4cc6c33d81c63c49bc5
|
|
| BLAKE2b-256 |
50c9d56ce52b8e109c2dfa7882fe0b7b9ebd527c554b7d5e33f9e2648dfa89f3
|
Provenance
The following attestation bundles were made for pyghostty-0.1.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
release.yml on AnswerDotAI/pyghostty
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyghostty-0.1.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
9461e0e42d9be8fd0a0afcd0e7c9487d5e900b1e57e64df16adc0ebdbb527194 - Sigstore transparency entry: 2232173069
- Sigstore integration time:
-
Permalink:
AnswerDotAI/pyghostty@775036f655f852d4a8d25d3e80d77f74355f93ea -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/AnswerDotAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@775036f655f852d4a8d25d3e80d77f74355f93ea -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyghostty-0.1.0-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.
File metadata
- Download URL: pyghostty-0.1.0-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 2.0 MB
- Tags: Python 3, manylinux: glibc 2.27+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a1c628bff9a449707ea71ae6fd47e859ce5d80a5312bef357c383b7e7a7e71c
|
|
| MD5 |
91a32fbb08ef25b369b008753d0d18b2
|
|
| BLAKE2b-256 |
1fe1c2815400bb74a9846b44f2aa86e83088f42312b7e48c18a576b4d703fd7a
|
Provenance
The following attestation bundles were made for pyghostty-0.1.0-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl:
Publisher:
release.yml on AnswerDotAI/pyghostty
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyghostty-0.1.0-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl -
Subject digest:
8a1c628bff9a449707ea71ae6fd47e859ce5d80a5312bef357c383b7e7a7e71c - Sigstore transparency entry: 2232171823
- Sigstore integration time:
-
Permalink:
AnswerDotAI/pyghostty@775036f655f852d4a8d25d3e80d77f74355f93ea -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/AnswerDotAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@775036f655f852d4a8d25d3e80d77f74355f93ea -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyghostty-0.1.0-py3-none-macosx_13_0_x86_64.whl.
File metadata
- Download URL: pyghostty-0.1.0-py3-none-macosx_13_0_x86_64.whl
- Upload date:
- Size: 656.0 kB
- Tags: Python 3, macOS 13.0+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2722590d17f4cb5376e1d04d251a824b173223bb45466e94632c61b4e1cef577
|
|
| MD5 |
cd14d5d739a9e973bf4df6c6c8819814
|
|
| BLAKE2b-256 |
6682b8531f50f44e8fa85cd96acd011067f55c932f4225891d34bb3e5def9b4f
|
Provenance
The following attestation bundles were made for pyghostty-0.1.0-py3-none-macosx_13_0_x86_64.whl:
Publisher:
release.yml on AnswerDotAI/pyghostty
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyghostty-0.1.0-py3-none-macosx_13_0_x86_64.whl -
Subject digest:
2722590d17f4cb5376e1d04d251a824b173223bb45466e94632c61b4e1cef577 - Sigstore transparency entry: 2232172402
- Sigstore integration time:
-
Permalink:
AnswerDotAI/pyghostty@775036f655f852d4a8d25d3e80d77f74355f93ea -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/AnswerDotAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@775036f655f852d4a8d25d3e80d77f74355f93ea -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyghostty-0.1.0-py3-none-macosx_13_0_arm64.whl.
File metadata
- Download URL: pyghostty-0.1.0-py3-none-macosx_13_0_arm64.whl
- Upload date:
- Size: 591.2 kB
- Tags: Python 3, macOS 13.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b9dd0487667be3500e51ffbf5ca87f53e020a9ef36f0dc0cf4ddd277e8822b2
|
|
| MD5 |
9de1a9443c8dea81199440b37862d3cf
|
|
| BLAKE2b-256 |
5b9e64b07389d5a99d3c735f02629c561729f7df5a6ec4c7a8d1a9b6df6feef4
|
Provenance
The following attestation bundles were made for pyghostty-0.1.0-py3-none-macosx_13_0_arm64.whl:
Publisher:
release.yml on AnswerDotAI/pyghostty
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyghostty-0.1.0-py3-none-macosx_13_0_arm64.whl -
Subject digest:
5b9dd0487667be3500e51ffbf5ca87f53e020a9ef36f0dc0cf4ddd277e8822b2 - Sigstore transparency entry: 2232172089
- Sigstore integration time:
-
Permalink:
AnswerDotAI/pyghostty@775036f655f852d4a8d25d3e80d77f74355f93ea -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/AnswerDotAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@775036f655f852d4a8d25d3e80d77f74355f93ea -
Trigger Event:
push
-
Statement type: