Python client for green-screen-proxy — typed async REST + WebSocket adapter for TN5250/TN3270/VT/HP6530 terminal emulation
Project description
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.
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 green_screen_client-1.2.3.tar.gz.
File metadata
- Download URL: green_screen_client-1.2.3.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d94a038e147ff434e474465897ffd684770f1f99b7c185e6325ebc9c948586ec
|
|
| MD5 |
1ffec901122406e2e1ca23a10c48f9e0
|
|
| BLAKE2b-256 |
e9f3fb41c41130829417d52e0118a84ca0d9a50fb9b69ef85a09893e78ecf090
|
Provenance
The following attestation bundles were made for green_screen_client-1.2.3.tar.gz:
Publisher:
publish-pypi.yml on visionbridge-solutions/green-screen-react
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
green_screen_client-1.2.3.tar.gz -
Subject digest:
d94a038e147ff434e474465897ffd684770f1f99b7c185e6325ebc9c948586ec - Sigstore transparency entry: 1239458375
- Sigstore integration time:
-
Permalink:
visionbridge-solutions/green-screen-react@7ae81fc119e05d00a348c002d794d09f9fd6c857 -
Branch / Tag:
refs/tags/v1.2.3 - Owner: https://github.com/visionbridge-solutions
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@7ae81fc119e05d00a348c002d794d09f9fd6c857 -
Trigger Event:
release
-
Statement type:
File details
Details for the file green_screen_client-1.2.3-py3-none-any.whl.
File metadata
- Download URL: green_screen_client-1.2.3-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a168ab3b1110c8e3ef12e18da8b59294c712baf4ce9fcbaed0022e0b2bf695e4
|
|
| MD5 |
49f2b8bd5ccaa82a5c006a3194b41085
|
|
| BLAKE2b-256 |
42f16790bdb645440c0820c7e32a40eb6c14ef8fb3146b88edb7a7d50bf11401
|
Provenance
The following attestation bundles were made for green_screen_client-1.2.3-py3-none-any.whl:
Publisher:
publish-pypi.yml on visionbridge-solutions/green-screen-react
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
green_screen_client-1.2.3-py3-none-any.whl -
Subject digest:
a168ab3b1110c8e3ef12e18da8b59294c712baf4ce9fcbaed0022e0b2bf695e4 - Sigstore transparency entry: 1239458377
- Sigstore integration time:
-
Permalink:
visionbridge-solutions/green-screen-react@7ae81fc119e05d00a348c002d794d09f9fd6c857 -
Branch / Tag:
refs/tags/v1.2.3 - Owner: https://github.com/visionbridge-solutions
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@7ae81fc119e05d00a348c002d794d09f9fd6c857 -
Trigger Event:
release
-
Statement type: