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