How pymodbus-dev/pymodbus works
Project type and purpose
• PyModbus is a protocol library and toolkit that implements the Modbus protocol in Python.
• It provides five main parts: a client, a server, a REPL, a web‐based simulator, and example scripts.
• It’s not a monolithic application but a layered, extensible library used by other applications (e.g., Home-Assistant).
File structure
• Top‐level directories:
• pymodbus/ – main Python package, subdivided into subpackages: client, server, framer, transport, transaction, pdu, datastore, simulator, utilities.
• examples/ – usage examples for client, server, simulator.
• test/ – test suite organized by module.
• doc/ – Sphinx documentation including an architecture guide.
• .github/, .devcontainer/ – CI and development config.
• Key configuration files: pyproject.toml, MANIFEST.in, check_ci.sh, .github/workflows/*.yml.
• Build artifacts: build/, dist/.
README for additional insights
• The README describes the five parts and outlines supported transports (TCP, UDP, TLS, serial), supported framing (ascii, RTU, socket), and datastores.
Elements
• Clear labels for each package/component (e.g., “pymodbus.client”, “pymodbus.framer.ascii”)
• Green for application APIs (client, server, repl, simulator)
• Orange for external systems (real devices, browsers)
Final advice
• Grouping (transport backends together, framing strategies together).