Thin Python client for the pupptyeer daemon (NDJSON over a unix socket).
Project description
pupptyeer-client
Thin Python client for the pupptyeer daemon: NDJSON over a unix socket, standard library only (no dependencies).
pupptyeer is a local daemon that owns persistent PTY sessions. This client talks to it over the
daemon's unix socket; it does not start the daemon. Install and run the daemon separately (see the
main README), or npm i -g pupptyeer for the
prebuilt binary.
Install
pip install pupptyeer-client
Requires Python >= 3.8.
Usage
import os, sys
from pupptyeer_client import PupptyeerClient
# Connect to the daemon's unix socket (the daemon exports its path via $PUPPTYEER_SOCK).
c = PupptyeerClient.connect(os.environ["PUPPTYEER_SOCK"])
# Spawn a command in a fresh PTY; get back a session id.
sid = c.new_session(command="bash", cols=80, rows=24)
# Stream the session's live output, then attach this connection.
c.on_output(sid, lambda b: sys.stdout.buffer.write(b))
c.attach(sid, cols=80, rows=24)
# Drive it.
c.write_pane(sid, "echo hello\n")
# Read the daemon's authoritative rendered screen once the PTY goes quiet.
screen = c.capture_screen(sid, settle_ms=50)
print("\n".join(screen.lines))
c.close() # sessions outlive the client
See the protocol spec for the full
verb set (new_session, list_sessions, attach/detach, write_pane, capture_pane,
resize, kill, gc).
License
MIT
Project details
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 pupptyeer_client-0.6.0.tar.gz.
File metadata
- Download URL: pupptyeer_client-0.6.0.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9eb926b5481dd8a13ab7bee083d884856d0a85acae9c72d14189e55d253d9eb2
|
|
| MD5 |
ca9185e170b8cde867f39d5686ce8bfd
|
|
| BLAKE2b-256 |
d88cbd71e991df86e17795a84e4279a92d1660dbedf3b8a6c97f096b47a7e4a0
|
Provenance
The following attestation bundles were made for pupptyeer_client-0.6.0.tar.gz:
Publisher:
release.yml on PeterSR/pupptyeer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pupptyeer_client-0.6.0.tar.gz -
Subject digest:
9eb926b5481dd8a13ab7bee083d884856d0a85acae9c72d14189e55d253d9eb2 - Sigstore transparency entry: 1815887629
- Sigstore integration time:
-
Permalink:
PeterSR/pupptyeer@c4cb1d8cb5f2fae743d9f4ff730be855d7594181 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/PeterSR
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c4cb1d8cb5f2fae743d9f4ff730be855d7594181 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pupptyeer_client-0.6.0-py3-none-any.whl.
File metadata
- Download URL: pupptyeer_client-0.6.0-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
808da52a3d302bf437dbcbaf6ee4150e704de09ed4e8c30d7e6e32a51894550f
|
|
| MD5 |
bd0531942c09f03b4f8ca38344740fab
|
|
| BLAKE2b-256 |
765ce549ebadd6247ac25e40caa9873b9ab3c72a49f4e57b00d1548cf7ef6dea
|
Provenance
The following attestation bundles were made for pupptyeer_client-0.6.0-py3-none-any.whl:
Publisher:
release.yml on PeterSR/pupptyeer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pupptyeer_client-0.6.0-py3-none-any.whl -
Subject digest:
808da52a3d302bf437dbcbaf6ee4150e704de09ed4e8c30d7e6e32a51894550f - Sigstore transparency entry: 1815888160
- Sigstore integration time:
-
Permalink:
PeterSR/pupptyeer@c4cb1d8cb5f2fae743d9f4ff730be855d7594181 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/PeterSR
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c4cb1d8cb5f2fae743d9f4ff730be855d7594181 -
Trigger Event:
push
-
Statement type: