Skip to main content
https://img.shields.io/pypi/v/python-snap7.svg https://img.shields.io/pypi/pyversions/python-snap7.svg https://img.shields.io/github/license/gijzelaerr/python-snap7.svg https://github.com/gijzelaerr/python-snap7/actions/workflows/test.yml/badge.svg https://readthedocs.org/projects/python-snap7/badge/

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.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-snap7 3.4.0
File Size Uploaded Provenance Actions
python_snap7-3.4.0.tar.gz 312.0 kB With provenance Details for python_snap7-3.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for python-snap7 3.4.0
File Interpreter ABI Platform Actions
python_snap7-3.4.0-py3-none-any.whl Python 3 none any Details for python_snap7-3.4.0-py3-none-any.whl

Total release size: 473.8 kB

Release files / python_snap7-3.4.0.tar.gz

Download URL python_snap7-3.4.0.tar.gz
Size 312.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b886ba2aecad27ea9a9f43fe502fed91c37ce7998e6103541f8257cf1b2707aa
BLAKE2b-256 checksum
How to use checksums
d4ad205c0ee9e98f0260995cd2d682d517c12ec6bdd24541aad92392f3fb2ff8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 8, 2026.

Transparency log

Release files / python_snap7-3.4.0-py3-none-any.whl

Download URL python_snap7-3.4.0-py3-none-any.whl
Size 161.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
69536a0722815f5cb1a6f8c69308734bcc311f10fd4e6005566273b76db0ef0a
BLAKE2b-256 checksum
How to use checksums
cfa935f23a7d69e865d05247a894d06a984751126cb424cdcc606a19257e081a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 8, 2026.

Transparency log

Security for python-snap7 3.4.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for python_snap7-3.4.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 Nov 8, 2026.

Transparency log

A 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.

Release history Release notifications | RSS feed

This release

3.4.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page