python-snap7
Pure Python S7 communication library for Siemens PLCs
What it is and what it does
Python-snap7 is a pure Python implementation of the S7 protocol stack for communicating with Siemens S7 PLCs over Ethernet. As of version 3.0, it no longer wraps a C library; instead, the entire protocol stack (TPKT, COTP, and S7) is implemented in pure Python. This eliminates platform-specific shared libraries and makes installation straightforward across Windows, Linux, macOS, and ARM systems. The library provides both synchronous and asynchronous APIs for reading and writing PLC memory, with recent additions including tag-based read/write by symbolic name, multi-variable read optimization, S7 routing for remote PLCs, heartbeat monitoring with auto-reconnect, and PROFINET DCP network discovery.
The package targets industrial automation developers who need to interface Python applications with Siemens PLCs. It requires Python 3.10+ but has no external runtime dependencies, making it portable across diverse deployment environments. Version 3.1 adds AsyncClient for asyncio support, structured logging, and CLI tools.
Use it for:
- Read sensor data and device status from Siemens PLCs in real-time monitoring or data collection applications
- Write control commands to PLCs from Python automation scripts or supervisory systems
- Build async Python services that communicate with multiple PLCs concurrently without blocking
- Discover and interact with PLCs on a network using PROFINET DCP and S7 routing
- Integrate PLC communication into Python-based SCADA or industrial IoT platforms
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Pure Python library for reading and writing data to Siemens S7 PLCs over Ethernet, with support for synchronous and asynchronous operations.
Yes. The library is actively maintained, production-stable (Development Status 5), has zero known vulnerabilities, and eliminates installation friction by being pure Python with no native dependencies. It is well-suited for industrial automation projects targeting Python 3.10+. The recent 3.1 release adds AsyncClient support and modern features. Install it if you need to communicate with Siemens S7 PLCs from Python.
Install
python-snap7 on PyPI
pip
pip install python-snap7uv
uv add python-snap7poetry
poetry add python-snap7Installing python-snap7
Before you install
Low friction: pure Python package with no native dependencies, works on Python 3.10+. Repository is active with recent release 4 days old and 830 stars.
License in practice
MIT license permits commercial and private use with minimal restrictions; suitable for most industrial and commercial deployments.
Quickstart
pip install python-snap7
import snap7
client = snap7.Client()
client.connect("192.168.1.10", 0, 1)
data = client.db_read(1, 0, 4)
client.disconnect()
Verify before relying
- Performance characteristics when handling high-frequency reads on large datasets
- Compatibility with specific Siemens S7 PLC models and firmware versions
- Production-readiness of heartbeat monitoring and auto-reconnect features
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 4 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 255,247/month — #8,481 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: python_snap7-3.1.2-py3-none-any.whl
Keywords: snap7, s7, siemens, plc
Tags
More Hardware packages
psutil retrieves real-time information about…
permissive · top 1,000 on PyPI
nvidia-ml-pyPython wrapper around NVIDIA's Management…
permissive · top 5,000 on PyPI
circular-dictCircularDict is a Python dictionary that…
permissive · top 5,000 on PyPI
pyudevpyudev is a pure Python binding for libudev…
copyleft · top 5,000 on PyPI
btsocketA Python library for controlling BlueZ…
permissive · top 15,000 on PyPI
spsdkSPSDK is a Python library and CLI toolkit for…
permissive · top 15,000 on PyPI
pylogixPylogix reads and writes tag values from…
permissive · top 15,000 on PyPI
pyadspyads is a Python wrapper for TwinCAT's ADS…
permissive · top 15,000 on PyPI
devolo-plc-apiProvides a Python API to communicate with…
copyleft · top 15,000 on PyPI
zigpy-zigateProvides a Python 3 driver for ZiGate Zigbee…
copyleft · top 15,000 on PyPI
pyModbusTCPA pure-Python Modbus/TCP client and server…
permissive · top 15,000 on PyPI
elkm1-libAsynchronous Python library for communicating…
permissive · top 15,000 on PyPI
smbus2smbus2 provides pure Python I2C/SMBus…
permissive · top 5,000 on PyPI
pyisyPyISY is a Python library for asynchronous…
permissive · top 15,000 on PyPI
home-connect-asyncAn async Python SDK that connects to the BSH…
permissive · top 15,000 on PyPI
PyVISA-pyPyVISA-py is a pure Python backend for the VISA…
permissive · top 5,000 on PyPI