python-snap7 3.0.0__py3-none-any.whl → 3.1.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-snap7
3
- Version: 3.0.0
3
+ Version: 3.1.0
4
4
  Summary: Pure Python S7 communication library for Siemens PLCs
5
5
  Author-email: Gijs Molenaar <gijsmolenaar@gmail.com>
6
6
  License: MIT
@@ -23,8 +23,10 @@ Description-Content-Type: text/x-rst
23
23
  License-File: LICENSE
24
24
  Provides-Extra: test
25
25
  Requires-Dist: pytest; extra == "test"
26
+ Requires-Dist: pytest-asyncio; extra == "test"
26
27
  Requires-Dist: pytest-cov; extra == "test"
27
28
  Requires-Dist: pytest-html; extra == "test"
29
+ Requires-Dist: hypothesis; extra == "test"
28
30
  Requires-Dist: mypy; extra == "test"
29
31
  Requires-Dist: types-setuptools; extra == "test"
30
32
  Requires-Dist: ruff; extra == "test"
@@ -35,9 +37,15 @@ Requires-Dist: uv; extra == "test"
35
37
  Provides-Extra: cli
36
38
  Requires-Dist: rich; extra == "cli"
37
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"
38
44
  Provides-Extra: doc
39
45
  Requires-Dist: sphinx; extra == "doc"
40
46
  Requires-Dist: sphinx_rtd_theme; extra == "doc"
47
+ Provides-Extra: discovery
48
+ Requires-Dist: pnio-dcp; extra == "discovery"
41
49
  Dynamic: license-file
42
50
 
43
51
  About
@@ -54,34 +62,63 @@ Python-snap7 is tested with Python 3.10+, on Windows, Linux and OS X.
54
62
  The full documentation is available on `Read The Docs <https://python-snap7.readthedocs.io/en/latest/>`_.
55
63
 
56
64
 
57
- Version 3.0 - Pure Python Rewrite
58
- ==================================
65
+ Quick Start
66
+ ===========
59
67
 
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.
68
+ Connect to any S7 PLC::
64
69
 
65
- **Why this matters:**
70
+ import snap7
66
71
 
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.
72
+ client = snap7.Client()
73
+ client.connect("192.168.1.10", 0, 1)
74
+ data = client.db_read(1, 0, 4)
75
+ client.disconnect()
76
+
77
+ No native libraries or platform-specific dependencies are required.
78
+
79
+ Async support::
80
+
81
+ import asyncio
82
+ import snap7
83
+
84
+ async def main():
85
+ async with snap7.AsyncClient() as client:
86
+ await client.connect("192.168.1.10", 0, 1)
87
+ data = await client.db_read(1, 0, 4)
73
88
 
74
- **If you experience issues with 3.0:**
89
+ asyncio.run(main())
75
90
 
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
91
 
81
- $ pip install "python-snap7<3"
92
+ What's New in 3.1
93
+ =================
82
94
 
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/>`_.
95
+ * **AsyncClient** for ``asyncio`` support
96
+ * **Tag API** -- read/write by name: ``client.read_tag("DB1.DBD0:REAL")``
97
+ with PLC4X and nodeS7 dialect support
98
+ * **Multi-variable read optimizer** -- merges scattered reads into minimal
99
+ PDU exchanges
100
+ * **S7 routing** -- connect to PLCs on remote subnets via a gateway PLC
101
+ * **Heartbeat monitoring** and auto-reconnect with exponential backoff
102
+ * **Structured logging** with PLC connection context
103
+ * **PROFINET DCP** network discovery
104
+ * **CLI tools** for PLC interaction (``pip install "python-snap7[cli]"``)
105
+ * Numerous bug fixes -- see `CHANGES.md <https://github.com/gijzelaerr/python-snap7/blob/master/CHANGES.md>`_
106
+ for the full list
107
+
108
+
109
+ Version 3.0 -- Pure Python Rewrite
110
+ ====================================
111
+
112
+ Version 3.0 was a ground-up rewrite of python-snap7. The library no longer wraps
113
+ the C snap7 shared library -- instead, the entire S7 protocol stack (TPKT, COTP,
114
+ and S7) is implemented in pure Python.
115
+
116
+ * **Portability**: No more platform-specific shared libraries (``.dll``, ``.so``, ``.dylib``).
117
+ Works on any platform that runs Python -- including ARM, Alpine Linux, and other
118
+ environments where the C library was difficult or impossible to install.
119
+ * **Easier installation**: Just ``pip install python-snap7``. No native dependencies,
120
+ no compiler toolchains, no manual library setup.
121
+ * **Easier to extend**: New features and protocol support can be added directly in Python.
85
122
 
86
123
 
87
124
  Installation
