python-snap7 2.0.2__tar.gz → 3.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. python_snap7-3.0.0/PKG-INFO +94 -0
  2. python_snap7-3.0.0/README.rst +52 -0
  3. {python_snap7-2.0.2 → python_snap7-3.0.0}/pyproject.toml +11 -11
  4. python_snap7-3.0.0/python_snap7.egg-info/PKG-INFO +94 -0
  5. {python_snap7-2.0.2 → python_snap7-3.0.0}/python_snap7.egg-info/SOURCES.txt +8 -4
  6. python_snap7-3.0.0/python_snap7.egg-info/entry_points.txt +2 -0
  7. {python_snap7-2.0.2 → python_snap7-3.0.0}/python_snap7.egg-info/requires.txt +3 -0
  8. {python_snap7-2.0.2 → python_snap7-3.0.0}/snap7/__init__.py +17 -2
  9. python_snap7-3.0.0/snap7/client.py +1923 -0
  10. python_snap7-3.0.0/snap7/connection.py +456 -0
  11. python_snap7-3.0.0/snap7/datatypes.py +312 -0
  12. python_snap7-3.0.0/snap7/error.py +444 -0
  13. python_snap7-3.0.0/snap7/logo.py +222 -0
  14. python_snap7-3.0.0/snap7/partner.py +680 -0
  15. python_snap7-3.0.0/snap7/s7protocol.py +1509 -0
  16. python_snap7-3.0.0/snap7/server/__init__.py +2681 -0
  17. {python_snap7-2.0.2 → python_snap7-3.0.0}/snap7/server/__main__.py +3 -16
  18. {python_snap7-2.0.2 → python_snap7-3.0.0}/snap7/type.py +3 -2
  19. {python_snap7-2.0.2 → python_snap7-3.0.0}/snap7/util/__init__.py +22 -0
  20. {python_snap7-2.0.2 → python_snap7-3.0.0}/snap7/util/db.py +33 -4
  21. {python_snap7-2.0.2 → python_snap7-3.0.0}/snap7/util/getters.py +71 -19
  22. {python_snap7-2.0.2 → python_snap7-3.0.0}/snap7/util/setters.py +268 -75
  23. python_snap7-3.0.0/tests/test_api_surface.py +444 -0
  24. python_snap7-3.0.0/tests/test_behavioral_compatibility.py +401 -0
  25. {python_snap7-2.0.2 → python_snap7-3.0.0}/tests/test_client.py +339 -120
  26. python_snap7-3.0.0/tests/test_client_e2e.py +790 -0
  27. python_snap7-3.0.0/tests/test_datatypes.py +252 -0
  28. {python_snap7-2.0.2 → python_snap7-3.0.0}/tests/test_logo_client.py +12 -15
  29. {python_snap7-2.0.2 → python_snap7-3.0.0}/tests/test_mainloop.py +73 -11
  30. python_snap7-3.0.0/tests/test_multipacket.py +443 -0
  31. {python_snap7-2.0.2 → python_snap7-3.0.0}/tests/test_partner.py +3 -30
  32. {python_snap7-2.0.2 → python_snap7-3.0.0}/tests/test_server.py +97 -33
  33. {python_snap7-2.0.2 → python_snap7-3.0.0}/tests/test_util.py +183 -1
  34. python_snap7-2.0.2/PKG-INFO +0 -59
  35. python_snap7-2.0.2/README.rst +0 -20
  36. python_snap7-2.0.2/python_snap7.egg-info/PKG-INFO +0 -59
  37. python_snap7-2.0.2/python_snap7.egg-info/entry_points.txt +0 -2
  38. python_snap7-2.0.2/snap7/client.py +0 -1519
  39. python_snap7-2.0.2/snap7/common.py +0 -87
  40. python_snap7-2.0.2/snap7/error.py +0 -170
  41. python_snap7-2.0.2/snap7/logo.py +0 -151
  42. python_snap7-2.0.2/snap7/partner.py +0 -219
  43. python_snap7-2.0.2/snap7/protocol.py +0 -140
  44. python_snap7-2.0.2/snap7/protocol.pyi +0 -160
  45. python_snap7-2.0.2/snap7/server/__init__.py +0 -546
  46. python_snap7-2.0.2/tests/test_common.py +0 -42
  47. {python_snap7-2.0.2 → python_snap7-3.0.0}/LICENSE +0 -0
  48. {python_snap7-2.0.2 → python_snap7-3.0.0}/MANIFEST.in +0 -0
  49. {python_snap7-2.0.2 → python_snap7-3.0.0}/python_snap7.egg-info/dependency_links.txt +0 -0
  50. {python_snap7-2.0.2 → python_snap7-3.0.0}/python_snap7.egg-info/top_level.txt +0 -0
  51. {python_snap7-2.0.2 → python_snap7-3.0.0}/setup.cfg +0 -0
  52. {python_snap7-2.0.2 → python_snap7-3.0.0}/snap7/py.typed +0 -0
