python-snap7 3.1.2__py3-none-any.whl → 3.2.1__py3-none-any.whl

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.
@@ -0,0 +1,107 @@
1
+ Metadata-Version: 2.4
2
+ Name: python-snap7
3
+ Version: 3.2.1
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-bdd<9,>=8.1; extra == "test"
28
+ Requires-Dist: pytest-cov; extra == "test"
29
+ Requires-Dist: pytest-html; extra == "test"
30
+ Requires-Dist: hypothesis; extra == "test"
31
+ Requires-Dist: mypy; extra == "test"
32
+ Requires-Dist: types-setuptools; extra == "test"
33
+ Requires-Dist: ruff; extra == "test"
34
+ Requires-Dist: tox; extra == "test"
35
+ Requires-Dist: tox-uv; extra == "test"
36
+ Requires-Dist: types-click; extra == "test"
37
+ Requires-Dist: uv; extra == "test"
38
+ Provides-Extra: cli
39
+ Requires-Dist: rich; extra == "cli"
40
+ Requires-Dist: click; extra == "cli"
41
+ Provides-Extra: demo
42
+ Requires-Dist: psutil; extra == "demo"
43
+ Requires-Dist: rich; extra == "demo"
44
+ Requires-Dist: click; extra == "demo"
45
+ Provides-Extra: doc
46
+ Requires-Dist: sphinx; extra == "doc"
47
+ Requires-Dist: sphinx_rtd_theme; extra == "doc"
48
+ Provides-Extra: discovery
49
+ Requires-Dist: pnio-dcp; extra == "discovery"
50
+ Provides-Extra: ppi
51
+ Requires-Dist: pyserial>=3.5; extra == "ppi"
52
+ Dynamic: license-file
53
+
54
+ .. image:: https://img.shields.io/pypi/v/python-snap7.svg
55
+ :target: https://pypi.org/project/python-snap7/
56
+
57
+ .. image:: https://img.shields.io/pypi/pyversions/python-snap7.svg
58
+ :target: https://pypi.org/project/python-snap7/
59
+
60
+ .. image:: https://img.shields.io/github/license/gijzelaerr/python-snap7.svg
61
+ :target: https://github.com/gijzelaerr/python-snap7/blob/master/LICENSE
62
+
63
+ .. image:: https://github.com/gijzelaerr/python-snap7/actions/workflows/test.yml/badge.svg
64
+ :target: https://github.com/gijzelaerr/python-snap7/actions/workflows/test.yml
65
+
66
+ .. image:: https://readthedocs.org/projects/python-snap7/badge/
67
+ :target: https://python-snap7.readthedocs.io/en/latest/
68
+
69
+
70
+ python-snap7
71
+ ============
72
+
73
+ python-snap7 is a pure-Python library for communicating with Siemens S7 PLCs
74
+ using the classic S7 protocol. It supports S7-300 and S7-400 controllers, as
75
+ well as S7-1200 and S7-1500 controllers with PUT/GET access enabled. It
76
+ supports Python 3.10+ on Windows, Linux, and macOS without native dependencies.
77
+
78
+ Installation
79
+ ============
80
+
81
+ Install from PyPI::
82
+
83
+ pip install python-snap7
84
+
85
+ Quick start
86
+ ===========
87
+
88
+ ::
89
+
90
+ from s7 import Client
91
+
92
+ client = Client()
93
+ client.connect("192.168.1.10", 0, 1)
94
+ data = client.db_read(1, 0, 4)
95
+ client.disconnect()
96
+
97
+ The ``s7`` package is the recommended import. The ``snap7`` package name is
98
+ also available for backwards compatibility.
99
+
100
+ Documentation
101
+ =============
102
+
103
+ Read the full documentation at
104
+ `python-snap7.readthedocs.io <https://python-snap7.readthedocs.io/en/latest/>`_.
105
+
106
+ The safe volunteer hardware-test procedure is in
107
+ `Real-PLC acceptance testing <doc/real-plc-testing.rst>`_.
@@ -0,0 +1,34 @@
1
+ python_snap7-3.2.1.dist-info/licenses/LICENSE,sha256=PIihE_yP-8gc-ff9ikvQQPOa0biOCZ6Bc-6h3G3xRUQ,1097
2
+ s7/__init__.py,sha256=q6E4rA1BDx36PPkJS55xv7XCxwlaQeEK6HNotFjLeYo,1096
3
+ snap7/__init__.py,sha256=2NAAE1oaSSd7DqPl0dx7jNXtsM2PRBWRm9X-bkmgC6U,1275
4
+ snap7/async_client.py,sha256=yPyqzD4WH3544hKV4aDHt48r8LSWKsbFcVBZxtQOcYQ,52571
5
+ snap7/cli.py,sha256=L1B7NMAemDcl93JUSqJV3Ls_CN2ghlG75nTMD08JkMs,13787
6
+ snap7/client.py,sha256=MWnqsxjjdSSAloluSqAXtmfpokyJEKezJj77e_SqR6I,107985
7
+ snap7/client_base.py,sha256=tNZs_MA8FGit8pg9axNoljH1kFToDI1HIzXC8WQLYHs,11324
8
+ snap7/connection.py,sha256=Qjis-ICK6E74_YfoJuy2_lgDqfSYs4ULux1FShJVvtw,18834
9
+ snap7/datatypes.py,sha256=Gqu1XDuKkQI76n4TYrFrhm0RlPz4XNA5GKA-GJJXJDU,12042
10
+ snap7/demo.py,sha256=JWSKLj2QPIXeSFTZSXuADAJzWVKls712MUZnuqwNkNs,17376
11
+ snap7/discovery.py,sha256=LONPYg83b2quKXht6y_GTTArdxitjD8DoGyaHfe9B1w,3964
12
+ snap7/error.py,sha256=S5BquFFSL1NpgdytIpOD_FzhN6gOCngSkxJVZT4rxdw,21323
13
+ snap7/log.py,sha256=XX4UyPgByz3EhTc39BTGY454fHvYmiJAX4v-a-gkIEY,4968
14
+ snap7/logo.py,sha256=0h-EZ5K86Qddna_lryBn6xLXLVwnznYJuMGuevzH6bI,9192
15
+ snap7/optimizer.py,sha256=Bu4zWCfdeA5GG3sWwjYOLkp0tWEfNbAXvbe_RldlYVM,9383
16
+ snap7/partner.py,sha256=HxaTYfojsf5Z170R4cAYFzoMSwqCOF42qPCkOaxbUkU,37916
17
+ snap7/ppi.py,sha256=p0fVelfUQOT3QH5uuWOjpDxA5IyT3gx5FzCMaYYEuWQ,16070
18
+ snap7/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
+ snap7/rate_limiter.py,sha256=dnXCOJLWmszo8oskbFM0om0gPC4LHHCOr-Nt22tImeU,4151
20
+ snap7/s7protocol.py,sha256=BLuI6h3Cfbr4R55-v20fYMlKCY6ASbtxdJOC5T0JyaI,69396
21
+ snap7/szl.py,sha256=a9NhH7Lyp8SXJ2_kvyyV-14srIxm3tXnAnclBy5alDk,7998
22
+ snap7/tags.py,sha256=TmbNRHNWZVe3Yl_1L5WXE3Qb0lxIEW-veoCRGt0giZQ,26987
23
+ snap7/type.py,sha256=EiXqU0ayYYxlM-5fUcPL7psgL1EGNNqAa7JXH4QlAnU,9752
24
+ snap7/server/__init__.py,sha256=0XqMGlqblhVNmILT_Ddm-yxTw1r19bfFrr-VuPLEDnI,112468
25
+ snap7/server/__main__.py,sha256=OdOgyMmFThjSe2jSgvlbkquGYnZcBW6wubs2ldhNSOE,1206
26
+ snap7/util/__init__.py,sha256=d6n2oy7tNYke1ia0TUyWz_ni3l0XN1qvilM5sW0T-Es,1874
27
+ snap7/util/db.py,sha256=geesYS2oyOuTADOJa2me1p1rqJVzPuLTCfye6JIeav0,27120
28
+ snap7/util/getters.py,sha256=pMsiCz0soMV7Q-VDPBdFG5eHzcFESZtKPw6mxj4S5ko,25370
29
+ snap7/util/setters.py,sha256=BpFqVxxUbhqarV6Gzt4ZuxycHljtDYsONCr6e9G33Ms,27226
30
+ python_snap7-3.2.1.dist-info/METADATA,sha256=-oAcJHaF7AZL-10-rfF1c73I5E-JElaLi-azSxq76zg,3662
31
+ python_snap7-3.2.1.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
32
+ python_snap7-3.2.1.dist-info/entry_points.txt,sha256=IPZyYr1lKyavXXpAc4xO505afTGwTY8GmNFuy5lsSiM,75
33
+ python_snap7-3.2.1.dist-info/top_level.txt,sha256=PTgDoDG45QNL2XIE9RM7S_ZCdWQjtMMuXNyrI2UdnbU,9
34
+ python_snap7-3.2.1.dist-info/RECORD,,
s7/__init__.py ADDED
@@ -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
snap7/__init__.py CHANGED
@@ -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",