@@ -0,0 +1,32 @@
1
+ python_snap7-3.1.0.dist-info/licenses/LICENSE,sha256=PIihE_yP-8gc-ff9ikvQQPOa0biOCZ6Bc-6h3G3xRUQ,1097
2
+ snap7/__init__.py,sha256=jWGpca2kG7gskQbcM5qoflWEyMMEJ7655kM0KxVVLaA,980
3
+ snap7/async_client.py,sha256=IIWtZ1nwblUZY1Zn0zyLmVQUnp33K0cxl8xVu887Fgs,43911
4
+ snap7/cli.py,sha256=Td7z1O0gV7t-w9umUaX91MHGw-HuXYEDHKgtUO-9d3Q,13755
5
+ snap7/client.py,sha256=ZKDM20dZ55EP-kEyncqjdq8oxB7M5ckgXtKrmFsN8Iw,95429
6
+ snap7/client_base.py,sha256=2fKWy7eczyr-tdGQswH_USTdDdeIrdyTTQ_1F8LRAyU,7435
7
+ snap7/connection.py,sha256=Aeo5ckyFEUR5cpJO88LZENzGitdKlkWdx7LB2tyQkXA,17643
8
+ snap7/datatypes.py,sha256=zJgPasEV79_H4qHabivIxYX50j74pNg64apBppAKI2Y,11205
9
+ snap7/demo.py,sha256=JWSKLj2QPIXeSFTZSXuADAJzWVKls712MUZnuqwNkNs,17376
10
+ snap7/discovery.py,sha256=LONPYg83b2quKXht6y_GTTArdxitjD8DoGyaHfe9B1w,3964
11
+ snap7/error.py,sha256=ToGa85aJ64lwdM5gPweqPZJD7xrgFSw2NK36VOYmXUg,21210
12
+ snap7/log.py,sha256=XX4UyPgByz3EhTc39BTGY454fHvYmiJAX4v-a-gkIEY,4968
13
+ snap7/logo.py,sha256=lFhHELR8r3OAPRnJ_3crE0LpPxzBM2Qn5goD77HlskU,7084
14
+ snap7/optimizer.py,sha256=Bu4zWCfdeA5GG3sWwjYOLkp0tWEfNbAXvbe_RldlYVM,9383
15
+ snap7/partner.py,sha256=HxaTYfojsf5Z170R4cAYFzoMSwqCOF42qPCkOaxbUkU,37916
16
+ snap7/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
+ snap7/s7protocol.py,sha256=a-obZR5fLzHS1wHpZ88N37XxzYjKiS2JgK8SFi5qTjQ,57360
18
+ snap7/szl.py,sha256=VPKNz8MCU7ok_Run-JVuwHKJSeGY-Wcj93SJu56tgtw,3898
19
+ snap7/tags.py,sha256=Qh8dm6rDWcVnYhbSB_htrmqIAXsmWQWcDS8-wXqN_zE,27033
20
+ snap7/type.py,sha256=-ad6v8vQP21DvWFtHCaSlk-BllFGPKOtbhprqKdOlJ0,9391
21
+ snap7/server/__init__.py,sha256=I4Tk3IwPjQLVokrp3lOgGLoTwLRTNY6mTrWGSOHOrAM,100283
22
+ snap7/server/__main__.py,sha256=OdOgyMmFThjSe2jSgvlbkquGYnZcBW6wubs2ldhNSOE,1206
23
+ snap7/util/__init__.py,sha256=d6n2oy7tNYke1ia0TUyWz_ni3l0XN1qvilM5sW0T-Es,1874
24
+ snap7/util/db.py,sha256=geesYS2oyOuTADOJa2me1p1rqJVzPuLTCfye6JIeav0,27120
25
+ snap7/util/getters.py,sha256=-rsgcczCYzc1Z_t98Q9_2LriQQipYji9T-VIsg_2lWs,24393
26
+ snap7/util/setters.py,sha256=wi8MrABiGbnsqSj1NYjK5aTtcRVS0NbAHQXP6lLjAVg,27454
27
+ snap7/util/symbols.py,sha256=L1dY7I1-HZ5Odtv6ZqGBeLppb3E5hjL64MyATT7XyEw,16454
28
+ python_snap7-3.1.0.dist-info/METADATA,sha256=TiHXRRAXn75UcFn9PpNAzDbXQmetvpYH0cDZ8Vvkogk,4652
29
+ python_snap7-3.1.0.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
30
+ python_snap7-3.1.0.dist-info/entry_points.txt,sha256=IPZyYr1lKyavXXpAc4xO505afTGwTY8GmNFuy5lsSiM,75
31
+ python_snap7-3.1.0.dist-info/top_level.txt,sha256=VpFXm1w5_73qgJEIN_5OzQWINHyYJBtNoOW4DMoizgw,6
32
+ python_snap7-3.1.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (82.0.1)
2
+ Generator: setuptools (83.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,2 +1,3 @@
1
1
  [console_scripts]
2
+ s7 = snap7.cli:main
2
3
  snap7-server = snap7.server:mainloop
snap7/__init__.py CHANGED
@@ -8,19 +8,30 @@ Siemens S7 PLCs without requiring the native Snap7 C library.
8
8
  from importlib.metadata import version, PackageNotFoundError
9
9
 
10
10
  from .client import Client
11
+ from .async_client import AsyncClient
11
12
  from .server import Server
12
13
  from .partner import Partner
13
14
  from .logo import Logo
14
15
  from .util.db import Row, DB
16
+ from .tags import NodeS7Tag, PLC4XTag, Tag, from_browse, load_csv, load_json, load_tia_xml, parse_tag
15
17
  from .type import Area, Block, WordLen, SrvEvent, SrvArea
16
18
 
17
19
  __all__ = [
18
20
  "Client",
21
+ "AsyncClient",
19
22
  "Server",
20
23
  "Partner",
21
24
  "Logo",
22
25
  "Row",
23
26
  "DB",
27
+ "Tag",
28
+ "PLC4XTag",
29
+ "NodeS7Tag",
30
+ "parse_tag",
31
+ "load_csv",
32
+ "load_json",
33
+ "load_tia_xml",
34
+ "from_browse",
24
35
  "Area",
25
36
  "Block",
26
37
  "WordLen",