python-snap7 2.0.2__tar.gz → 2.1.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 (49) hide show
  1. {python_snap7-2.0.2 → python_snap7-2.1.0}/PKG-INFO +13 -13
  2. python_snap7-2.1.0/README.rst +18 -0
  3. {python_snap7-2.0.2 → python_snap7-2.1.0}/pyproject.toml +11 -11
  4. {python_snap7-2.0.2 → python_snap7-2.1.0}/python_snap7.egg-info/PKG-INFO +13 -13
  5. {python_snap7-2.0.2 → python_snap7-2.1.0}/python_snap7.egg-info/SOURCES.txt +8 -4
  6. python_snap7-2.1.0/python_snap7.egg-info/entry_points.txt +2 -0
  7. {python_snap7-2.0.2 → python_snap7-2.1.0}/python_snap7.egg-info/requires.txt +2 -0
  8. {python_snap7-2.0.2 → python_snap7-2.1.0}/snap7/__init__.py +17 -2
  9. python_snap7-2.1.0/snap7/client.py +1965 -0
  10. python_snap7-2.1.0/snap7/connection.py +396 -0
  11. python_snap7-2.1.0/snap7/datatypes.py +311 -0
  12. {python_snap7-2.0.2 → python_snap7-2.1.0}/snap7/error.py +91 -59
  13. python_snap7-2.1.0/snap7/logo.py +222 -0
  14. python_snap7-2.1.0/snap7/partner.py +680 -0
  15. python_snap7-2.1.0/snap7/s7protocol.py +1480 -0
  16. python_snap7-2.1.0/snap7/server/__init__.py +2681 -0
  17. {python_snap7-2.0.2 → python_snap7-2.1.0}/snap7/server/__main__.py +3 -16
  18. {python_snap7-2.0.2 → python_snap7-2.1.0}/snap7/type.py +1 -0
  19. {python_snap7-2.0.2 → python_snap7-2.1.0}/snap7/util/__init__.py +2 -0
  20. {python_snap7-2.0.2 → python_snap7-2.1.0}/snap7/util/db.py +7 -3
  21. {python_snap7-2.0.2 → python_snap7-2.1.0}/snap7/util/setters.py +38 -43
  22. python_snap7-2.1.0/tests/test_api_surface.py +444 -0
  23. python_snap7-2.1.0/tests/test_behavioral_compatibility.py +401 -0
  24. {python_snap7-2.0.2 → python_snap7-2.1.0}/tests/test_client.py +106 -128
  25. python_snap7-2.1.0/tests/test_client_e2e.py +784 -0
  26. python_snap7-2.1.0/tests/test_datatypes.py +252 -0
  27. {python_snap7-2.0.2 → python_snap7-2.1.0}/tests/test_logo_client.py +12 -15
  28. {python_snap7-2.0.2 → python_snap7-2.1.0}/tests/test_mainloop.py +73 -11
  29. python_snap7-2.1.0/tests/test_multipacket.py +347 -0
  30. {python_snap7-2.0.2 → python_snap7-2.1.0}/tests/test_partner.py +3 -30
  31. {python_snap7-2.0.2 → python_snap7-2.1.0}/tests/test_server.py +97 -33
  32. {python_snap7-2.0.2 → python_snap7-2.1.0}/tests/test_util.py +9 -1
  33. python_snap7-2.0.2/README.rst +0 -20
  34. python_snap7-2.0.2/python_snap7.egg-info/entry_points.txt +0 -2
  35. python_snap7-2.0.2/snap7/client.py +0 -1519
  36. python_snap7-2.0.2/snap7/common.py +0 -87
  37. python_snap7-2.0.2/snap7/logo.py +0 -151
  38. python_snap7-2.0.2/snap7/partner.py +0 -219
  39. python_snap7-2.0.2/snap7/protocol.py +0 -140
  40. python_snap7-2.0.2/snap7/protocol.pyi +0 -160
  41. python_snap7-2.0.2/snap7/server/__init__.py +0 -546
  42. python_snap7-2.0.2/tests/test_common.py +0 -42
  43. {python_snap7-2.0.2 → python_snap7-2.1.0}/LICENSE +0 -0
  44. {python_snap7-2.0.2 → python_snap7-2.1.0}/MANIFEST.in +0 -0
  45. {python_snap7-2.0.2 → python_snap7-2.1.0}/python_snap7.egg-info/dependency_links.txt +0 -0
  46. {python_snap7-2.0.2 → python_snap7-2.1.0}/python_snap7.egg-info/top_level.txt +0 -0
  47. {python_snap7-2.0.2 → python_snap7-2.1.0}/setup.cfg +0 -0
  48. {python_snap7-2.0.2 → python_snap7-2.1.0}/snap7/py.typed +0 -0
  49. {python_snap7-2.0.2 → python_snap7-2.1.0}/snap7/util/getters.py +0 -0