@@ -0,0 +1,94 @@
1
+ Metadata-Version: 2.4
2
+ Name: python-snap7
3
+ Version: 3.0.0
4
+ Summary: Pure Python S7 communication library for Siemens PLCs
5
+ Author-email: Gijs Molenaar <gijsmolenaar@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/gijzelaerr/python-snap7
8
+ Project-URL: Documentation, https://python-snap7.readthedocs.io/en/latest/
9
+ Keywords: snap7,s7,siemens,plc
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Environment :: Console
12
+ Classifier: Topic :: System :: Hardware
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: Manufacturing
15
+ Classifier: Operating System :: POSIX
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Programming Language :: Python :: 3.14
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/x-rst
23
+ License-File: LICENSE
24
+ Provides-Extra: test
25
+ Requires-Dist: pytest; extra == "test"
26
+ Requires-Dist: pytest-cov; extra == "test"
27
+ Requires-Dist: pytest-html; extra == "test"
28
+ Requires-Dist: mypy; extra == "test"
29
+ Requires-Dist: types-setuptools; extra == "test"
30
+ Requires-Dist: ruff; extra == "test"
31
+ Requires-Dist: tox; extra == "test"
32
+ Requires-Dist: tox-uv; extra == "test"
33
+ Requires-Dist: types-click; extra == "test"
34
+ Requires-Dist: uv; extra == "test"
35
+ Provides-Extra: cli
36
+ Requires-Dist: rich; extra == "cli"
37
+ Requires-Dist: click; extra == "cli"
38
+ Provides-Extra: doc
39
+ Requires-Dist: sphinx; extra == "doc"
40
+ Requires-Dist: sphinx_rtd_theme; extra == "doc"
41
+ Dynamic: license-file
42
+
43
+ About
44
+ =====
45
+
46
+ Python-snap7 is a pure Python S7 communication library for interfacing with Siemens S7 PLCs.
47
+
48
+ The name "python-snap7" is historical — the library originally started as a Python wrapper
49
+ around the `Snap7 <http://snap7.sourceforge.net/>`_ C library. As of version 3.0, the C
50
+ library is no longer used, but the name is kept for backwards compatibility.
51
+
52
+ Python-snap7 is tested with Python 3.10+, on Windows, Linux and OS X.
53
+
54
+ The full documentation is available on `Read The Docs <https://python-snap7.readthedocs.io/en/latest/>`_.
55
+
56
+
57
+ Version 3.0 - Pure Python Rewrite
58
+ ==================================
59
+
60
+ Version 3.0 is a ground-up rewrite of python-snap7. The library no longer wraps the
61
+ C snap7 shared library — instead, the entire S7 protocol stack (TPKT, COTP, and S7)
62
+ is now implemented in pure Python. This is a **breaking change** from all previous
63
+ versions.
64
+
65
+ **Why this matters:**
66
+
67
+ * **Portability**: No more platform-specific shared libraries (`.dll`, `.so`, `.dylib`).
68
+ python-snap7 now works on any platform that runs Python — including ARM, Alpine Linux,
69
+ and other environments where the C library was difficult or impossible to install.
70
+ * **Easier installation**: Just ``pip install python-snap7``. No native dependencies,
71
+ no compiler toolchains, no manual library setup.
72
+ * **Easier to extend**: New features and protocol support can be added directly in Python.
73
+
74
+ **If you experience issues with 3.0:**
75
+
76
+ 1. Please report them on the `issue tracker <https://github.com/gijzelaerr/python-snap7/issues>`_
77
+ with a clear description of the problem and the version you are using
78
+ (``python -c "import snap7; print(snap7.__version__)"``).
79
+ 2. As a workaround, you can pin to the last pre-3.0 release::
80
+
81
+ $ pip install "python-snap7<3"
82
+
83
+ The latest stable pre-3.0 release is version 2.1.0. Documentation for pre-3.0
84
+ versions is available at `Read The Docs <https://python-snap7.readthedocs.io/en/v2/>`_.
85
+
86
+
87
+ Installation
88
+ ============
89
+
90
+ Install using pip::
91
+
92
+ $ pip install python-snap7
93
+
94
+ No native libraries or platform-specific dependencies are required — python-snap7 is a pure Python package that works on all platforms.
@@ -0,0 +1,52 @@
1
+ About
2
+ =====
3
+
4
+ Python-snap7 is a pure Python S7 communication library for interfacing with Siemens S7 PLCs.
5
+
6
+ The name "python-snap7" is historical — the library originally started as a Python wrapper
7
+ around the `Snap7 <http://snap7.sourceforge.net/>`_ C library. As of version 3.0, the C
8
+ library is no longer used, but the name is kept for backwards compatibility.
9
+
10
+ Python-snap7 is tested with Python 3.10+, on Windows, Linux and OS X.
11
+
12
+ The full documentation is available on `Read The Docs <https://python-snap7.readthedocs.io/en/latest/>`_.
13
+
14
+
15
+ Version 3.0 - Pure Python Rewrite
16
+ ==================================
17
+
18
+ Version 3.0 is a ground-up rewrite of python-snap7. The library no longer wraps the
19
+ C snap7 shared library — instead, the entire S7 protocol stack (TPKT, COTP, and S7)
20
+ is now implemented in pure Python. This is a **breaking change** from all previous
21
+ versions.
22
+
23
+ **Why this matters:**
24
+
25
+ * **Portability**: No more platform-specific shared libraries (`.dll`, `.so`, `.dylib`).
26
+ python-snap7 now works on any platform that runs Python — including ARM, Alpine Linux,
27
+ and other environments where the C library was difficult or impossible to install.
28
+ * **Easier installation**: Just ``pip install python-snap7``. No native dependencies,
29
+ no compiler toolchains, no manual library setup.
30
+ * **Easier to extend**: New features and protocol support can be added directly in Python.
31
+
32
+ **If you experience issues with 3.0:**
33
+
34
+ 1. Please report them on the `issue tracker <https://github.com/gijzelaerr/python-snap7/issues>`_
35
+ with a clear description of the problem and the version you are using
36
+ (``python -c "import snap7; print(snap7.__version__)"``).
37
+ 2. As a workaround, you can pin to the last pre-3.0 release::
38
+
39
+ $ pip install "python-snap7<3"
40
+
41
+ The latest stable pre-3.0 release is version 2.1.0. Documentation for pre-3.0
42
+ versions is available at `Read The Docs <https://python-snap7.readthedocs.io/en/v2/>`_.
43
+
44
+
45
+ Installation
46
+ ============
47
+
48
+ Install using pip::
49
+
50
+ $ pip install python-snap7
51
+
52
+ No native libraries or platform-specific dependencies are required — python-snap7 is a pure Python package that works on all platforms.
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "python-snap7"
7
- version = "2.0.2"
8
- description = "Python wrapper for the snap7 library"
7
+ version = "3.0.0"
8
+ description = "Pure Python S7 communication library for Siemens PLCs"
9
9
  readme = "README.rst"
