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.7.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.7.0
File Size Uploaded Provenance Actions
python_snap7-3.7.0.tar.gz 333.9 kB With provenance Details for python_snap7-3.7.0.tar.gz

Built distribution (wheel)

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

Total release size: 504.4 kB

Release files / python_snap7-3.7.0.tar.gz

Download URL python_snap7-3.7.0.tar.gz
Size 333.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b3abbd3ff0833a4a0fcb899c9be4f25ff7c6ff96e888fb8ab6332c08f0948b22
BLAKE2b-256 checksum
How to use checksums
21bc1f8972b2ea23708da9f096238ff3188ea14cdc177018c08cd30d37a41dfb
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 30, 2026.

Transparency log

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

Download URL python_snap7-3.7.0-py3-none-any.whl
Size 170.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23a61d6c9297d3549593c5ab7b1dfa687207482981a99da04b8f2d17c919f3c9
BLAKE2b-256 checksum
How to use checksums
0f03291ba7da7897369e2ab1dca101da91dd6c103c4ce638977baf423c8e4522
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 30, 2026.

Transparency log

Security for python-snap7 3.7.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.7.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 30, 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.7.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