python-snap7 3.1.2__tar.gz → 3.2.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 (80) hide show
  1. python_snap7-3.2.0/PKG-INFO +103 -0
  2. python_snap7-3.2.0/README.rst +51 -0
  3. {python_snap7-3.1.2 → python_snap7-3.2.0}/pyproject.toml +13 -3
  4. python_snap7-3.2.0/python_snap7.egg-info/PKG-INFO +103 -0
  5. {python_snap7-3.1.2 → python_snap7-3.2.0}/python_snap7.egg-info/SOURCES.txt +12 -1
  6. {python_snap7-3.1.2 → python_snap7-3.2.0}/python_snap7.egg-info/requires.txt +3 -0
  7. {python_snap7-3.1.2 → python_snap7-3.2.0}/python_snap7.egg-info/top_level.txt +1 -0
  8. python_snap7-3.2.0/s7/__init__.py +52 -0
  9. {python_snap7-3.1.2 → python_snap7-3.2.0}/snap7/__init__.py +15 -4
  10. {python_snap7-3.1.2 → python_snap7-3.2.0}/snap7/async_client.py +159 -19
  11. {python_snap7-3.1.2 → python_snap7-3.2.0}/snap7/cli.py +2 -3
  12. {python_snap7-3.1.2 → python_snap7-3.2.0}/snap7/client.py +244 -43
  13. {python_snap7-3.1.2 → python_snap7-3.2.0}/snap7/client_base.py +27 -24
  14. {python_snap7-3.1.2 → python_snap7-3.2.0}/snap7/connection.py +21 -10
  15. {python_snap7-3.1.2 → python_snap7-3.2.0}/snap7/datatypes.py +24 -3
  16. {python_snap7-3.1.2 → python_snap7-3.2.0}/snap7/error.py +6 -0
  17. {python_snap7-3.1.2 → python_snap7-3.2.0}/snap7/logo.py +48 -6
  18. python_snap7-3.2.0/snap7/ppi.py +421 -0
  19. python_snap7-3.2.0/snap7/rate_limiter.py +110 -0
  20. {python_snap7-3.1.2 → python_snap7-3.2.0}/snap7/s7protocol.py +200 -16
  21. {python_snap7-3.1.2 → python_snap7-3.2.0}/snap7/server/__init__.py +242 -90
  22. python_snap7-3.2.0/snap7/szl.py +212 -0
  23. {python_snap7-3.1.2 → python_snap7-3.2.0}/snap7/tags.py +6 -6
  24. {python_snap7-3.1.2 → python_snap7-3.2.0}/snap7/type.py +14 -1
  25. {python_snap7-3.1.2 → python_snap7-3.2.0}/snap7/util/getters.py +21 -4
  26. {python_snap7-3.1.2 → python_snap7-3.2.0}/snap7/util/setters.py +4 -1
  27. {python_snap7-3.1.2 → python_snap7-3.2.0}/tests/test_async_client.py +54 -6
  28. {python_snap7-3.1.2 → python_snap7-3.2.0}/tests/test_client.py +82 -1
  29. python_snap7-3.2.0/tests/test_conformance.py +526 -0
  30. python_snap7-3.2.0/tests/test_connection.py +540 -0
  31. python_snap7-3.2.0/tests/test_coverage_gaps.py +144 -0
  32. python_snap7-3.2.0/tests/test_error.py +181 -0
  33. {python_snap7-3.1.2 → python_snap7-3.2.0}/tests/test_hypothesis.py +2 -2
  34. python_snap7-3.2.0/tests/test_lean_regressions.py +270 -0
  35. {python_snap7-3.1.2 → python_snap7-3.2.0}/tests/test_logging.py +8 -6
  36. python_snap7-3.2.0/tests/test_logo_reconnect_options.py +44 -0
  37. {python_snap7-3.1.2 → python_snap7-3.2.0}/tests/test_optimizer.py +3 -2
  38. {python_snap7-3.1.2 → python_snap7-3.2.0}/tests/test_partner.py +360 -2
  39. python_snap7-3.2.0/tests/test_ppi.py +261 -0
  40. python_snap7-3.2.0/tests/test_rate_limiter.py +148 -0
  41. {python_snap7-3.1.2 → python_snap7-3.2.0}/tests/test_s7protocol.py +165 -5
  42. {python_snap7-3.1.2 → python_snap7-3.2.0}/tests/test_server.py +395 -13
  43. python_snap7-3.2.0/tests/test_server_cli.py +30 -0
  44. {python_snap7-3.1.2 → python_snap7-3.2.0}/tests/test_stress.py +3 -2
  45. python_snap7-3.1.2/PKG-INFO +0 -131
  46. python_snap7-3.1.2/README.rst +0 -81
  47. python_snap7-3.1.2/python_snap7.egg-info/PKG-INFO +0 -131
  48. python_snap7-3.1.2/snap7/szl.py +0 -115
  49. python_snap7-3.1.2/snap7/util/symbols.py +0 -547
  50. {python_snap7-3.1.2 → python_snap7-3.2.0}/LICENSE +0 -0
  51. {python_snap7-3.1.2 → python_snap7-3.2.0}/MANIFEST.in +0 -0
  52. {python_snap7-3.1.2 → python_snap7-3.2.0}/python_snap7.egg-info/dependency_links.txt +0 -0
  53. {python_snap7-3.1.2 → python_snap7-3.2.0}/python_snap7.egg-info/entry_points.txt +0 -0
  54. {python_snap7-3.1.2 → python_snap7-3.2.0}/setup.cfg +0 -0
  55. {python_snap7-3.1.2 → python_snap7-3.2.0}/snap7/demo.py +0 -0
  56. {python_snap7-3.1.2 → python_snap7-3.2.0}/snap7/discovery.py +0 -0
  57. {python_snap7-3.1.2 → python_snap7-3.2.0}/snap7/log.py +0 -0
  58. {python_snap7-3.1.2 → python_snap7-3.2.0}/snap7/optimizer.py +0 -0
  59. {python_snap7-3.1.2 → python_snap7-3.2.0}/snap7/partner.py +0 -0
  60. {python_snap7-3.1.2 → python_snap7-3.2.0}/snap7/py.typed +0 -0
  61. {python_snap7-3.1.2 → python_snap7-3.2.0}/snap7/server/__main__.py +0 -0
  62. {python_snap7-3.1.2 → python_snap7-3.2.0}/snap7/util/__init__.py +0 -0
  63. {python_snap7-3.1.2 → python_snap7-3.2.0}/snap7/util/db.py +0 -0
  64. {python_snap7-3.1.2 → python_snap7-3.2.0}/tests/test_api_surface.py +0 -0
  65. {python_snap7-3.1.2 → python_snap7-3.2.0}/tests/test_behavioral_compatibility.py +0 -0
  66. {python_snap7-3.1.2 → python_snap7-3.2.0}/tests/test_cli.py +0 -0
  67. {python_snap7-3.1.2 → python_snap7-3.2.0}/tests/test_client_e2e.py +0 -0
  68. {python_snap7-3.1.2 → python_snap7-3.2.0}/tests/test_datatypes.py +0 -0
  69. {python_snap7-3.1.2 → python_snap7-3.2.0}/tests/test_demo.py +0 -0
  70. {python_snap7-3.1.2 → python_snap7-3.2.0}/tests/test_discovery.py +0 -0
  71. {python_snap7-3.1.2 → python_snap7-3.2.0}/tests/test_finalize.py +0 -0
  72. {python_snap7-3.1.2 → python_snap7-3.2.0}/tests/test_logo_client.py +0 -0
  73. {python_snap7-3.1.2 → python_snap7-3.2.0}/tests/test_mainloop.py +0 -0
  74. {python_snap7-3.1.2 → python_snap7-3.2.0}/tests/test_multipacket.py +0 -0
  75. {python_snap7-3.1.2 → python_snap7-3.2.0}/tests/test_property.py +0 -0
  76. {python_snap7-3.1.2 → python_snap7-3.2.0}/tests/test_reconnect.py +0 -0
  77. {python_snap7-3.1.2 → python_snap7-3.2.0}/tests/test_routing.py +0 -0
  78. {python_snap7-3.1.2 → python_snap7-3.2.0}/tests/test_tags.py +0 -0
  79. {python_snap7-3.1.2 → python_snap7-3.2.0}/tests/test_typed_access.py +0 -0
  80. {python_snap7-3.1.2 → python_snap7-3.2.0}/tests/test_util.py +0 -0