@@ -1,9 +1,9 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: python-snap7
3
- Version: 2.0.2
4
- Summary: Python wrapper for the snap7 library
3
+ Version: 2.1.0
4
+ Summary: Pure Python S7 communication library for Siemens PLCs
5
5
  Author-email: Gijs Molenaar <gijsmolenaar@gmail.com>
6
- License: MIT License
6
+ License: MIT
7
7
  Project-URL: Homepage, https://github.com/gijzelaerr/python-snap7
8
8
  Project-URL: Documentation, https://python-snap7.readthedocs.io/en/latest/
9
9
  Keywords: snap7,s7,siemens,plc
@@ -12,22 +12,23 @@ Classifier: Environment :: Console
12
12
  Classifier: Topic :: System :: Hardware
13
13
  Classifier: Intended Audience :: Developers
14
14
  Classifier: Intended Audience :: Manufacturing
15
- Classifier: License :: OSI Approved :: MIT License
16
15
  Classifier: Operating System :: POSIX
17
- Classifier: Programming Language :: Python :: 3.9
18
16
  Classifier: Programming Language :: Python :: 3.10
19
17
  Classifier: Programming Language :: Python :: 3.11
20
18
  Classifier: Programming Language :: Python :: 3.12
21
19
  Classifier: Programming Language :: Python :: 3.13
22
- Requires-Python: >=3.9
20
+ Classifier: Programming Language :: Python :: 3.14
21
+ Requires-Python: >=3.10
23
22
  Description-Content-Type: text/x-rst
24
23
  License-File: LICENSE
25
24
  Provides-Extra: test
26
25
  Requires-Dist: pytest; extra == "test"
26
+ Requires-Dist: pytest-html; extra == "test"
27
27
  Requires-Dist: mypy; extra == "test"
28
28
  Requires-Dist: types-setuptools; extra == "test"
29
29
  Requires-Dist: ruff; extra == "test"
30
30
  Requires-Dist: tox; extra == "test"
31
+ Requires-Dist: tox-uv; extra == "test"
31
32
  Requires-Dist: types-click; extra == "test"
32
33
  Requires-Dist: uv; extra == "test"
33
34
  Provides-Extra: cli
@@ -36,14 +37,14 @@ Requires-Dist: click; extra == "cli"
36
37
  Provides-Extra: doc
37
38
  Requires-Dist: sphinx; extra == "doc"
38
39
  Requires-Dist: sphinx_rtd_theme; extra == "doc"
40
+ Dynamic: license-file
39
41
 
40
42
  About
41
43
  =====
42
44
 
43
- This is a Python wrapper for Snap7, an open-source, 32/64 bit, multi-platform Ethernet communication suite for interfacing natively
44
- with Siemens S7 PLCs.
45
+ Python-snap7 is a pure Python S7 communication library for interfacing with Siemens S7 PLCs.
45
46
 
46
- Python-snap7 is tested with Python 3.9+, on Windows, Linux and OS X.
47
+ Python-snap7 is tested with Python 3.10+, on Windows, Linux and OS X.
47
48
 
48
49
  The full documentation is available on `Read The Docs <https://python-snap7.readthedocs.io/en/latest/>`_.
49
50
 
@@ -51,9 +52,8 @@ The full documentation is available on `Read The Docs <https://python-snap7.read
51
52
  Installation
52
53
  ============
53
54
 
54
- If you are running Windows (amd64), Mac OS X (amd64/aarch64), GNU/Linux (amd64/arm64) or a compatible platform you can install the binary wheel using::
55
+ Install using pip::
55
56
 
56
57
  $ pip install python-snap7
57
58
 
58
-
59
- Otherwise, please follow the `online installation instructions <https://python-snap7.readthedocs.io/en/latest/installation.html>`_ to install python-snap7 from source.
59
+ No native libraries or platform-specific dependencies are required - python-snap7 is a pure Python package that works on all platforms.
@@ -0,0 +1,18 @@
1
+ About
2
+ =====
3
+
4
+ Python-snap7 is a pure Python S7 communication library for interfacing with Siemens S7 PLCs.
5
+
6
+ Python-snap7 is tested with Python 3.10+, on Windows, Linux and OS X.
7
+
8
+ The full documentation is available on `Read The Docs <https://python-snap7.readthedocs.io/en/latest/>`_.
9
+
10
+
11
+ Installation
12
+ ============
13
+
14
+ Install using pip::
15
+
16
+ $ pip install python-snap7
17
+
18
+ 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 = "2.1.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-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
@@ -1,9 +1,9 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: python-snap7
3
- Version: 2.0.2
4
- Summary: Python wrapper for the snap7 library
3
+ Version: 2.1.0
4
+ Summary: Pure Python S7 communication library for Siemens PLCs
5
5
  Author-email: Gijs Molenaar <gijsmolenaar@gmail.com>
