skillfed

python-snap7

Pure Python S7 communication library for Siemens PLCs

python-snap7 v3.1.2 255.2K downloads/30d#8,481 on PyPI830
Permissive license MIT Active released

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-snap7

uv

uv add python-snap7

poetry

poetry add python-snap7

Installing 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersIntended Audience :: ManufacturingOperating System :: POSIXProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: System :: Hardware

Tags

siemens plc communications7 protocol pythonplc data read writes7 ethernet clientindustrial automation interfacesiemens plc drivers7 networking
industrial-automationsiemens-plcasync-support

More Hardware packages