10
10
  authors = [
11
11
  {name = "Gijs Molenaar", email = "gijsmolenaar@gmail.com"},
@@ -16,16 +16,15 @@ classifiers = [
16
16
  "Topic :: System :: Hardware",
17
17
  "Intended Audience :: Developers",
18
18
  "Intended Audience :: Manufacturing",
19
- "License :: OSI Approved :: MIT License",
20
19
  "Operating System :: POSIX",
21
- "Programming Language :: Python :: 3.9",
22
20
  "Programming Language :: Python :: 3.10",
23
21
  "Programming Language :: Python :: 3.11",
24
22
  "Programming Language :: Python :: 3.12",
25
23
  "Programming Language :: Python :: 3.13",
24
+ "Programming Language :: Python :: 3.14",
26
25
  ]
27
- license = {text = "MIT License"}
28
- requires-python = ">=3.9"
26
+ license = {text = "MIT"}
27
+ requires-python = ">=3.10"
29
28
  keywords = ["snap7", "s7", "siemens", "plc"]
30
29
 
31
30
  [project.urls]
@@ -33,24 +32,25 @@ Homepage = "https://github.com/gijzelaerr/python-snap7"
33
32
  Documentation = "https://python-snap7.readthedocs.io/en/latest/"
34
33
 
35
34
  [project.optional-dependencies]
36
- test = ["pytest", "mypy", "types-setuptools", "ruff", "tox", "types-click", "uv"]
35
+ test = ["pytest", "pytest-cov", "pytest-html", "mypy", "types-setuptools", "ruff", "tox", "tox-uv", "types-click", "uv"]
37
36
  cli = ["rich", "click" ]
38
37
  doc = ["sphinx", "sphinx_rtd_theme"]
39
38
 
40
39
  [tool.setuptools.package-data]
41
- snap7 = ["py.typed", "lib/libsnap7.so", "lib/snap7.dll", "lib/libsnap7.dylib"]
40
+ snap7 = ["py.typed"]
42
41
 
43
42
  [tool.setuptools.packages.find]
44
43
  include = ["snap7*"]
45
44
 
46
45
  [project.scripts]
47
- snap7-server = "snap7.server.__main__:main"
46
+ snap7-server = "snap7.server:mainloop"
48
47
 
49
48
  [tool.pytest.ini_options]
50
49
  testpaths = ["tests"]
51
50
  markers =[
52
51
  "client",
53
52
  "common",
53
+ "e2e: end-to-end tests requiring a real PLC connection",
54
54
  "logo",
55
55
  "mainloop",
56
56
  "partner",
@@ -67,8 +67,8 @@ disable_error_code = ["method-assign", "attr-defined"]
67
67
  [tool.ruff]
68
68
  output-format = "full"
69
69
  line-length = 130
70
- target-version = "py39"
70
+ target-version = "py310"
71
71
 
72
- [lint]
72
+ [tool.ruff.lint]
73
73
  ignore = []
74
74
  mccabe.max-complexity = 10
@@ -0,0 +1,94 @@
1
+ Metadata-Version: 2.4
2
+ Name: python-snap7
3
+ Version: 3.0.0
4
+ Summary: Pure Python S7 communication library for Siemens PLCs
5
+ Author-email: Gijs Molenaar <gijsmolenaar@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/gijzelaerr/python-snap7
8
+ Project-URL: Documentation, https://python-snap7.readthedocs.io/en/latest/
9
+ Keywords: snap7,s7,siemens,plc
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Environment :: Console
12
+ Classifier: Topic :: System :: Hardware
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: Manufacturing
15
+ Classifier: Operating System :: POSIX
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Programming Language :: Python :: 3.14
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/x-rst
23
+ License-File: LICENSE
24
+ Provides-Extra: test
25
+ Requires-Dist: pytest; extra == "test"
26
+ Requires-Dist: pytest-cov; extra == "test"
27
+ Requires-Dist: pytest-html; extra == "test"
28
+ Requires-Dist: mypy; extra == "test"
29
+ Requires-Dist: types-setuptools; extra == "test"
30
+ Requires-Dist: ruff; extra == "test"
31
+ Requires-Dist: tox; extra == "test"
32
+ Requires-Dist: tox-uv; extra == "test"
33
+ Requires-Dist: types-click; extra == "test"
34
+ Requires-Dist: uv; extra == "test"
35
+ Provides-Extra: cli
36
+ Requires-Dist: rich; extra == "cli"
37
+ Requires-Dist: click; extra == "cli"
38
+ Provides-Extra: doc
39
+ Requires-Dist: sphinx; extra == "doc"
40
+ Requires-Dist: sphinx_rtd_theme; extra == "doc"
41
+ Dynamic: license-file
42
+
43
+ About
44
+ =====
45
+
46
+ Python-snap7 is a pure Python S7 communication library for interfacing with Siemens S7 PLCs.
47
+
48
+ The name "python-snap7" is historical — the library originally started as a Python wrapper
49
+ around the `Snap7 <http://snap7.sourceforge.net/>`_ C library. As of version 3.0, the C
50
+ library is no longer used, but the name is kept for backwards compatibility.
51
+
52
+ Python-snap7 is tested with Python 3.10+, on Windows, Linux and OS X.
53
+
54
+ The full documentation is available on `Read The Docs <https://python-snap7.readthedocs.io/en/latest/>`_.
55
+
56
+
57
+ Version 3.0 - Pure Python Rewrite
58
+ ==================================
59
+
60
+ Version 3.0 is a ground-up rewrite of python-snap7. The library no longer wraps the
61
+ C snap7 shared library — instead, the entire S7 protocol stack (TPKT, COTP, and S7)
62
+ is now implemented in pure Python. This is a **breaking change** from all previous
63
+ versions.
64
+
65
+ **Why this matters:**
66
+
67
+ * **Portability**: No more platform-specific shared libraries (`.dll`, `.so`, `.dylib`).
68
+ python-snap7 now works on any platform that runs Python — including ARM, Alpine Linux,
69
+ and other environments where the C library was difficult or impossible to install.
70
+ * **Easier installation**: Just ``pip install python-snap7``. No native dependencies,
71
+ no compiler toolchains, no manual library setup.
72
+ * **Easier to extend**: New features and protocol support can be added directly in Python.
73
+
74
+ **If you experience issues with 3.0:**
75
+
76
+ 1. Please report them on the `issue tracker <https://github.com/gijzelaerr/python-snap7/issues>`_
77
+ with a clear description of the problem and the version you are using
78
+ (``python -c "import snap7; print(snap7.__version__)"``).
79
+ 2. As a workaround, you can pin to the last pre-3.0 release::
80
+
81
+ $ pip install "python-snap7<3"
82
+
83
+ The latest stable pre-3.0 release is version 2.1.0. Documentation for pre-3.0
84
+ versions is available at `Read The Docs <https://python-snap7.readthedocs.io/en/v2/>`_.
85
+
86
+
87
+ Installation
88
+ ============
89
+
90
+ Install using pip::
91
+
92
+ $ pip install python-snap7
93
+
94
+ No native libraries or platform-specific dependencies are required — python-snap7 is a pure Python package that works on all platforms.
@@ -10,13 +10,13 @@ python_snap7.egg-info/requires.txt
10
10
  python_snap7.egg-info/top_level.txt
11
11
  snap7/__init__.py
12
12
  snap7/client.py
13
- snap7/common.py
13
+ snap7/connection.py
14
+ snap7/datatypes.py
14
15
  snap7/error.py
15
16
  snap7/logo.py
16
17
  snap7/partner.py
17
- snap7/protocol.py
18
- snap7/protocol.pyi
19
18
  snap7/py.typed
19
+ snap7/s7protocol.py
20
20
  snap7/type.py
21
21
  snap7/server/__init__.py
22
22
  snap7/server/__main__.py
@@ -24,10 +24,14 @@ snap7/util/__init__.py
24
24
  snap7/util/db.py
25
25
  snap7/util/getters.py
26
26
  snap7/util/setters.py
27
+ tests/test_api_surface.py
28
+ tests/test_behavioral_compatibility.py
27
29
  tests/test_client.py
28
- tests/test_common.py
30
+ tests/test_client_e2e.py
31
+ tests/test_datatypes.py
29
32
  tests/test_logo_client.py
30
33
  tests/test_mainloop.py
34
+ tests/test_multipacket.py
31
35
  tests/test_partner.py
32
36
  tests/test_server.py
33
37
  tests/test_util.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ snap7-server = snap7.server:mainloop
@@ -9,9 +9,12 @@ sphinx_rtd_theme
9
9
 
10
10
  [test]
11
11
  pytest
12
+ pytest-cov
13
+ pytest-html
12
14
  mypy
13
15
  types-setuptools
14
16
  ruff
15
17
  tox
18
+ tox-uv
16
19
  types-click
17
20
  uv
@@ -1,17 +1,32 @@
1
1
  """
2
2
  The Snap7 Python library.
3
+
4
+ Pure Python implementation of the S7 protocol for communicating with
5
+ Siemens S7 PLCs without requiring the native Snap7 C library.
3
6
  """
4
7
 
5
8
  from importlib.metadata import version, PackageNotFoundError
6
9
 
7
10
  from .client import Client
8
11
  from .server import Server
9
- from .logo import Logo
10
12
  from .partner import Partner
13
+ from .logo import Logo
11
14
  from .util.db import Row, DB
12
15
  from .type import Area, Block, WordLen, SrvEvent, SrvArea
13
16
 
14
- __all__ = ["Client", "Server", "Logo", "Partner", "Row", "DB", "Area", "Block", "WordLen", "SrvEvent", "SrvArea"]
17
+ __all__ = [
18
+ "Client",
19
+ "Server",
20
+ "Partner",
21
+ "Logo",
22
+ "Row",
23
+ "DB",
24
+ "Area",
25
+ "Block",
26
+ "WordLen",
27
+ "SrvEvent",
28
+ "SrvArea",
29
+ ]
15
30
 
16
31
  try:
17
32
  __version__ = version("python-snap7")