skillfed

minimalmodbus

Easy-to-use Modbus RTU and Modbus ASCII implementation for Python

minimalmodbus v2.1.1 146.8K downloads/30d#11,088 on PyPI344
Permissive license DORMANT released

What it is and what it does

Minimalmodbus is a Python library that acts as a Modbus master, communicating with Modbus slave devices (sensors, controllers, PLCs) over serial connections using the Modbus RTU or Modbus ASCII protocols. It abstracts the low-level protocol details so you can read and write device registers with simple function calls, and includes helpers for working with multi-byte values like floats and strings without manual byte manipulation.

The package depends only on pyserial, a pure-Python serial port library, making it lightweight and portable across Linux, macOS, and Windows. It is marked Production/Stable and supports Python 3.8 and later. Maintenance is dormant (last release July 2023), but the codebase is mature and has been stable since its initial release in 2011, making it suitable for applications where active feature development is not required.

Use it for:

  • Read sensor values from industrial instruments over serial links using Modbus RTU or ASCII protocols.
  • Write configuration or control commands to Modbus-enabled devices like motor drives, power supplies, or data loggers.
  • Poll multiple Modbus slave devices sequentially from a single master application on a PC or embedded Linux system.
  • Prototype or integrate legacy industrial equipment that speaks Modbus into a Python automation or monitoring script.
  • Handle multi-byte sensor readings (floats, long integers) without manually managing byte order or register packing.

Worth the install?

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

Minimalmodbus provides a Python interface to communicate with Modbus RTU and Modbus ASCII devices over serial connections, handling protocol details and offering convenience functions for floats, strings, and multi-byte integers.

Yes, for stable Modbus RTU and Modbus ASCII serial communication. The package is mature, production-grade, and has minimal dependencies. Dormant maintenance is not a concern if you are integrating with established industrial hardware that does not require protocol updates. Install only if your use case is serial Modbus; verify this package does not support Modbus TCP before committing if that is required.

Install

minimalmodbus on PyPI

pip

pip install minimalmodbus

uv

uv add minimalmodbus

poetry

poetry add minimalmodbus

Installing minimalmodbus

Before you install

Low install friction with a single pure-Python dependency (pyserial). Maintenance is dormant—last release was 2023-07-17, over a year ago—but the package is marked Production/Stable and has been actively maintained since 2011. Suitable for stable, established use cases where active development is not expected.

License in practice

Licensed under Apache License 2.0 (permissive). You may use, modify, and distribute the package freely in commercial and private projects, provided you include a copy of the license and do not hold the authors liable.

Quickstart

pip install minimalmodbus

import minimalmodbus
instrument = minimalmodbus.Instrument('/dev/ttyUSB0', 1)  # port, slave address
temperature = instrument.read_register(0, 1)  # register, decimals

Requires a physical or virtual serial port connected to a Modbus RTU or Modbus ASCII device.

Verify before relying

  • Exact scope of 'convenience functions' for floats, strings, and long integers beyond basic register reads.
  • Whether the package supports Modbus TCP or only serial (RTU/ASCII) variants.
  • Performance characteristics or limits (e.g., max devices per master, request latency).
  • Specific serial hardware requirements (e.g., voltage levels, connector types).

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 1 — pyserial
Maintenance dormant — 1,124 days since the last release
Last repo commit
First released
Downloads 146,831/month — #11,088 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: minimalmodbus-2.1.1-py3-none-any.whl

Keywords: minimalmodbus, modbus, modbus-serial, modbus-RTU, modbus-ASCII

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: ManufacturingIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseNatural Language :: EnglishOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: OS IndependentOperating System :: POSIXProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: CommunicationsTopic :: Home AutomationTopic :: Scientific/EngineeringTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTopic :: System :: Hardware :: Hardware DriversTopic :: Terminals :: Serial

Tags

modbus RTU serial communicationmodbus ASCII pythonindustrial device protocolserial modbus mastermodbus slave communicationindustrial automation protocolmodbus over serial port
industrial-automationserial-protocolhardware-driver

More Libraries packages