skillfed

pyModbusTCP

A simple Modbus/TCP library for Python

pymodbustcp v0.3.0 101.8K downloads/30d#12,912 on PyPI347
Permissive license MIT DORMANT released

What it is and what it does

pyModbusTCP is a pure-Python implementation of the Modbus/TCP protocol, allowing you to communicate with industrial devices, PLCs, and other Modbus-enabled hardware over standard TCP connections. It provides both client and server functionality, letting you read and write holding registers and other Modbus data types. The library handles the protocol details internally and exposes a simple API for common operations like reading registers or writing values to device addresses.

The package is designed for straightforward integration into Python applications that need to interact with Modbus devices—no compiled extensions or external system libraries required. You instantiate a client with a host and port, optionally configure automatic connection handling, and then call methods to read or write device registers. It has been tested on Python 3.8, 3.9, 3.10, 3.11 and 3.12 across Linux, Mac OS and Windows.

Use it for:

  • Read sensor data or device status from industrial equipment connected via Modbus/TCP
  • Write control commands to PLCs or other Modbus devices from a Python application
  • Build a local Modbus server to simulate or proxy industrial devices for testing
  • Monitor and log register values from multiple Modbus devices in a data collection pipeline
  • Integrate legacy industrial hardware into modern Python-based automation systems

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A pure-Python Modbus/TCP client and server library for reading and writing registers over TCP connections without external dependencies.

Yes, if you need Modbus/TCP communication and are comfortable with dormant maintenance. The library is stable, dependency-free, and tested across Python 3.8 through 3.12. No known vulnerabilities. MIT license poses no restrictions. Install it for straightforward industrial device integration; avoid it only if you require active development.

Install

pymodbustcp on PyPI

pip

pip install pymodbustcp

uv

uv add pymodbustcp

poetry

poetry add pymodbustcp

Installing pyModbusTCP

Before you install

Low friction: pure Python with no runtime dependencies, distributed as a wheel. Maintenance is dormant—last release was 709 days ago—but the repository remains active with a recent commit on 2025-02-14.

License in practice

MIT license is permissive; you can use, modify, and distribute this package with minimal restrictions, suitable for both open-source and commercial projects.

Quickstart

from pyModbusTCP.client import ModbusClient

c = ModbusClient(host="localhost", port=502, unit_id=1, auto_open=True)
regs = c.read_holding_registers(0, 2)
if regs:
    print(regs)

Verify before relying

  • Whether the package is actively maintained or in long-term stable mode despite the 709-day gap since last release
  • Current compatibility with Python versions beyond 3.12, given testing through 3.12

Package facts

License MIT (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance dormant — 709 days since the last release
Last repo commit
First released
Downloads 101,834/month — #12,912 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pyModbusTCP-0.3.0-py3-none-any.whl

Tags

modbus tcp clientmodbus protocol pythonindustrial automation communicationplc data readingmodbus server librarytcp register accessmodbus device integration
industrial-automationmodbus-protocoliot-integration

More Networking packages