Skip to main content

Python wrapper for the s3270 IBM 3270 terminal emulator

Project description

ibm3270

Python wrapper for the s3270 IBM 3270 terminal emulator.

ibm3270 provides a synchronous, testable API for automating TN3270 terminal workflows from Python.

Features

  • Simple synchronous API built around the Terminal class
  • Screen reading helpers (screen(), read(), coordinate-based access)
  • Input helpers (string(), enter(), pf())
  • Wait and synchronization helpers (wait_for(), unlock/state waits)
  • Structured errors for predictable exception handling
  • Unit and integration test suite

Requirements

  • Python 3.11+
  • s3270 installed and available on your PATH (or configured via TerminalOptions)

What Is s3270?

s3270 is the scriptable command-line emulator from the x3270 suite. It implements the TN3270/TN3270E protocol and exposes terminal operations (connect, read screen, send keys) in a way automation tools can drive. ibm3270 uses s3270 as its execution engine and provides a clean Python API on top.

Installation

Install from source

git clone https://github.com/dmalta/ibm3270.git
cd ibm3270
pip install .

Install for development

pip install -e .
pip install pytest pytest-cov pytest-timeout

See the full platform-specific setup guide in docs/user_guide/01_installation.md.

Quickstart

from ibm3270 import Terminal


def main() -> None:
    term = Terminal()
    term.start()
    try:
        term.connect("example.mainframe.com", 23)
        if term.wait_for("READY", timeout=5_000):
            term.refresh()
            print(term.screen())
        term.disconnect()
    finally:
        term.stop()


if __name__ == "__main__":
    main()

User Guide TOC

Additional Documentation

References

Running Tests

pytest

Run integration tests separately (requires a working s3270 + live host setup):

pytest -m integration

Packaging

Build source and wheel distributions:

python -m build

The project uses hatchling as its PEP 517 build backend.

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

ibm3270-0.1.2.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

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

ibm3270-0.1.2-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file ibm3270-0.1.2.tar.gz.

File metadata

  • Download URL: ibm3270-0.1.2.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for ibm3270-0.1.2.tar.gz
Algorithm Hash digest
SHA256 3a72c3c27d1f78ceffee5bfe5f9c421f031e2c5df6c97002d7c0cdbaaf2fe603
MD5 8193d41d6834ad3ab9c765f005a6e0d4
BLAKE2b-256 36ce39772a699492dc8a1c3c7b6a938deca50da58fbf074997841f43d75f40d5

See more details on using hashes here.

File details

Details for the file ibm3270-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: ibm3270-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for ibm3270-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 94faeb38a8c06341f5007bdf484c905ec78409ed8a55bdfed9e172100909be51
MD5 eeaf8e2347b2889dc39fa1488656c46e
BLAKE2b-256 083f944debb3a910d0f4eaf164abf6c2fe4d6057b294547304c90f97af4ff6f1

See more details on using hashes here.

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