pyModbusTCP
A simple Modbus/TCP library for Python
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 pymodbustcpuv
uv add pymodbustcppoetry
poetry add pymodbustcpInstalling 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
More Networking packages
h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
psutilpsutil retrieves real-time information about…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
uvloopuvloop is a drop-in replacement for Python's…
permissive · top 1,000 on PyPI
execnetexecnet lets you spawn and communicate with…
permissive · top 1,000 on PyPI
pyzmqPyZMQ provides Python bindings for ZeroMQ…
permissive · top 1,000 on PyPI
pymodbusPyModbus is a complete Modbus protocol…
permissive · top 5,000 on PyPI
uModbusuModbus is a pure Python implementation of the…
copyleft · top 15,000 on PyPI
async-modbusAsync ModBus provides an asynchronous Python…
unclear · top 15,000 on PyPI
huawei-solarProvides a Python interface to read and write…
agpl · top 15,000 on PyPI
minimalmodbusMinimalmodbus provides a Python interface to…
permissive · top 15,000 on PyPI
nibeNibe provides async communication with Nibe…
copyleft · top 15,000 on PyPI
port-forport-for finds and remembers unused TCP…
permissive · top 5,000 on PyPI
goodweConnects to GoodWe solar inverters over local…
permissive · top 15,000 on PyPI
python-snap7Pure Python library for reading and writing…
permissive · top 15,000 on PyPI
pylogixPylogix reads and writes tag values from…
permissive · top 15,000 on PyPI