s7commplus
Pure-Python S7CommPlus communication for Siemens S7-1200 and S7-1500 PLCs. It supports S7CommPlus V1, V2 (TLS), and V3; synchronous and asyncio clients; and a server emulator for testing. Both clients support legacy V1 SessionKey authentication, validated on a real S7-1200 (sync and async clients) and an S7-1500 (sync client); PLCSIM support is so far emulator-tested.
Installation
Install the latest stable release from PyPI:
python -m pip install --upgrade s7commplus
See the s7commplus documentation for the complete user guide and API reference.
from s7commplus import Client
with Client() as client:
client.connect("192.168.1.10", 0, 1)
data = client.db_read(1, 0, 4)
S7CommPlus is used by newer S7-1200/1500 PLCs when classic PUT/GET access is disabled. This is an unofficial implementation and is not affiliated with, endorsed by, or supported by Siemens AG. Test against an isolated controller before using it in production or safety-relevant environments.
Some older PLCs advertise only their SessionKey family instead of a complete
public-key fingerprint. Client and AsyncClient try the bounded set of
bundled keys from that family on fresh sessions and cache the confirmed key
for the PLC. Set allow_legacy_key_fallback=False on connect() when key
probing must be disabled.
The order number a PLC reports during connect can be turned into a readable module name and family:
from s7commplus import device_family, device_name
device_name("6ES7 512-1DK01-0AB0") # 'CPU 1512SP-1 PN'
device_family("6ES7 512-1DK01-0AB0") # 's7-1500-sp'
DEVICE_NAMES holds the full table (S7-1200/1500 controllers, SIPLUS
variants, software controllers and PLCSIM; classic S7-300/400 is out of
scope). python tools/check_devices_table.py validates its shape.
Development
Cloning the repository is only necessary for developing or testing
s7commplus. To use the stable library in an application, install it from PyPI
as shown above.
git clone https://github.com/gijzelaerr/s7commplus.git
cd s7commplus
python -m pip install -e '.[test,docs]'
pytest
mypy s7commplus
ruff check s7commplus tests
ruff format --check s7commplus tests
The published documentation is hosted on Read the Docs and validated in CI. To build it locally from a development checkout:
sphinx-build -W --keep-going -b html docs docs/_build/html
The V1 SessionKey implementation derives from HarpoS7; its MIT
license is included at s7commplus/v1_session_key/LICENSE-HarpoS7.
Metadata
Release files for s7commplus 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| s7commplus-0.2.0.tar.gz | 423.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| s7commplus-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 651.0 kB
Release files / s7commplus-0.2.0.tar.gz
| Download URL | s7commplus-0.2.0.tar.gz |
|---|---|
| Size | 423.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ace4771c43dc2ec37770a3569df78a7aa0f4990e189ef0ecec07d4bfb7eb334a
|
|
BLAKE2b-256 checksum How to use checksums |
c28433ee8ea967421c2fe7cf0ec2a55f84d4f5bb5724c48272de86eb85e0a064
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.
Transparency logRelease files / s7commplus-0.2.0-py3-none-any.whl
| Download URL | s7commplus-0.2.0-py3-none-any.whl |
|---|---|
| Size | 227.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9bc114e2f2a1d87ae1e546eb813d53623faa644e1a9b5ffc21a5b8729a064c12
|
|
BLAKE2b-256 checksum How to use checksums |
d7d84019b75924ea4d50097d5365681e20e2c97a95239c0e9a9168d0b4c8e6dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.
Transparency log