6
- License: MIT License
6
+ License: MIT
7
7
  Project-URL: Homepage, https://github.com/gijzelaerr/python-snap7
8
8
  Project-URL: Documentation, https://python-snap7.readthedocs.io/en/latest/
9
9
  Keywords: snap7,s7,siemens,plc
@@ -12,22 +12,23 @@ Classifier: Environment :: Console
12
12
  Classifier: Topic :: System :: Hardware
13
13
  Classifier: Intended Audience :: Developers
14
14
  Classifier: Intended Audience :: Manufacturing
15
- Classifier: License :: OSI Approved :: MIT License
16
15
  Classifier: Operating System :: POSIX
17
- Classifier: Programming Language :: Python :: 3.9
18
16
  Classifier: Programming Language :: Python :: 3.10
19
17
  Classifier: Programming Language :: Python :: 3.11
20
18
  Classifier: Programming Language :: Python :: 3.12
21
19
  Classifier: Programming Language :: Python :: 3.13
22
- Requires-Python: >=3.9
20
+ Classifier: Programming Language :: Python :: 3.14
21
+ Requires-Python: >=3.10
23
22
  Description-Content-Type: text/x-rst
24
23
  License-File: LICENSE
25
24
  Provides-Extra: test
26
25
  Requires-Dist: pytest; extra == "test"
26
+ Requires-Dist: pytest-html; extra == "test"
27
27
  Requires-Dist: mypy; extra == "test"
28
28
  Requires-Dist: types-setuptools; extra == "test"
29
29
  Requires-Dist: ruff; extra == "test"
30
30
  Requires-Dist: tox; extra == "test"
31
+ Requires-Dist: tox-uv; extra == "test"
31
32
  Requires-Dist: types-click; extra == "test"
32
33
  Requires-Dist: uv; extra == "test"
33
34
  Provides-Extra: cli
@@ -36,14 +37,14 @@ Requires-Dist: click; extra == "cli"
36
37
  Provides-Extra: doc
37
38
  Requires-Dist: sphinx; extra == "doc"
38
39
  Requires-Dist: sphinx_rtd_theme; extra == "doc"
40
+ Dynamic: license-file
39
41
 
40
42
  About
41
43
  =====
42
44
 
43
- This is a Python wrapper for Snap7, an open-source, 32/64 bit, multi-platform Ethernet communication suite for interfacing natively
44
- with Siemens S7 PLCs.
45
+ Python-snap7 is a pure Python S7 communication library for interfacing with Siemens S7 PLCs.
45
46
 
46
- Python-snap7 is tested with Python 3.9+, on Windows, Linux and OS X.
47
+ Python-snap7 is tested with Python 3.10+, on Windows, Linux and OS X.
47
48
 
48
49
  The full documentation is available on `Read The Docs <https://python-snap7.readthedocs.io/en/latest/>`_.
49
50
 
@@ -51,9 +52,8 @@ The full documentation is available on `Read The Docs <https://python-snap7.read
51
52
  Installation
52
53
  ============
53
54
 
54
- If you are running Windows (amd64), Mac OS X (amd64/aarch64), GNU/Linux (amd64/arm64) or a compatible platform you can install the binary wheel using::
55
+ Install using pip::
55
56
 
56
57
  $ pip install python-snap7
57
58
 
58
-
59
- Otherwise, please follow the `online installation instructions <https://python-snap7.readthedocs.io/en/latest/installation.html>`_ to install python-snap7 from source.
59
+ 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,11 @@ sphinx_rtd_theme
9
9
 
10
10
  [test]
11
11
  pytest
12
+ pytest-html
12
13
  mypy
13
14
  types-setuptools
14
15
  ruff
15
16
  tox
17
+ tox-uv
16
18
  types-click
17
19
  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")