Skip to main content

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

green_screen_client-1.4.0.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

green_screen_client-1.4.0-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file green_screen_client-1.4.0.tar.gz.

File metadata

  • Download URL: green_screen_client-1.4.0.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for green_screen_client-1.4.0.tar.gz
Algorithm Hash digest
SHA256 8aeb3a8fb8dd9d540e19a34613a4636ecf2f60467f9fa64e62cdf66fc10a7e95
MD5 edf796b0ee96ceac3aee98b724a983ef
BLAKE2b-256 6b722295ebef0a10b39070d24b9f36f019c22cd21b7be4d568db4dbe56d230a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for green_screen_client-1.4.0.tar.gz:

Publisher: publish-pypi.yml on visionbridge-solutions/green-screen-react

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file green_screen_client-1.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for green_screen_client-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1342c607a97961058c5c2205735e54a4b2026d6631f4321e6a8469b6604cc741
MD5 361d0d5caf1a4738bd649e3a6cdefd0b
BLAKE2b-256 59728aafc5f421e9e129f990b4a39652c743e83c995f08d08ac92bba7e2ad964

See more details on using hashes here.

Provenance

The following attestation bundles were made for green_screen_client-1.4.0-py3-none-any.whl:

Publisher: publish-pypi.yml on visionbridge-solutions/green-screen-react

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page