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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

ibm3270-0.1.0-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ibm3270-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.0 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36c72082db818c109446eeb4887d6468fd385328a311e0f029f999e03eebaaad
MD5 ef04864a23c9aae87a2d726185f2bd4c
BLAKE2b-256 d73c19d95b1a877537364281f5e6715299cf82d27608352f3188a6d8ced2438c

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