plc-comm-kv-hostlink 2.0.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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 fa-yoshinobu
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, 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,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,2 @@
1
+ prune internal_docs
2
+ prune tests
@@ -0,0 +1,104 @@
1
+ Metadata-Version: 2.4
2
+ Name: plc-comm-kv-hostlink
3
+ Version: 2.0.0
4
+ Summary: Python library for KEYENCE KV series Host Link (Upper Link) communication.
5
+ Author: fa-yoshinobu
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/fa-yoshinobu/plc-comm-hostlink-python
8
+ Project-URL: Repository, https://github.com/fa-yoshinobu/plc-comm-hostlink-python
9
+ Project-URL: Issues, https://github.com/fa-yoshinobu/plc-comm-hostlink-python/issues
10
+ Keywords: plc-comm,keyence,kv,hostlink,upper-link,plc,tcp,udp
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
+ Classifier: Topic :: System :: Networking
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Provides-Extra: dev
25
+ Requires-Dist: build>=1.2; extra == "dev"
26
+ Requires-Dist: mypy>=1.10; extra == "dev"
27
+ Requires-Dist: pre-commit>=3.7; extra == "dev"
28
+ Requires-Dist: pytest>=8.0; extra == "dev"
29
+ Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
30
+ Requires-Dist: pytest-cov>=5.0; extra == "dev"
31
+ Requires-Dist: ruff>=0.6; extra == "dev"
32
+ Requires-Dist: twine>=5.1; extra == "dev"
33
+ Dynamic: license-file
34
+
35
+ [![CI](https://github.com/fa-yoshinobu/plc-comm-hostlink-python/actions/workflows/test.yml/badge.svg)](https://github.com/fa-yoshinobu/plc-comm-hostlink-python/actions/workflows/test.yml)
36
+ [![PyPI](https://img.shields.io/pypi/v/plc-comm-kv-hostlink.svg)](https://pypi.org/project/plc-comm-kv-hostlink/)
37
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
38
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
39
+
40
+ # KEYENCE KV Host Link for Python
41
+
42
+ Python library for KEYENCE KV Host Link PLC communication.
43
+
44
+ ## PLC Comm Family
45
+
46
+ This library is part of the plc-comm family. See the [package matrix](https://fa-yoshinobu.github.io/plc-comm-docs-site/package-matrix/) for protocol, language, registry, and install-command mapping.
47
+
48
+ ## Supported PLC profiles
49
+
50
+ The maintained profile table is in [PLC profiles](docsrc/user/PROFILES.md). Choose one exact canonical PLC profile from that table.
51
+
52
+ ## Supported device types
53
+
54
+ The shared device and range tables are in the [KV Host Link Device Ranges](https://fa-yoshinobu.github.io/plc-comm-docs-site/plc-setup/kv/device-ranges/) page. Use that page for supported device families, address syntax, and profile-specific notes.
55
+
56
+ ## Installation
57
+
58
+ ```bash
59
+ pip install plc-comm-kv-hostlink
60
+ ```
61
+
62
+ ## Quick example
63
+
64
+ ```python
65
+ import asyncio
66
+ from hostlink import HostLinkConnectionOptions, device_range_catalog_for_plc_profile, open_and_connect, read_typed
67
+
68
+ async def main() -> None:
69
+ catalog = device_range_catalog_for_plc_profile("keyence:kv-7000")
70
+ options = HostLinkConnectionOptions(host="192.168.250.100", plc_profile="keyence:kv-8000", port=8501)
71
+ async with await open_and_connect(options) as client:
72
+ dm0 = await read_typed(client, "DM0", "U")
73
+ print(f"DM0 = {dm0}")
74
+
75
+ asyncio.run(main())
76
+ ```
77
+
78
+ ## Documentation
79
+
80
+ | Page | Use it for |
81
+ |---|---|
82
+ | [Full documentation site](https://fa-yoshinobu.github.io/plc-comm-docs-site/) | Unified docs for all PLC communication libraries. |
83
+ | [Getting started](docsrc/user/GETTING_STARTED.md) | Install the package, connect to your PLC, and run your first read/write. |
84
+ | [Usage guide](docsrc/user/USAGE_GUIDE.md) | Use the high-level API and common Host Link workflows. |
85
+ | [API reference](docsrc/user/API_REFERENCE.md) | Find public client methods, helpers, profile APIs, and error types. |
86
+ | [PLC profiles](docsrc/user/PROFILES.md) | Choose the canonical profile that matches your PLC model and device ranges. |
87
+ | [KV Host Link Device Ranges](https://fa-yoshinobu.github.io/plc-comm-docs-site/plc-setup/kv/device-ranges/) | Check shared device families, address notation, and range tables. |
88
+ | [KV Host Link Troubleshooting & Codes](https://fa-yoshinobu.github.io/plc-comm-docs-site/plc-setup/kv/troubleshooting-codes/) | Troubleshoot common port, profile, address, write-permission, and PLC error-code symptoms. |
89
+ | [Gotchas](docsrc/user/GOTCHAS.md) | Check whether this library has any current library-specific caveats. |
90
+ | [Examples](samples/README.md) | Run maintained Python samples: `samples/high_level_async.py`, `samples/high_level_sync.py`, `samples/basic_high_level_rw.py`, `samples/named_snapshot.py`, `samples/polling_monitor.py`. |
91
+
92
+ ## License and registry
93
+
94
+ | Item | Value |
95
+ | --- | --- |
96
+ | License | [MIT](LICENSE) |
97
+ | Registry | [PyPI](https://pypi.org/project/plc-comm-kv-hostlink/) |
98
+ | Package | `plc-comm-kv-hostlink` |
99
+
100
+ ## Commercial support
101
+
102
+ If you plan to embed this library in a paid or commercial product, please consider a separate support agreement or supporting the project as a sponsor.
103
+
104
+ Contact: <https://fa-labo.com/contact.html>
@@ -0,0 +1,70 @@
1
+ [![CI](https://github.com/fa-yoshinobu/plc-comm-hostlink-python/actions/workflows/test.yml/badge.svg)](https://github.com/fa-yoshinobu/plc-comm-hostlink-python/actions/workflows/test.yml)
2
+ [![PyPI](https://img.shields.io/pypi/v/plc-comm-kv-hostlink.svg)](https://pypi.org/project/plc-comm-kv-hostlink/)
3
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
5
+
6
+ # KEYENCE KV Host Link for Python
7
+
8
+ Python library for KEYENCE KV Host Link PLC communication.
9
+
10
+ ## PLC Comm Family
11
+
12
+ This library is part of the plc-comm family. See the [package matrix](https://fa-yoshinobu.github.io/plc-comm-docs-site/package-matrix/) for protocol, language, registry, and install-command mapping.
13
+
14
+ ## Supported PLC profiles
15
+
16
+ The maintained profile table is in [PLC profiles](docsrc/user/PROFILES.md). Choose one exact canonical PLC profile from that table.
17
+
18
+ ## Supported device types
19
+
20
+ The shared device and range tables are in the [KV Host Link Device Ranges](https://fa-yoshinobu.github.io/plc-comm-docs-site/plc-setup/kv/device-ranges/) page. Use that page for supported device families, address syntax, and profile-specific notes.
21
+
22
+ ## Installation
23
+
24
+ ```bash
25
+ pip install plc-comm-kv-hostlink
26
+ ```
27
+
28
+ ## Quick example
29
+
30
+ ```python
31
+ import asyncio
32
+ from hostlink import HostLinkConnectionOptions, device_range_catalog_for_plc_profile, open_and_connect, read_typed
33
+
34
+ async def main() -> None:
35
+ catalog = device_range_catalog_for_plc_profile("keyence:kv-7000")
36
+ options = HostLinkConnectionOptions(host="192.168.250.100", plc_profile="keyence:kv-8000", port=8501)
37
+ async with await open_and_connect(options) as client:
38
+ dm0 = await read_typed(client, "DM0", "U")
39
+ print(f"DM0 = {dm0}")
40
+
41
+ asyncio.run(main())
42
+ ```
43
+
44
+ ## Documentation
45
+
46
+ | Page | Use it for |
47
+ |---|---|
48
+ | [Full documentation site](https://fa-yoshinobu.github.io/plc-comm-docs-site/) | Unified docs for all PLC communication libraries. |
49
+ | [Getting started](docsrc/user/GETTING_STARTED.md) | Install the package, connect to your PLC, and run your first read/write. |
50
+ | [Usage guide](docsrc/user/USAGE_GUIDE.md) | Use the high-level API and common Host Link workflows. |
51
+ | [API reference](docsrc/user/API_REFERENCE.md) | Find public client methods, helpers, profile APIs, and error types. |
52
+ | [PLC profiles](docsrc/user/PROFILES.md) | Choose the canonical profile that matches your PLC model and device ranges. |
53
+ | [KV Host Link Device Ranges](https://fa-yoshinobu.github.io/plc-comm-docs-site/plc-setup/kv/device-ranges/) | Check shared device families, address notation, and range tables. |
54
+ | [KV Host Link Troubleshooting & Codes](https://fa-yoshinobu.github.io/plc-comm-docs-site/plc-setup/kv/troubleshooting-codes/) | Troubleshoot common port, profile, address, write-permission, and PLC error-code symptoms. |
55
+ | [Gotchas](docsrc/user/GOTCHAS.md) | Check whether this library has any current library-specific caveats. |
56
+ | [Examples](samples/README.md) | Run maintained Python samples: `samples/high_level_async.py`, `samples/high_level_sync.py`, `samples/basic_high_level_rw.py`, `samples/named_snapshot.py`, `samples/polling_monitor.py`. |
57
+
58
+ ## License and registry
59
+
60
+ | Item | Value |
61
+ | --- | --- |
62
+ | License | [MIT](LICENSE) |
63
+ | Registry | [PyPI](https://pypi.org/project/plc-comm-kv-hostlink/) |
64
+ | Package | `plc-comm-kv-hostlink` |
65
+
66
+ ## Commercial support
67
+
68
+ If you plan to embed this library in a paid or commercial product, please consider a separate support agreement or supporting the project as a sponsor.
69
+
70
+ Contact: <https://fa-labo.com/contact.html>
@@ -0,0 +1,96 @@
1
+ [build-system]
2
+ requires = ["setuptools>=69", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "plc-comm-kv-hostlink"
7
+ version = "2.0.0"
8
+ description = "Python library for KEYENCE KV series Host Link (Upper Link) communication."
9
+ authors = [{ name = "fa-yoshinobu" }]
10
+ license = "MIT"
11
+ requires-python = ">=3.10"
12
+ dependencies = []
13
+ readme = "README.md"
14
+
15
+ license-files = ["LICENSE"]
16
+ keywords = ["plc-comm", "keyence", "kv", "hostlink", "upper-link", "plc", "tcp", "udp"]
17
+ classifiers = [
18
+ "Development Status :: 5 - Production/Stable",
19
+ "Intended Audience :: Developers",
20
+ "Operating System :: OS Independent",
21
+ "Programming Language :: Python :: 3",
22
+ "Programming Language :: Python :: 3.10",
23
+ "Programming Language :: Python :: 3.11",
24
+ "Programming Language :: Python :: 3.12",
25
+ "Programming Language :: Python :: 3.13",
26
+ "Topic :: Software Development :: Libraries :: Python Modules",
27
+ "Topic :: System :: Networking",
28
+ ]
29
+
30
+ [project.urls]
31
+ Homepage = "https://github.com/fa-yoshinobu/plc-comm-hostlink-python"
32
+ Repository = "https://github.com/fa-yoshinobu/plc-comm-hostlink-python"
33
+ Issues = "https://github.com/fa-yoshinobu/plc-comm-hostlink-python/issues"
34
+
35
+ [project.optional-dependencies]
36
+ dev = [
37
+ "build>=1.2",
38
+ "mypy>=1.10",
39
+ "pre-commit>=3.7",
40
+ "pytest>=8.0",
41
+ "pytest-asyncio>=0.23",
42
+ "pytest-cov>=5.0",
43
+ "ruff>=0.6",
44
+ "twine>=5.1",
45
+ ]
46
+ [tool.setuptools]
47
+ package-dir = { "" = "src" }
48
+ packages = ["hostlink"]
49
+ include-package-data = true
50
+
51
+ [tool.setuptools.package-data]
52
+ "*" = ["py.typed"]
53
+
54
+ [tool.setuptools.exclude-package-data]
55
+ "*" = [
56
+ "TODO.md",
57
+ "internal_docs/*",
58
+ "internal_docs/**/*",
59
+ "tests/*",
60
+ "scripts/*",
61
+ "samples/*"
62
+ ]
63
+
64
+ [tool.pytest.ini_options]
65
+ testpaths = ["tests"]
66
+ pythonpath = ["src"]
67
+
68
+ [tool.ruff]
69
+ line-length = 120
70
+ target-version = "py310"
71
+ extend-exclude = ["dist"]
72
+
73
+ [tool.ruff.lint]
74
+ select = ["E", "F", "I", "B", "UP"]
75
+
76
+ [tool.mypy]
77
+ files = ["src/hostlink"]
78
+ warn_unused_configs = true
79
+ disallow_untyped_defs = true
80
+ check_untyped_defs = true
81
+ disallow_incomplete_defs = true
82
+ no_implicit_optional = true
83
+ warn_redundant_casts = true
84
+ warn_unused_ignores = true
85
+ warn_return_any = true
86
+ strict_equality = true
87
+
88
+ [tool.coverage.run]
89
+ source = ["hostlink"]
90
+ branch = true
91
+
92
+ [tool.coverage.report]
93
+ show_missing = true
94
+
95
+
96
+
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,135 @@
1
+ """KEYENCE KV Host Link communication library.
2
+
3
+ The user-facing surface of this package is the high-level helper API exported
4
+ from :mod:`hostlink.utils`:
5
+
6
+ - :func:`open_and_connect`
7
+ - :class:`HostLinkConnectionOptions`
8
+ - :class:`HostLinkAddress`
9
+ - :class:`TimerCounterValue`
10
+ - :func:`parse_address`
11
+ - :func:`try_parse_address`
12
+ - :func:`format_address`
13
+ - :func:`normalize_address`
14
+ - :func:`read_typed`
15
+ - :func:`read_timer_counter`
16
+ - :func:`read_timer`
17
+ - :func:`read_counter`
18
+ - :func:`write_typed`
19
+ - :func:`read_comments`
20
+ - :func:`read_words_single_request`
21
+ - :func:`read_dwords_single_request`
22
+ - :func:`read_words_chunked`
23
+ - :func:`read_dwords_chunked`
24
+ - :func:`read_expansion_unit_buffer`
25
+ - :func:`write_expansion_unit_buffer`
26
+ - :func:`write_bit_in_word`
27
+ - :func:`read_named`
28
+ - :func:`poll`
29
+
30
+ The low-level clients remain part of the package for advanced and maintainer
31
+ workflows, but the helpers above are the recommended entry points for normal
32
+ application code and generated user documentation.
33
+ """
34
+
35
+ __version__ = "2.0.0"
36
+
37
+ from .client import AsyncHostLinkClient, HostLinkClient, HostLinkTraceDirection, HostLinkTraceFrame, ModelInfo
38
+ from .device_ranges import (
39
+ KvDeviceRangeCatalog,
40
+ KvDeviceRangeCategory,
41
+ KvDeviceRangeEntry,
42
+ KvDeviceRangeNotation,
43
+ KvDeviceRangeSegment,
44
+ available_plc_profiles,
45
+ device_range_catalog_for_plc_profile,
46
+ display_name,
47
+ )
48
+ from .errors import (
49
+ HostLinkBaseError,
50
+ HostLinkConnectionError,
51
+ HostLinkError,
52
+ HostLinkProtocolError,
53
+ decode_error_code,
54
+ )
55
+ from .utils import (
56
+ HostLinkAddress,
57
+ HostLinkConnectionOptions,
58
+ TimerCounterValue,
59
+ format_address,
60
+ normalize_address,
61
+ open_and_connect,
62
+ parse_address,
63
+ poll,
64
+ read_comments,
65
+ read_counter,
66
+ read_dwords,
67
+ read_dwords_chunked,
68
+ read_dwords_single_request,
69
+ read_expansion_unit_buffer,
70
+ read_named,
71
+ read_timer,
72
+ read_timer_counter,
73
+ read_typed,
74
+ read_words,
75
+ read_words_chunked,
76
+ read_words_single_request,
77
+ try_parse_address,
78
+ write_bit_in_word,
79
+ write_dwords_chunked,
80
+ write_dwords_single_request,
81
+ write_expansion_unit_buffer,
82
+ write_typed,
83
+ write_words_chunked,
84
+ write_words_single_request,
85
+ )
86
+
87
+ __all__ = [
88
+ "HostLinkClient",
89
+ "AsyncHostLinkClient",
90
+ "ModelInfo",
91
+ "HostLinkTraceDirection",
92
+ "HostLinkTraceFrame",
93
+ "HostLinkBaseError",
94
+ "HostLinkConnectionError",
95
+ "HostLinkError",
96
+ "HostLinkProtocolError",
97
+ "decode_error_code",
98
+ "KvDeviceRangeCatalog",
99
+ "KvDeviceRangeCategory",
100
+ "KvDeviceRangeEntry",
101
+ "KvDeviceRangeNotation",
102
+ "KvDeviceRangeSegment",
103
+ "available_plc_profiles",
104
+ "device_range_catalog_for_plc_profile",
105
+ "display_name",
106
+ "HostLinkAddress",
107
+ "HostLinkConnectionOptions",
108
+ "TimerCounterValue",
109
+ "format_address",
110
+ "normalize_address",
111
+ "open_and_connect",
112
+ "parse_address",
113
+ "poll",
114
+ "read_comments",
115
+ "read_counter",
116
+ "read_dwords",
117
+ "read_dwords_chunked",
118
+ "read_dwords_single_request",
119
+ "read_named",
120
+ "read_timer",
121
+ "read_timer_counter",
122
+ "read_typed",
123
+ "read_words",
124
+ "read_words_chunked",
125
+ "read_words_single_request",
126
+ "read_expansion_unit_buffer",
127
+ "try_parse_address",
128
+ "write_bit_in_word",
129
+ "write_dwords_chunked",
130
+ "write_dwords_single_request",
131
+ "write_expansion_unit_buffer",
132
+ "write_typed",
133
+ "write_words_chunked",
134
+ "write_words_single_request",
135
+ ]