s7commplus 0.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 (141) hide show
  1. s7commplus-0.1.0/LICENSE +20 -0
  2. s7commplus-0.1.0/PKG-INFO +90 -0
  3. s7commplus-0.1.0/README.md +50 -0
  4. s7commplus-0.1.0/pyproject.toml +80 -0
  5. s7commplus-0.1.0/s7commplus/__init__.py +64 -0
  6. s7commplus-0.1.0/s7commplus/alarm.py +543 -0
  7. s7commplus-0.1.0/s7commplus/async_client.py +1425 -0
  8. s7commplus-0.1.0/s7commplus/blob_decompressor.py +89 -0
  9. s7commplus-0.1.0/s7commplus/catalog.py +137 -0
  10. s7commplus-0.1.0/s7commplus/client.py +1719 -0
  11. s7commplus-0.1.0/s7commplus/codec.py +810 -0
  12. s7commplus-0.1.0/s7commplus/connection.py +2233 -0
  13. s7commplus-0.1.0/s7commplus/error.py +456 -0
  14. s7commplus-0.1.0/s7commplus/legitimation.py +271 -0
  15. s7commplus-0.1.0/s7commplus/protocol.py +387 -0
  16. s7commplus-0.1.0/s7commplus/py.typed +0 -0
  17. s7commplus-0.1.0/s7commplus/server.py +1374 -0
  18. s7commplus-0.1.0/s7commplus/session_auth/ARCHITECTURE.md +192 -0
  19. s7commplus-0.1.0/s7commplus/session_auth/LICENSE-HarpoS7 +21 -0
  20. s7commplus-0.1.0/s7commplus/session_auth/__init__.py +80 -0
  21. s7commplus-0.1.0/s7commplus/session_auth/artifacts.json +254 -0
  22. s7commplus-0.1.0/s7commplus/session_auth/blob_metadata.py +142 -0
  23. s7commplus-0.1.0/s7commplus/session_auth/family0/__init__.py +7 -0
  24. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/__init__.py +20 -0
  25. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/data/__init__.py +96 -0
  26. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/data/_constants.py +1637 -0
  27. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/data/fp_data1.bin +0 -0
  28. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/data/fp_data2.bin +0 -0
  29. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/data/transform12_big_int_data.bin +0 -0
  30. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/data/transform12_metadata.bin +0 -0
  31. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/monolith1.py +3619 -0
  32. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/monolith10.py +18 -0
  33. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/monolith11.py +1091 -0
  34. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/monolith2.py +3430 -0
  35. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/monolith3.py +2900 -0
  36. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/monolith4.py +5578 -0
  37. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/monolith5.py +3625 -0
  38. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/monolith6.py +4052 -0
  39. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/monolith7.py +2263 -0
  40. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/monolith8.py +3636 -0
  41. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/monolith9.py +38 -0
  42. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/nine/__init__.py +0 -0
  43. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/nine/part1.py +3227 -0
  44. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/nine/part10.py +4550 -0
  45. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/nine/part11.py +5033 -0
  46. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/nine/part2.py +4524 -0
  47. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/nine/part3.py +5044 -0
  48. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/nine/part4.py +4449 -0
  49. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/nine/part5.py +4606 -0
  50. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/nine/part6.py +4518 -0
  51. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/nine/part7.py +4619 -0
  52. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/nine/part8.py +4495 -0
  53. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/nine/part9.py +4523 -0
  54. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/ten/__init__.py +0 -0
  55. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/ten/part1.py +4080 -0
  56. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/ten/part2.py +4968 -0
  57. s7commplus-0.1.0/s7commplus/session_auth/family0/_generated/ten/part3.py +5170 -0
  58. s7commplus-0.1.0/s7commplus/session_auth/family0/authenticator.py +168 -0
  59. s7commplus-0.1.0/s7commplus/session_auth/family0/big_int_operations.py +199 -0
  60. s7commplus-0.1.0/s7commplus/session_auth/family0/big_int_transforms.py +198 -0
  61. s7commplus-0.1.0/s7commplus/session_auth/family0/checksum_transform.py +80 -0
  62. s7commplus-0.1.0/s7commplus/session_auth/family0/fingerprint.py +134 -0
  63. s7commplus-0.1.0/s7commplus/session_auth/family0/key_derivation_transform.py +62 -0
  64. s7commplus-0.1.0/s7commplus/session_auth/family0/lut_generator.py +75 -0
  65. s7commplus-0.1.0/s7commplus/session_auth/family0/monolith_wrappers.py +101 -0
  66. s7commplus-0.1.0/s7commplus/session_auth/family0/pre_seed_transform.py +46 -0
  67. s7commplus-0.1.0/s7commplus/session_auth/family0/seed_transform.py +83 -0
  68. s7commplus-0.1.0/s7commplus/session_auth/family0/transform12.py +76 -0
  69. s7commplus-0.1.0/s7commplus/session_auth/family0/transform13.py +51 -0
  70. s7commplus-0.1.0/s7commplus/session_auth/family0/transform7.py +149 -0
  71. s7commplus-0.1.0/s7commplus/session_auth/harpo_aes.py +59 -0
  72. s7commplus-0.1.0/s7commplus/session_auth/harpo_aes_ctr.py +255 -0
  73. s7commplus-0.1.0/s7commplus/session_auth/harpo_hash.py +220 -0
  74. s7commplus-0.1.0/s7commplus/session_auth/key_derivation.py +129 -0
  75. s7commplus-0.1.0/s7commplus/session_auth/keys.py +205 -0
  76. s7commplus-0.1.0/s7commplus/session_auth/legacy_auth.py +48 -0
  77. s7commplus-0.1.0/s7commplus/session_auth/legitimate.py +97 -0
  78. s7commplus-0.1.0/s7commplus/session_auth/utils.py +42 -0
  79. s7commplus-0.1.0/s7commplus/subscription.py +285 -0
  80. s7commplus-0.1.0/s7commplus/tag_browser.py +358 -0
  81. s7commplus-0.1.0/s7commplus/transport.py +542 -0
  82. s7commplus-0.1.0/s7commplus/typeinfo.py +809 -0
  83. s7commplus-0.1.0/s7commplus/vlq.py +338 -0
  84. s7commplus-0.1.0/s7commplus/zlib_dicts/1398a37f_CompilerSettings_90000001.xml +1 -0
  85. s7commplus-0.1.0/s7commplus/zlib_dicts/1bac39f0_DebugInfo_90000001.xml +1 -0
  86. s7commplus-0.1.0/s7commplus/zlib_dicts/3c55436a_LineComm_98000001.xml +1 -0
  87. s7commplus-0.1.0/s7commplus/zlib_dicts/4b8416f0_IntfDesc_90000001.xml +1 -0
  88. s7commplus-0.1.0/s7commplus/zlib_dicts/5814b03b_IdentES_98000001.xml +1 -0
  89. s7commplus-0.1.0/s7commplus/zlib_dicts/66052b13_DebugInfo_IntfDesc_98000001.xml +1 -0
  90. s7commplus-0.1.0/s7commplus/zlib_dicts/79b2bda3_LineComm_90000001.xml +1 -0
  91. s7commplus-0.1.0/s7commplus/zlib_dicts/81d8db20_IdentES_90000002.xml +1 -0
  92. s7commplus-0.1.0/s7commplus/zlib_dicts/845fc605_NWT_98000001.xml +1 -0
  93. s7commplus-0.1.0/s7commplus/zlib_dicts/9b6a3a92_ExtRefData_90000001.xml +1 -0
  94. s7commplus-0.1.0/s7commplus/zlib_dicts/__init__.py +28 -0
  95. s7commplus-0.1.0/s7commplus/zlib_dicts/ab6fa31e_NWC_90000001.xml +1 -0
  96. s7commplus-0.1.0/s7commplus/zlib_dicts/b0155ff8_IntRefData_98000001.xml +1 -0
  97. s7commplus-0.1.0/s7commplus/zlib_dicts/c5d26ac3_NWC_98000001.xml +1 -0
  98. s7commplus-0.1.0/s7commplus/zlib_dicts/ce9b821b_IntfDescTag_90000001.xml +1 -0
  99. s7commplus-0.1.0/s7commplus/zlib_dicts/da4a88f4_IntRefData_90000001.xml +1 -0
  100. s7commplus-0.1.0/s7commplus/zlib_dicts/df91b6bb_IdentES_90000001.xml +1 -0
  101. s7commplus-0.1.0/s7commplus/zlib_dicts/e2729ea1_TagLineComm_90000001.xml +1 -0
  102. s7commplus-0.1.0/s7commplus/zlib_dicts/efaeae49_BodyDesc_90000001.xml +1 -0
  103. s7commplus-0.1.0/s7commplus/zlib_dicts/fd69ac74_NWT_90000001.xml +1 -0
  104. s7commplus-0.1.0/s7commplus.egg-info/PKG-INFO +90 -0
  105. s7commplus-0.1.0/s7commplus.egg-info/SOURCES.txt +139 -0
  106. s7commplus-0.1.0/s7commplus.egg-info/dependency_links.txt +1 -0
  107. s7commplus-0.1.0/s7commplus.egg-info/requires.txt +14 -0
  108. s7commplus-0.1.0/s7commplus.egg-info/top_level.txt +1 -0
  109. s7commplus-0.1.0/setup.cfg +4 -0
  110. s7commplus-0.1.0/tests/test_blob_decompressor.py +71 -0
  111. s7commplus-0.1.0/tests/test_real_plc_support.py +74 -0
  112. s7commplus-0.1.0/tests/test_s7_alarm.py +224 -0
  113. s7commplus-0.1.0/tests/test_s7_codec.py +765 -0
  114. s7commplus-0.1.0/tests/test_s7_e2e.py +628 -0
  115. s7commplus-0.1.0/tests/test_s7_family_key_fallback.py +212 -0
  116. s7commplus-0.1.0/tests/test_s7_legacy_request_layout.py +71 -0
  117. s7commplus-0.1.0/tests/test_s7_server.py +669 -0
  118. s7commplus-0.1.0/tests/test_s7_subscription.py +220 -0
  119. s7commplus-0.1.0/tests/test_s7_symbolic_multi_errors.py +63 -0
  120. s7commplus-0.1.0/tests/test_s7_tag_catalog.py +163 -0
  121. s7commplus-0.1.0/tests/test_s7_tls.py +445 -0
  122. s7commplus-0.1.0/tests/test_s7_unit.py +914 -0
  123. s7commplus-0.1.0/tests/test_s7_v2.py +1721 -0
  124. s7commplus-0.1.0/tests/test_s7_vlq.py +161 -0
  125. s7commplus-0.1.0/tests/test_s7_write_types.py +114 -0
  126. s7commplus-0.1.0/tests/test_session_auth.py +126 -0
  127. s7commplus-0.1.0/tests/test_session_auth_artifacts.py +34 -0
  128. s7commplus-0.1.0/tests/test_session_auth_blob_metadata.py +134 -0
  129. s7commplus-0.1.0/tests/test_session_auth_family0_big_int.py +73 -0
  130. s7commplus-0.1.0/tests/test_session_auth_family0_big_int_transforms.py +65 -0
  131. s7commplus-0.1.0/tests/test_session_auth_family0_monoliths.py +86 -0
  132. s7commplus-0.1.0/tests/test_session_auth_family0_transforms.py +60 -0
  133. s7commplus-0.1.0/tests/test_session_auth_harpo_aes.py +53 -0
  134. s7commplus-0.1.0/tests/test_session_auth_harpo_aes_ctr.py +117 -0
  135. s7commplus-0.1.0/tests/test_session_auth_harpo_hash.py +131 -0
  136. s7commplus-0.1.0/tests/test_session_auth_key_derivation.py +63 -0
  137. s7commplus-0.1.0/tests/test_session_auth_legacy_auth.py +182 -0
  138. s7commplus-0.1.0/tests/test_session_auth_legitimate.py +279 -0
  139. s7commplus-0.1.0/tests/test_session_auth_utils.py +81 -0
  140. s7commplus-0.1.0/tests/test_tag_browser.py +273 -0
  141. s7commplus-0.1.0/tests/test_typeinfo.py +616 -0
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2013 Gijs Molenaar, Stephan Preeker
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,90 @@
1
+ Metadata-Version: 2.4
2
+ Name: s7commplus
3
+ Version: 0.1.0
4
+ Summary: Pure Python S7CommPlus client and server emulator for Siemens S7-1200/1500 PLCs
5
+ Author-email: Gijs Molenaar <gijsmolenaar@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/gijzelaerr/s7commplus
8
+ Project-URL: Repository, https://github.com/gijzelaerr/s7commplus
9
+ Project-URL: Issues, https://github.com/gijzelaerr/s7commplus/issues
10
+ Project-URL: Documentation, https://s7commplus.readthedocs.io/
11
+ Keywords: s7commplus,s7,siemens,plc,industrial-automation
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: Manufacturing
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3.14
22
+ Classifier: Topic :: System :: Hardware
23
+ Requires-Python: >=3.10
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ License-File: s7commplus/session_auth/LICENSE-HarpoS7
27
+ Requires-Dist: cryptography>=41
28
+ Provides-Extra: test
29
+ Requires-Dist: pytest; extra == "test"
30
+ Requires-Dist: pytest-asyncio; extra == "test"
31
+ Requires-Dist: pytest-bdd<9,>=8.1; extra == "test"
32
+ Requires-Dist: pytest-cov; extra == "test"
33
+ Requires-Dist: hypothesis; extra == "test"
34
+ Requires-Dist: mypy; extra == "test"
35
+ Requires-Dist: ruff; extra == "test"
36
+ Provides-Extra: docs
37
+ Requires-Dist: sphinx>=7.2; extra == "docs"
38
+ Requires-Dist: furo>=2024.8.6; extra == "docs"
39
+ Dynamic: license-file
40
+
41
+ # s7commplus
42
+
43
+ Pure-Python S7CommPlus communication for Siemens S7-1200 and S7-1500 PLCs.
44
+ It supports S7CommPlus V1, V2 (TLS), and V3; synchronous and asyncio clients;
45
+ and a server emulator for testing. The synchronous client additionally supports
46
+ legacy V1 SessionKey authentication; the asyncio client rejects that path
47
+ during connection with an actionable error.
48
+
49
+ ```bash
50
+ pip install s7commplus
51
+ ```
52
+
53
+ ```python
54
+ from s7commplus import Client
55
+
56
+ with Client() as client:
57
+ client.connect("192.168.1.10", 0, 1)
58
+ data = client.db_read(1, 0, 4)
59
+ ```
60
+
61
+ S7CommPlus is used by newer S7-1200/1500 PLCs when classic PUT/GET access is
62
+ disabled. This is an unofficial implementation and is not affiliated with,
63
+ endorsed by, or supported by Siemens AG. Test against an isolated controller
64
+ before using it in production or safety-relevant environments.
65
+
66
+ Some older PLCs advertise only their SessionKey family instead of a complete
67
+ public-key fingerprint. The synchronous `Client` tries the bounded set of
68
+ bundled keys from that family on fresh sessions and caches the confirmed key
69
+ for the PLC. Set `allow_legacy_key_fallback=False` on `connect()` when key
70
+ probing must be disabled.
71
+
72
+ ## Development
73
+
74
+ ```bash
75
+ python -m pip install -e '.[test]'
76
+ pytest
77
+ mypy s7commplus
78
+ ruff check s7commplus tests
79
+ ruff format --check s7commplus tests
80
+ ```
81
+
82
+ Documentation is built by Read the Docs and validated in CI:
83
+
84
+ ```bash
85
+ python -m pip install -e '.[docs]'
86
+ sphinx-build -W --keep-going -b html docs docs/_build/html
87
+ ```
88
+
89
+ The session-authentication implementation derives from HarpoS7; its MIT
90
+ license is included at `s7commplus/session_auth/LICENSE-HarpoS7`.
@@ -0,0 +1,50 @@
1
+ # s7commplus
2
+
3
+ Pure-Python S7CommPlus communication for Siemens S7-1200 and S7-1500 PLCs.
4
+ It supports S7CommPlus V1, V2 (TLS), and V3; synchronous and asyncio clients;
5
+ and a server emulator for testing. The synchronous client additionally supports
6
+ legacy V1 SessionKey authentication; the asyncio client rejects that path
7
+ during connection with an actionable error.
8
+
9
+ ```bash
10
+ pip install s7commplus
11
+ ```
12
+
13
+ ```python
14
+ from s7commplus import Client
15
+
16
+ with Client() as client:
17
+ client.connect("192.168.1.10", 0, 1)
18
+ data = client.db_read(1, 0, 4)
19
+ ```
20
+
21
+ S7CommPlus is used by newer S7-1200/1500 PLCs when classic PUT/GET access is
22
+ disabled. This is an unofficial implementation and is not affiliated with,
23
+ endorsed by, or supported by Siemens AG. Test against an isolated controller
24
+ before using it in production or safety-relevant environments.
25
+
26
+ Some older PLCs advertise only their SessionKey family instead of a complete
27
+ public-key fingerprint. The synchronous `Client` tries the bounded set of
28
+ bundled keys from that family on fresh sessions and caches the confirmed key
29
+ for the PLC. Set `allow_legacy_key_fallback=False` on `connect()` when key
30
+ probing must be disabled.
31
+
32
+ ## Development
33
+
34
+ ```bash
35
+ python -m pip install -e '.[test]'
36
+ pytest
37
+ mypy s7commplus
38
+ ruff check s7commplus tests
39
+ ruff format --check s7commplus tests
40
+ ```
41
+
42
+ Documentation is built by Read the Docs and validated in CI:
43
+
44
+ ```bash
45
+ python -m pip install -e '.[docs]'
46
+ sphinx-build -W --keep-going -b html docs docs/_build/html
47
+ ```
48
+
49
+ The session-authentication implementation derives from HarpoS7; its MIT
50
+ license is included at `s7commplus/session_auth/LICENSE-HarpoS7`.
@@ -0,0 +1,80 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "s7commplus"
7
+ version = "0.1.0"
8
+ description = "Pure Python S7CommPlus client and server emulator for Siemens S7-1200/1500 PLCs"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "MIT"
12
+ license-files = ["LICENSE", "s7commplus/session_auth/LICENSE-HarpoS7"]
13
+ authors = [{name = "Gijs Molenaar", email = "gijsmolenaar@gmail.com"}]
14
+ keywords = ["s7commplus", "s7", "siemens", "plc", "industrial-automation"]
15
+ classifiers = [
16
+ "Development Status :: 4 - Beta",
17
+ "Intended Audience :: Developers",
18
+ "Intended Audience :: Manufacturing",
19
+ "Operating System :: OS Independent",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3.10",
22
+ "Programming Language :: Python :: 3.11",
23
+ "Programming Language :: Python :: 3.12",
24
+ "Programming Language :: Python :: 3.13",
25
+ "Programming Language :: Python :: 3.14",
26
+ "Topic :: System :: Hardware",
27
+ ]
28
+ dependencies = ["cryptography>=41"]
29
+
30
+ [project.optional-dependencies]
31
+ test = ["pytest", "pytest-asyncio", "pytest-bdd>=8.1,<9", "pytest-cov", "hypothesis", "mypy", "ruff"]
32
+ docs = ["sphinx>=7.2", "furo>=2024.8.6"]
33
+
34
+ [project.urls]
35
+ Homepage = "https://github.com/gijzelaerr/s7commplus"
36
+ Repository = "https://github.com/gijzelaerr/s7commplus"
37
+ Issues = "https://github.com/gijzelaerr/s7commplus/issues"
38
+ Documentation = "https://s7commplus.readthedocs.io/"
39
+
40
+ [tool.setuptools.package-data]
41
+ s7commplus = [
42
+ "py.typed",
43
+ "session_auth/**/*.bin",
44
+ "session_auth/ARCHITECTURE.md",
45
+ "session_auth/LICENSE-HarpoS7",
46
+ "session_auth/artifacts.json",
47
+ "zlib_dicts/*.xml",
48
+ ]
49
+
50
+ [tool.setuptools.packages.find]
51
+ include = ["s7commplus*"]
52
+
53
+ [[tool.uv.index]]
54
+ name = "pypi"
55
+ url = "https://pypi.org/simple"
56
+
57
+ [tool.pytest.ini_options]
58
+ testpaths = ["tests"]
59
+ pythonpath = ["."]
60
+ asyncio_mode = "auto"
61
+ markers = [
62
+ "conformance: protocol conformance tests",
63
+ "e2e: end-to-end tests requiring a real PLC connection",
64
+ "real_plc: versioned real-PLC acceptance scenario",
65
+ "smoke: read-only real-PLC acceptance scenario",
66
+ "write: real-PLC scenario that changes and restores scratch data",
67
+ "plc_write: existing real-PLC test that modifies scratch data",
68
+ "administrative: disruptive real-PLC scenario requiring separate opt-in",
69
+ ]
70
+
71
+ [tool.mypy]
72
+ strict = true
73
+ ignore_missing_imports = true
74
+
75
+ [tool.ruff]
76
+ line-length = 130
77
+ target-version = "py310"
78
+
79
+ [tool.ruff.lint]
80
+ select = ["E4", "E7", "E9", "F"]
@@ -0,0 +1,64 @@
1
+ """S7CommPlus protocol client for S7-1200/1500 PLCs.
2
+
3
+ Pure Python implementation of the S7CommPlus protocol for direct
4
+ communication with Siemens S7-1200 and S7-1500 PLCs. For legacy
5
+ S7-300/400 PLCs, use ``snap7.Client`` instead.
6
+
7
+ Usage::
8
+
9
+ from s7commplus import Client
10
+
11
+ client = Client()
12
+ client.connect("192.168.1.10")
13
+ data = client.db_read(1, 0, 4)
14
+ """
15
+
16
+ from .async_client import S7CommPlusAsyncClient as AsyncClient
17
+ from .alarm import Alarm, AlarmNotification, AlarmText, LanguageId
18
+ from .blob_decompressor import decompress_blob, find_and_decompress
19
+ from .catalog import ArrayDimension, SymbolCatalog, SymbolicTag, TagResult
20
+ from .client import DBWriteItem, SymbolicReadItem
21
+ from .client import S7CommPlusClient as Client
22
+ from .connection import S7CommPlusConnection
23
+ from .server import CPUState, DataBlock
24
+ from .server import S7CommPlusServer as Server
25
+ from .subscription import SubscriptionItem, SubscriptionNotification
26
+ from .tag_browser import (
27
+ DataBlock as ExploreDataBlock,
28
+ )
29
+ from .tag_browser import (
30
+ Member,
31
+ Tag,
32
+ block_interface_from_explore,
33
+ datablocks_from_explore,
34
+ tags_from_explore,
35
+ )
36
+
37
+ __all__ = [
38
+ "Alarm",
39
+ "AlarmNotification",
40
+ "AlarmText",
41
+ "ArrayDimension",
42
+ "AsyncClient",
43
+ "CPUState",
44
+ "Client",
45
+ "DBWriteItem",
46
+ "DataBlock",
47
+ "ExploreDataBlock",
48
+ "LanguageId",
49
+ "Member",
50
+ "S7CommPlusConnection",
51
+ "Server",
52
+ "SubscriptionItem",
53
+ "SubscriptionNotification",
54
+ "SymbolCatalog",
55
+ "SymbolicReadItem",
56
+ "SymbolicTag",
57
+ "Tag",
58
+ "TagResult",
59
+ "block_interface_from_explore",
60
+ "datablocks_from_explore",
61
+ "decompress_blob",
62
+ "find_and_decompress",
63
+ "tags_from_explore",
64
+ ]