Releases: gijzelaerr/python-snap7
Release list
3.1.0
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 tools —
snap7command-line interface for PLC interaction; install withpip 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 subcommand —
snap7 demostarts a live server exposing real host metrics for quick testing (#704)
Bug fixes
- Fix
get_cpu_infoandS7SZL.__str__(#692) - Fix server SZL 0x001C response to match real PLC format (#694)
- Fix
AttributeErrorfrom__del__during interpreter shutdown (#707) - Use
connection_typein TSAP composition during connect (#766) - Accept
memoryviewin setter/getter type annotations (#647) - Zero-pad milliseconds in
get_timeso 3 ms reads as ".003" (#716) - Use proper PI service PDU format for PLC control commands (#733, #743)
- Set
TCP_NODELAYandSO_KEEPALIVEon all S7 sockets (#677) - Backport robustness improvements from python-s7comm (#580)
- Add
get_ulintandget_lintto snap7.util exports (#652) - Fix async
get_cpu_infoand 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: ignoreneeded) - 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
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:
- Please report them on the issue tracker with a clear description and the version you are using (
python -c "import snap7; print(snap7.__version__)") - 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:
- @lupaulus — extensive testing and bug reports
- @spreeker — testing and feedback
- @nikteliy — review and feedback on the rewrite
- @amorelettronico — testing
- @razour08 — testing
- @core-engineering — bug reports
- @AndreasScharf — bug reports
- @Robatronic — bug reports
- @hirotasoshu — feedback
- @PoitrasJ — bug reports
2.1.1
Fix Read the Docs build configuration for pre-3.0 documentation.
- Fix
.readthedocs.yamlto install from pyproject.toml extras instead of missingrequirements-dev.txt - Add mock imports in
doc/conf.pyso autodoc works without the native snap7 C library on RTD - Use
sphinx_rtd_themefor consistent styling
v2.1.0
What's Changed
Bug Fixes
- Fix PLC setter functions for memoryview compatibility (#575)
- Cache
error_text()instead ofcheck_error()(#552)
Improvements
- Add ASCII validation in
set_string()withisascii()(#561) - Update
read_multi.pyexample (#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
What's Changed
- we dont need
enum_tools.autoenumby @gijzelaerr in #548
Full Changelog: 2.0.1...2.0.2
2.0.1
What's Changed
- better parsing to avoid bugs when variables name contain whitespaces by @Novecento99 in #529
- update docstring to match new API #537 by @gijzelaerr in #538
- fix indentation of docs by @gijzelaerr in #544
- make test timezone aware by @gijzelaerr in #543
New Contributors
- @Novecento99 made their first contribution in #529
Full Changelog: 2.0.0...2.0.1
2.0.0
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
- Improve typing by @nikteliy in #516
- Improve use of enum types by @gijzelaerr in #515
Full Changelog: 1.4.1...2.0.0
1.4.1
What's Changed
- update container workflow by @gijzelaerr in #509
- avoid creating compressed tags set by @nikteliy in #510
- Make client and server a contextmanager by @gijzelaerr #512
- Drop Python 3.8 from metadata and doc by @gijzelaerr #513
- Drop Snap7Library singleton and use python functools caching by @gijzelaerr #514
- Doc: Typo and samples for CPU State and CP State @lupaulus #508
Full Changelog: 1.4...1.4.1
1.4
What's Changed
- Fix #431 by @nikteliy in #432
- Add arm32v7 wheel (Issue #376) by @nikteliy in #442
- Update github actions by @nikteliy in #443
- Fix utils by @nikteliy in #444
- Add reusable action by @nikteliy in #446
- append arm in installation doc by @Tathar in #450
- Fix example by @FiloCara in #452
- Fix #451 by @nikteliy in #453
- Add pre-commit by @nikteliy in #460
- add missing lreal to util.py by @spreeker in #487
- Prepare for 1.4 by @gijzelaerr in #477
- Issue 474 fix by @nikteliy in #501
- try to fix more builds by @gijzelaerr in #502
- Also include submodules by @gijzelaerr in #503
- fix build by @nikteliy in #504
- use venv everywhere by @gijzelaerr in #505
- fix bad cli_as_callback implementation by @gijzelaerr in #506
- add python 3.12 wheels, drop 3.8 and older by @gijzelaerr in #474
New Contributors
- @kaisersource made their first contribution in #425
- @Tathar made their first contribution in #450
- @FiloCara made their first contribution in #452
Full Changelog: 1.3...1.4
1.3
What's Changed
- drop python 3.6 versions in checks by @swamper123 in #369
- fix set_string by @swamper123 in #368
- use https for links by @imba-tjd in #370
- use more pythonic syntax by @imba-tjd in #373
- fixed DB class not allowing to write BYTE values to rows by @vmsh0 in #377
- Deprecate old osx by @gijzelaerr in #383
- Add support to read/write space-padded fixed-length strings by @vmsh0 in #378
- DB usability improvements by @vmsh0 in #385
- Make all internal imports relative by @vmsh0 in #386
- fixed typo in portnumber by @Cube707 in #408
- fix linux build by @gijzelaerr in #410
- implement
__main__.pyenty points by @Cube707 in #409
New Contributors
- @imba-tjd made their first contribution in #370
- @vmsh0 made their first contribution in #377
- @Cube707 made their first contribution in #408
Full Changelog: 1.2...1.3