pymodbus
A fully featured modbus protocol stack in python
What it is and what it does
PyModbus is a mature, production-grade implementation of the Modbus protocol stack in pure Python. It provides three main components: a client for connecting to Modbus devices, a server for emulating devices, and an HTML-based simulator for testing and development. The library supports all standard Modbus frames (socket, RTU, RTU-over-TCP, TCP, ASCII) and communication methods (serial/RS-485, TCP, TLS, UDP), with both synchronous and asynchronous APIs for different application needs.
The package is designed for industrial automation and SCADA applications where Python applications need to communicate with Modbus-compliant devices. It's embedded in projects like Home Assistant and is lightweight with no mandatory third-party dependencies. The library follows a non-standard versioning scheme where Z releases are bug fixes, Y releases include API changes, and X releases indicate major rewrites—the documentation emphasizes checking the API_changes and CHANGELOG files when upgrading between minor versions.
Use it for:
- Build a Python application that reads sensor data from industrial Modbus devices over TCP or serial connections.
- Create a virtual Modbus device server to test client applications without physical hardware.
- Simulate multiple Modbus devices for high-volume testing of SCADA or automation software.
- Integrate Modbus communication into existing Python projects with minimal dependencies.
- Monitor and debug Modbus traffic using the web-based simulator interface.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
PyModbus is a complete Modbus protocol implementation providing client, server, and simulator components with both synchronous and asynchronous APIs for industrial device communication.
Yes. PyModbus is a stable, actively maintained library (release 1 day old, 2754 GitHub stars) with no security vulnerabilities, low install friction, and permissive licensing. It's the standard choice for Modbus protocol work in Python and is embedded in production systems like Home Assistant. Install it if you need to communicate with Modbus devices; the only caveat is to review API_changes when upgrading between minor versions, as the project does not follow semantic versioning.
Install
pymodbus on PyPI
pip
pip install pymodbusuv
uv add pymodbuspoetry
poetry add pymodbusInstalling pymodbus
Before you install
Installation is straightforward with no runtime dependencies by default; pyserial is optional for serial communication. The project is actively maintained with a release just 1 day old, tested across Python 3.10–3.14 on Windows, Linux, and macOS, and carries 2754 GitHub stars.
License in practice
BSD-3-Clause is a permissive license allowing commercial and private use with minimal restrictions; you must include the license text and disclaimer but face no copyleft obligations.
Quickstart
pip install pymodbus
from pymodbus.client import ModbusSerialClient
client = ModbusSerialClient(method='rtu', port='/dev/ttyUSB0')
client.connect()
result = client.read_holding_registers(0, 10)
client.close()
Requires Python >= 3.10.0; serial communication requires optional pyserial dependency (install with pip install pymodbus[serial]).
Verify before relying
- Whether the 100% test coverage claim and cross-platform CI testing are current as of version 3.15.0.
- Performance characteristics under high-volume device simulation (hundreds of devices mentioned in description).
- Specific non-standard device limitations beyond the general statement in the description.
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.10.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 1 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,788,026/month — #3,561 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pymodbus-3.15.0-py3-none-any.whl
Keywords: modbus, asyncio, scada, client, server, simulator
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
minimalmodbusMinimalmodbus provides a Python interface to…
permissive · top 15,000 on PyPI
pyModbusTCPA pure-Python Modbus/TCP client and server…
permissive · top 15,000 on PyPI
async-modbusAsync ModBus provides an asynchronous Python…
unclear · top 15,000 on PyPI
uModbusuModbus is a pure Python implementation of the…
copyleft · top 15,000 on PyPI
nibeNibe provides async communication with Nibe…
copyleft · top 15,000 on PyPI
huawei-solarProvides a Python interface to read and write…
agpl · top 15,000 on PyPI
pystiebeleltronProvides a Python API to communicate with…
permissive · top 15,000 on PyPI
goodweConnects to GoodWe solar inverters over local…
permissive · top 15,000 on PyPI
powerbot-clientPowerBot client library for synchronous…
unclear · top 15,000 on PyPI
bacpypes3BACpypes3 is a Python library for building…
permissive · top 15,000 on PyPI