Skip to content

Releases: gijzelaerr/python-snap7

3.1.0

Choose a tag to compare

@gijzelaerr gijzelaerr released this 17 Jul 12:07

python-snap7 3.1.0

A feature-rich release adding async support, a CLI, symbolic addressing, network discovery, and many quality-of-life improvements to the pure-Python S7 library introduced in 3.0.

New features

  • AsyncClient — full asyncio-based client for non-blocking PLC communication (#593)
  • CLI toolssnap7 command-line interface for PLC interaction; install with pip install "python-snap7[cli]" (#631)
  • Typed DB access — convenience methods for reading/writing common S7 data types (BOOL, INT, REAL, etc.) directly (#632)
  • PROFINET DCP discovery — discover PLCs on the local network without knowing their IP addresses (#634)
  • Heartbeat & auto-reconnect — connection monitoring with configurable heartbeat interval and exponential-backoff reconnection (#635)
  • Symbolic addressing (Tags) — read/write PLC variables by name using a unified Tag API with PLC4X and nodeS7 dialect support (#638, #697, #701)
  • S7 routing — access PLCs behind gateways across multiple subnets (#639)
  • Multi-variable read optimizer — automatically batch multiple reads into minimal PDU exchanges (#641)
  • Structured logging — PLC connection context (host/rack/slot) attached to log records, with JSON formatter (#688)
  • Diagnostic buffer & data-change subscriptions — read the PLC diagnostic buffer and subscribe to variable changes (#690)
  • Block transfer & CPU state control — upload/download blocks, start/stop/hot-start/cold-start the PLC (#693)
  • Demo subcommandsnap7 demo starts a live server exposing real host metrics for quick testing (#704)

Bug fixes

  • Fix get_cpu_info and S7SZL.__str__ (#692)
  • Fix server SZL 0x001C response to match real PLC format (#694)
  • Fix AttributeError from __del__ during interpreter shutdown (#707)
  • Use connection_type in TSAP composition during connect (#766)
  • Accept memoryview in setter/getter type annotations (#647)
  • Zero-pad milliseconds in get_time so 3 ms reads as ".003" (#716)
  • Use proper PI service PDU format for PLC control commands (#733, #743)
  • Set TCP_NODELAY and SO_KEEPALIVE on all S7 sockets (#677)
  • Backport robustness improvements from python-s7comm (#580)
  • Add get_ulint and get_lint to snap7.util exports (#652)
  • Fix async get_cpu_info and extract shared SZL/block parsers (#702)
  • Fix demo primary-IP guess with VPN/tunnel interfaces (#708)

Other improvements

  • Property-based testing with Hypothesis (#636)
  • Improved documentation with intersphinx cross-references and restructured API docs
  • Full type annotations with mypy strict mode (no type: ignore needed)
  • Python 3.10–3.14 support

Upgrading from 3.0

This is a backwards-compatible release. All existing 3.0 code should work without changes. New features are additive.

If you experience any issues, please report them on the issue tracker.

3.0.0 — Pure Python Rewrite

Choose a tag to compare

@gijzelaerr gijzelaerr released this 18 Mar 08:54

python-snap7 3.0.0 — Pure Python Rewrite

This is a major release that completely rewrites python-snap7 as a pure Python S7 communication library. The C snap7 shared library is no longer used — the entire protocol stack (TPKT, COTP, and S7) is now implemented in pure Python.

The name "python-snap7" is historical — the library originally started as a Python wrapper around the Snap7 C library. As of this release, the C library is no longer needed, but the name is kept for backwards compatibility.

What's new

  • Pure Python implementation — no native dependencies, no shared libraries
  • Works everywhere — any platform that runs Python 3.10+, including ARM, Alpine Linux, and other environments where the C library was difficult or impossible to install
  • Easier to extend — new features and protocol support can be added directly in Python
  • Complete TPKT (RFC 1006) and COTP (ISO 8073) transport layer implementation
  • Native S7 protocol PDU encoding/decoding
  • Pure Python server implementation for testing and simulation
  • Full type annotations with mypy strict mode
  • CLI interface for running an S7 server emulator (pip install "python-snap7[cli]")

Breaking changes

This release completely breaks with the previous approach of wrapping the C snap7 shared library. While the public API is largely the same, this is a fundamental change under the hood. If you experience issues:

  1. Please report them on the issue tracker with a clear description and the version you are using (python -c "import snap7; print(snap7.__version__)")
  2. As a workaround, pin to the last pre-3.0 release: pip install "python-snap7<3"

Thanks

Special thanks to the following people for testing, reporting issues, and providing feedback during the 3.0 development:

2.1.1

Choose a tag to compare

@gijzelaerr gijzelaerr released this 18 Mar 08:42

Fix Read the Docs build configuration for pre-3.0 documentation.

  • Fix .readthedocs.yaml to install from pyproject.toml extras instead of missing requirements-dev.txt
  • Add mock imports in doc/conf.py so autodoc works without the native snap7 C library on RTD
  • Use sphinx_rtd_theme for consistent styling

v2.1.0

Choose a tag to compare

@gijzelaerr gijzelaerr released this 24 Feb 07:49
0810f36

What's Changed

Bug Fixes

  • Fix PLC setter functions for memoryview compatibility (#575)
  • Cache error_text() instead of check_error() (#552)

Improvements

  • Add ASCII validation in set_string() with isascii() (#561)
  • Update read_multi.py example (#563)
  • Code quality improvements and comprehensive documentation (#568)
  • Fix typo: ussage -> usage (#564)

CI/CD & Infrastructure

  • Modernize CI/CD: switch to uv, fix Python 3.11+ compatibility (#576)
  • Drop Ubuntu 20.04 from CI matrix (#562)

Supported Python versions

  • Python 3.10, 3.11, 3.12, 3.13, 3.14

Full Changelog: 2.0.2...2.1.0

2.0.2

Choose a tag to compare

@gijzelaerr gijzelaerr released this 03 Nov 09:47
0dcce7b

What's Changed

Full Changelog: 2.0.1...2.0.2

2.0.1

Choose a tag to compare

@gijzelaerr gijzelaerr released this 02 Nov 14:26
e3aff06

What's Changed

New Contributors

Full Changelog: 2.0.0...2.0.1

2.0.0

Choose a tag to compare

@gijzelaerr gijzelaerr released this 07 Jul 11:07

major release with backwards compatibility changes

This release is a restructure of the codebase, cleaning up old inconsistencies and spelling mistakes. Although attempts were made to keep the API backwards compatible, a method argument might have changed here and there. This release is also 100% typed, helping us find and fix tiny bugs and mistakes.

This makes the python-snap7 'done', all functionality is implemented and no changes in the API are expected anymore.

Most important changes

Full Changelog: 1.4.1...2.0.0

1.4.1

Choose a tag to compare

@gijzelaerr gijzelaerr released this 10 May 13:20
8612423

What's Changed

Full Changelog: 1.4...1.4.1

1.4

1.4

Choose a tag to compare

@gijzelaerr gijzelaerr released this 03 May 10:25
8897dd4

What's Changed

New Contributors

Full Changelog: 1.3...1.4

1.3

1.3

Choose a tag to compare

@gijzelaerr gijzelaerr released this 17 Jan 07:09
d26cfbe

What's Changed

New Contributors

Full Changelog: 1.2...1.3