python-snap7
python-snap7 is a pure-Python library for communicating with Siemens S7 PLCs using the classic S7 protocol. It supports S7-300 and S7-400 controllers, as well as S7-1200 and S7-1500 controllers with PUT/GET access enabled. It supports Python 3.10+ on Windows, Linux, and macOS without native dependencies.
S7-1200 and S7-1500
On S7-1200 and S7-1500 controllers, python-snap7 only works when PUT/GET access is enabled in TIA Portal, and it cannot access optimized data blocks. PUT/GET is unauthenticated and disabled by default, so leaving it disabled is the more secure configuration.
If PUT/GET is disabled, or you need optimized data blocks or symbolic access, use s7commplus instead:
pip install s7commplus
s7commplus is a separate, younger project that implements S7CommPlus, the protocol these controllers speak natively. Check the firmware versions validated so far before relying on it, and see the PLC support matrix for what python-snap7 supports on each controller family.
Installation
Install from PyPI:
pip install python-snap7
Quick start
from s7 import Client
client = Client()
client.connect("192.168.1.10", 0, 1)
data = client.db_read(1, 0, 4)
client.disconnect()
The s7 package is the recommended import. The snap7 package name is also available for backwards compatibility.
Documentation
Read the full documentation at python-snap7.readthedocs.io.
The safe volunteer hardware-test procedure is in Real-PLC acceptance testing. The CPUs and firmware versions it has passed on are listed under Tested and Verified Hardware.
Metadata
Release files for python-snap7 3.3.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 | Provenance | |
|---|---|---|---|---|
| python_snap7-3.3.0.tar.gz | 305.3 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| python_snap7-3.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 465.5 kB
Release files / python_snap7-3.3.0.tar.gz
| Download URL | python_snap7-3.3.0.tar.gz |
|---|---|
| Size | 305.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cd4d6a3eb3f199c78a1725e54a437ef664da7988c10817e8b19b58ed99ef8b04
|
|
BLAKE2b-256 checksum How to use checksums |
325ffe69f6dbda505350894b747ec0b2c564597859c19849edfb433716eea3d6
|
| 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 20, 2026.
Transparency logRelease files / python_snap7-3.3.0-py3-none-any.whl
| Download URL | python_snap7-3.3.0-py3-none-any.whl |
|---|---|
| Size | 160.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
99aec46ef78d526ad3106b9359bd259ca5cd151034500b21a8732ba901e406f3
|
|
BLAKE2b-256 checksum How to use checksums |
c884a03d9e6634142c8e0a13d9e3e2e841732f25714d4766478271c4cb03d518
|
| 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 20, 2026.
Transparency logSecurity for python-snap7 3.3.0
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for python_snap7-3.3.0.tar.gz
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 20, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.