green-screen-client
Python client for green-screen-proxy — typed async REST + WebSocket adapter for TN5250, TN3270, VT, and HP 6530 terminal emulation.
This is a standalone package. It is not bundled with or required by green-screen-react — install it separately when your integration runs on Python.
Install
pip install green-screen-client
Three layers, pick what fits
1. Low-level REST (RestClient)
Thin wrapper over the proxy's HTTP endpoints. One method per endpoint, dataclasses in/out.
from green_screen_client import RestClient, ConnectConfig
async with RestClient("http://proxy:3001") as client:
await client.connect(ConnectConfig(
host="pub400.com",
protocol="tn5250",
username="alice",
password="secret",
))
screen = await client.get_screen()
print(screen.content)
await client.send_text("1")
await client.send_key("Enter")
2. Low-level WebSocket (WsClient)
Single WebSocket, real-time screen pushes, reattach for session recovery, lifecycle events (session.lost, session.resumed).
from green_screen_client import WsClient
async with WsClient("http://proxy:3001") as client:
await client.reattach("abc-123") # reattach after page reload / process restart
client.on_screen(lambda s: print("screen update:", s.cursor_row, s.cursor_col))
client.on_session_lost(lambda sid, status: print("lost:", sid, status.status))
async for event in client.events():
if event.type == "screen":
...
3. High-level ProxyTerminalClient + ScreenBuffer
Drop-in shape for integrations that already read client.screen.fields, client.screen.cursor_row, etc.
from green_screen_client import ProxyTerminalClient
async with ProxyTerminalClient("http://proxy:3001", host="pub400.com") as client:
await client.login("alice", "secret")
await client.send_key("PF3")
print(client.screen.cursor_row, client.screen.cursor_col)
for field in client.screen.fields:
print(field)
v1.2.0 primitives
read_mdt(modified_only=True)— cheap post-write verification via per-field MDT bits.resume_session(session_id)— REST probe for "is this session still alive?"mark_authenticated(username)— flip session status after your own sign-on cascade (the proxy stays protocol-generic).wait_for_fields(min_fields, timeout_ms=...)— wait until a form with N input fields appears.
License
MIT.
Metadata
Release files for green-screen-client 1.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| green_screen_client-1.6.0.tar.gz | 17.1 kB | With provenance | Details for green_screen_client-1.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| green_screen_client-1.6.0-py3-none-any.whl | Python 3 | none | any | Details for green_screen_client-1.6.0-py3-none-any.whl |
Total release size: 35.7 kB
Release files / green_screen_client-1.6.0.tar.gz
| Download URL | green_screen_client-1.6.0.tar.gz |
|---|---|
| Size | 17.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a9f7013b1c9e4a26e2523fa103c7b23d8f8a056cef1d7eea132b999636224311
|
|
BLAKE2b-256 checksum How to use checksums |
a02ba9a519fcf8549b322eb87b022f5d0a26c0f8f89c9ef86a96ebde2f53a233
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 12, 2026.
Transparency logRelease files / green_screen_client-1.6.0-py3-none-any.whl
| Download URL | green_screen_client-1.6.0-py3-none-any.whl |
|---|---|
| Size | 18.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5729153c8b2d77164236a883c3702992cd9a35835cc90a56641eb45eeb334907
|
|
BLAKE2b-256 checksum How to use checksums |
4bc6299b278c77cc1c61b6f354ff8244772da5d54f5447fbee7539c63d8e4c87
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 12, 2026.
Transparency logSecurity for green-screen-client 1.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for green_screen_client-1.6.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 12, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.