@@ -0,0 +1,103 @@
1
+ Metadata-Version: 2.4
2
+ Name: python-snap7
3
+ Version: 3.2.0
4
+ Summary: Pure Python S7 communication library for Siemens PLCs
5
+ Author-email: Gijs Molenaar <gijsmolenaar@gmail.com>
6
+ License-Expression: 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-asyncio; extra == "test"
27
+ Requires-Dist: pytest-cov; extra == "test"
28
+ Requires-Dist: pytest-html; extra == "test"
29
+ Requires-Dist: hypothesis; extra == "test"
30
+ Requires-Dist: mypy; extra == "test"
31
+ Requires-Dist: types-setuptools; extra == "test"
32
+ Requires-Dist: ruff; extra == "test"
33
+ Requires-Dist: tox; extra == "test"
34
+ Requires-Dist: tox-uv; extra == "test"
35
+ Requires-Dist: types-click; extra == "test"
36
+ Requires-Dist: uv; extra == "test"
37
+ Provides-Extra: cli
38
+ Requires-Dist: rich; extra == "cli"
39
+ Requires-Dist: click; extra == "cli"
40
+ Provides-Extra: demo
41
+ Requires-Dist: psutil; extra == "demo"
42
+ Requires-Dist: rich; extra == "demo"
43
+ Requires-Dist: click; extra == "demo"
44
+ Provides-Extra: doc
45
+ Requires-Dist: sphinx; extra == "doc"
46
+ Requires-Dist: sphinx_rtd_theme; extra == "doc"
47
+ Provides-Extra: discovery
48
+ Requires-Dist: pnio-dcp; extra == "discovery"
49
+ Provides-Extra: ppi
50
+ Requires-Dist: pyserial>=3.5; extra == "ppi"
51
+ Dynamic: license-file
52
+
53
+ .. image:: https://img.shields.io/pypi/v/python-snap7.svg
54
+ :target: https://pypi.org/project/python-snap7/
55
+
56
+ .. image:: https://img.shields.io/pypi/pyversions/python-snap7.svg
57
+ :target: https://pypi.org/project/python-snap7/
58
+
59
+ .. image:: https://img.shields.io/github/license/gijzelaerr/python-snap7.svg
60
+ :target: https://github.com/gijzelaerr/python-snap7/blob/master/LICENSE
61
+
62
+ .. image:: https://github.com/gijzelaerr/python-snap7/actions/workflows/test.yml/badge.svg
63
+ :target: https://github.com/gijzelaerr/python-snap7/actions/workflows/test.yml
64
+
65
+ .. image:: https://readthedocs.org/projects/python-snap7/badge/
66
+ :target: https://python-snap7.readthedocs.io/en/latest/
67
+
68
+
69
+ python-snap7
70
+ ============
71
+
72
+ python-snap7 is a pure-Python library for communicating with Siemens S7 PLCs
73
+ using the classic S7 protocol. It supports S7-300 and S7-400 controllers, as
74
+ well as S7-1200 and S7-1500 controllers with PUT/GET access enabled. It
75
+ supports Python 3.10+ on Windows, Linux, and macOS without native dependencies.
76
+
77
+ Installation
78
+ ============
79
+
80
+ Install from PyPI::
81
+
82
+ pip install python-snap7
83
+
84
+ Quick start
85
+ ===========
86
+
87
+ ::
88
+
89
+ from s7 import Client
90
+
91
+ client = Client()
92
+ client.connect("192.168.1.10", 0, 1)
93
+ data = client.db_read(1, 0, 4)
94
+ client.disconnect()
95
+
96
+ The ``s7`` package is the recommended import. The ``snap7`` package name is
97
+ also available for backwards compatibility.
98
+
99
+ Documentation
100
+ =============
101
+
102
+ Read the full documentation at
103
+ `python-snap7.readthedocs.io <https://python-snap7.readthedocs.io/en/latest/>`_.
@@ -0,0 +1,51 @@
1
+ .. image:: https://img.shields.io/pypi/v/python-snap7.svg
2
+ :target: https://pypi.org/project/python-snap7/
3
+
4
+ .. image:: https://img.shields.io/pypi/pyversions/python-snap7.svg
5
+ :target: https://pypi.org/project/python-snap7/
6
+
7
+ .. image:: https://img.shields.io/github/license/gijzelaerr/python-snap7.svg
8
+ :target: https://github.com/gijzelaerr/python-snap7/blob/master/LICENSE
9
+
10
+ .. image:: https://github.com/gijzelaerr/python-snap7/actions/workflows/test.yml/badge.svg
11
+ :target: https://github.com/gijzelaerr/python-snap7/actions/workflows/test.yml
12
+
13
+ .. image:: https://readthedocs.org/projects/python-snap7/badge/
14
+ :target: https://python-snap7.readthedocs.io/en/latest/
15
+
16
+
17
+ python-snap7
18
+ ============
19
+
20
+ python-snap7 is a pure-Python library for communicating with Siemens S7 PLCs
21
+ using the classic S7 protocol. It supports S7-300 and S7-400 controllers, as
22
+ well as S7-1200 and S7-1500 controllers with PUT/GET access enabled. It
23
+ supports Python 3.10+ on Windows, Linux, and macOS without native dependencies.
24
+
25
+ Installation
26
+ ============
27
+
28
+ Install from PyPI::
29
+
30
+ pip install python-snap7
31
+
32
+ Quick start
33
+ ===========
34
+
35
+ ::
36
+
37
+ from s7 import Client
38
+
39
+ client = Client()
40
+ client.connect("192.168.1.10", 0, 1)
41
+ data = client.db_read(1, 0, 4)
42
+ client.disconnect()
43
+
44
+ The ``s7`` package is the recommended import. The ``snap7`` package name is
45
+ also available for backwards compatibility.
46
+
47
+ Documentation
48
+ =============
49
+
50
+ Read the full documentation at
51
+ `python-snap7.readthedocs.io <https://python-snap7.readthedocs.io/en/latest/>`_.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "python-snap7"
7
- version = "3.1.2"
7
+ version = "3.2.0"
8
8
  description = "Pure Python S7 communication library for Siemens PLCs"
9
9
  readme = "README.rst"
10
10
  authors = [
@@ -37,12 +37,13 @@ cli = ["rich", "click" ]
37
37
  demo = ["psutil", "rich", "click"]
38
38
  doc = ["sphinx", "sphinx_rtd_theme"]
39
39
  discovery = ["pnio-dcp"]
40
+ ppi = ["pyserial>=3.5"]
40
41
 
41
42
  [tool.setuptools.package-data]
42
43
  snap7 = ["py.typed"]
43
44
 
44
45
  [tool.setuptools.packages.find]
45
- include = ["snap7*"]
46
+ include = ["snap7*", "s7*"]
46
47
 
47
48
  [project.scripts]
48
49
  snap7-server = "snap7.server:mainloop"
@@ -60,8 +61,14 @@ markers =[
60
61
  "partner",
61
62
  "routing",
62
63
  "server",
63
- "util"
64
+ "util",
65
+ "conformance: protocol conformance tests"
64
66
  ]
67
+ asyncio_mode = "auto"
68
+
69
+ [[tool.uv.index]]
70
+ name = "pypi"
71
+ url = "https://pypi.org/simple"
65
72
 
66
73
  [tool.mypy]
67
74
  ignore_missing_imports = true
@@ -69,6 +76,9 @@ strict = true
69
76
  # https://github.com/python/mypy/issues/2427#issuecomment-1419206807
70
77
  disable_error_code = ["method-assign", "attr-defined"]
71
78
 
79
+ [tool.coverage.report]
80
+ fail_under = 75
81
+
72
82
  [tool.ruff]
73
83
  output-format = "full"
74
84
  line-length = 130
@@ -0,0 +1,103 @@
1
+ Metadata-Version: 2.4
2
+ Name: python-snap7
3
+ Version: 3.2.0
4
+ Summary: Pure Python S7 communication library for Siemens PLCs
5
+ Author-email: Gijs Molenaar <gijsmolenaar@gmail.com>
6
+ License-Expression: 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-asyncio; extra == "test"
27
+ Requires-Dist: pytest-cov; extra == "test"
28
+ Requires-Dist: pytest-html; extra == "test"
29
+ Requires-Dist: hypothesis; extra == "test"
30
+ Requires-Dist: mypy; extra == "test"
31
+ Requires-Dist: types-setuptools; extra == "test"
32
+ Requires-Dist: ruff; extra == "test"
33
+ Requires-Dist: tox; extra == "test"
34
+ Requires-Dist: tox-uv; extra == "test"
35
+ Requires-Dist: types-click; extra == "test"
36
+ Requires-Dist: uv; extra == "test"
37
+ Provides-Extra: cli
38
+ Requires-Dist: rich; extra == "cli"
39
+ Requires-Dist: click; extra == "cli"
40
+ Provides-Extra: demo
41
+ Requires-Dist: psutil; extra == "demo"
42
+ Requires-Dist: rich; extra == "demo"
43
+ Requires-Dist: click; extra == "demo"
44
+ Provides-Extra: doc
45
+ Requires-Dist: sphinx; extra == "doc"
46
+ Requires-Dist: sphinx_rtd_theme; extra == "doc"
47
+ Provides-Extra: discovery
48
+ Requires-Dist: pnio-dcp; extra == "discovery"
49
+ Provides-Extra: ppi
50
+ Requires-Dist: pyserial>=3.5; extra == "ppi"
51
+ Dynamic: license-file
52
+
53
+ .. image:: https://img.shields.io/pypi/v/python-snap7.svg
54
+ :target: https://pypi.org/project/python-snap7/
55
+
56
+ .. image:: https://img.shields.io/pypi/pyversions/python-snap7.svg
57
+ :target: https://pypi.org/project/python-snap7/
58
+
59
+ .. image:: https://img.shields.io/github/license/gijzelaerr/python-snap7.svg
60
+ :target: https://github.com/gijzelaerr/python-snap7/blob/master/LICENSE
61
+
62
+ .. image:: https://github.com/gijzelaerr/python-snap7/actions/workflows/test.yml/badge.svg
63
+ :target: https://github.com/gijzelaerr/python-snap7/actions/workflows/test.yml
64
+
65
+ .. image:: https://readthedocs.org/projects/python-snap7/badge/
66
+ :target: https://python-snap7.readthedocs.io/en/latest/
67
+
68
+
69
+ python-snap7
70
+ ============
71
+
72
+ python-snap7 is a pure-Python library for communicating with Siemens S7 PLCs
73
+ using the classic S7 protocol. It supports S7-300 and S7-400 controllers, as
74
+ well as S7-1200 and S7-1500 controllers with PUT/GET access enabled. It
75
+ supports Python 3.10+ on Windows, Linux, and macOS without native dependencies.
76
+
77
+ Installation
78
+ ============
79
+
80
+ Install from PyPI::
81
+
82
+ pip install python-snap7
83
+
84
+ Quick start
85
+ ===========
86
+
87
+ ::
88
+
89
+ from s7 import Client
90
+
91
+ client = Client()
92
+ client.connect("192.168.1.10", 0, 1)
93
+ data = client.db_read(1, 0, 4)
94
+ client.disconnect()
95
+
96
+ The ``s7`` package is the recommended import. The ``snap7`` package name is
97
+ also available for backwards compatibility.
98
+
99
+ Documentation
100
+ =============
101
+
102
+ Read the full documentation at
103
+ `python-snap7.readthedocs.io <https://python-snap7.readthedocs.io/en/latest/>`_.
@@ -8,6 +8,7 @@ python_snap7.egg-info/dependency_links.txt
8
8
  python_snap7.egg-info/entry_points.txt
9
9
  python_snap7.egg-info/requires.txt
10
10
  python_snap7.egg-info/top_level.txt
11
+ s7/__init__.py
11
12
  snap7/__init__.py
12
13
  snap7/async_client.py
13
14
  snap7/cli.py
@@ -22,7 +23,9 @@ snap7/log.py
22
23
  snap7/logo.py
23
24
  snap7/optimizer.py
24
25
  snap7/partner.py
26
+ snap7/ppi.py
25
27
  snap7/py.typed
28
+ snap7/rate_limiter.py
26
29
  snap7/s7protocol.py
27
30
  snap7/szl.py
28
31
  snap7/tags.py
@@ -33,29 +36,37 @@ snap7/util/__init__.py
33
36
  snap7/util/db.py
34
37
  snap7/util/getters.py
35
38
  snap7/util/setters.py
36
- snap7/util/symbols.py
37
39
  tests/test_api_surface.py
38
40
  tests/test_async_client.py
39
41
  tests/test_behavioral_compatibility.py
40
42
  tests/test_cli.py
41
43
  tests/test_client.py
42
44
  tests/test_client_e2e.py
45
+ tests/test_conformance.py
46
+ tests/test_connection.py
47
+ tests/test_coverage_gaps.py
43
48
  tests/test_datatypes.py
44
49
  tests/test_demo.py
45
50
  tests/test_discovery.py
51
+ tests/test_error.py
46
52
  tests/test_finalize.py
47
53
  tests/test_hypothesis.py
54
+ tests/test_lean_regressions.py
48
55
  tests/test_logging.py
49
56
  tests/test_logo_client.py
57
+ tests/test_logo_reconnect_options.py
50
58
  tests/test_mainloop.py
51
59
  tests/test_multipacket.py
52
60
  tests/test_optimizer.py
53
61
  tests/test_partner.py
62
+ tests/test_ppi.py
54
63
  tests/test_property.py
64
+ tests/test_rate_limiter.py
55
65
  tests/test_reconnect.py
56
66
  tests/test_routing.py
57
67
  tests/test_s7protocol.py
58
68
  tests/test_server.py
69
+ tests/test_server_cli.py
59
70
  tests/test_stress.py
60
71
  tests/test_tags.py
61
72
  tests/test_typed_access.py
@@ -15,6 +15,9 @@ pnio-dcp
15
15
  sphinx
16
16
  sphinx_rtd_theme
17
17
 
18
+ [ppi]
19
+ pyserial>=3.5
20
+
18
21
  [test]
19
22
  pytest
20
23
  pytest-asyncio
@@ -0,0 +1,52 @@
1
+ """Alias for the ``snap7`` package.
2
+
3
+ ``s7`` re-exports everything from ``snap7`` so that either name works::
4
+
5
+ from s7 import Client # same as: from snap7 import Client
6
+ from s7.type import Area # same as: from snap7.type import Area
7
+
8
+ Both import names are supported; ``s7`` is recommended for new code.
9
+ """
10
+
11
+ import importlib
12
+ import sys
13
+
14
+ import snap7 as snap7 # noqa: F401
15
+
16
+ from snap7 import * # noqa: F403
17
+ from snap7 import __all__ as __all__, __version__ as __version__
18
+
19
+ _SUBMODULES = [
20
+ "async_client",
21
+ "cli",
22
+ "client",
23
+ "client_base",
24
+ "connection",
25
+ "datatypes",
26
+ "demo",
27
+ "discovery",
28
+ "error",
29
+ "log",
30
+ "logo",
31
+ "optimizer",
32
+ "partner",
33
+ "ppi",
34
+ "rate_limiter",
35
+ "s7protocol",
36
+ "server",
37
+ "szl",
38
+ "tags",
39
+ "type",
40
+ "util",
41
+ ]
42
+
43
+ for _name in _SUBMODULES:
44
+ _fqn = f"s7.{_name}"
45
+ if _fqn not in sys.modules:
46
+ try:
47
+ _mod = importlib.import_module(f"snap7.{_name}")
48
+ sys.modules[_fqn] = _mod
49
+ except ImportError:
50
+ pass
51
+
52
+ del _name, _fqn, _mod, _SUBMODULES
@@ -1,8 +1,15 @@
1
1
  """
2
- The Snap7 Python library.
2
+ The snap7 compatibility package.
3
3
 
4
- Pure Python implementation of the S7 protocol for communicating with
5
- Siemens S7 PLCs without requiring the native Snap7 C library.
4
+ Pure Python implementation of the classic S7 protocol for communicating with
5
+ Siemens S7 PLCs. This package is kept for backwards compatibility. For new
6
+ projects, use the ``s7`` package instead::
7
+
8
+ from s7 import Client
9
+
10
+ client = Client()
11
+ client.connect("192.168.1.10", 0, 1)
12
+ data = client.db_read(1, 0, 4)
6
13
  """
7
14
 
8
15
  from importlib.metadata import version, PackageNotFoundError
@@ -11,16 +18,19 @@ from .client import Client
11
18
  from .async_client import AsyncClient
12
19
  from .server import Server
13
20
  from .partner import Partner
21
+ from .ppi import PPIArea, PPIClient
14
22
  from .logo import Logo
15
23
  from .util.db import Row, DB
16
24
  from .tags import NodeS7Tag, PLC4XTag, Tag, from_browse, load_csv, load_json, load_tia_xml, parse_tag
17
- from .type import Area, Block, WordLen, SrvEvent, SrvArea
25
+ from .type import Area, Block, ForceEntry, WordLen, SrvEvent, SrvArea
18
26
 
19
27
  __all__ = [
20
28
  "Client",
21
29
  "AsyncClient",
22
30
  "Server",
23
31
  "Partner",
32
+ "PPIClient",
33
+ "PPIArea",
24
34
  "Logo",
25
35
  "Row",
26
36
  "DB",
@@ -34,6 +44,7 @@ __all__ = [
34
44
  "from_browse",
35
45
  "Area",
36
46
  "Block",
47
+ "ForceEntry",
37
48
  "WordLen",
38
49
  "SrvEvent",
39
50
  "SrvArea",