darra-opcua
Darra OPC UA Client SDK — Python 绑定。六语言 (C# / C / C++ / Python / Java / Rust) 完全对齐, C# 为接口基准。
- 主页: https://opcua.darra.xyz
- 文档: https://opcua.darra.xyz/docs/sdk/python
- 仓库: https://github.com/DarraTechnology/DarraOpcUaClient
- 反馈: jtl1207@darra.xyz
简介
Darra OPC UA Client 是独立的 OPC UA 客户端 SDK, 通过原生
Darra.OpcUa.Core.dll (随包安装) 提供完整的 OPC UA 1.04 客户端能力:
- 会话管理 / 自动重连
- 节点浏览 / 属性读写
- 订阅与监控项 / 自动重建
- 历史数据访问
- 事件订阅
- 安全 (None / Sign / SignAndEncrypt) + 用户令牌 (Anonymous / UserName / Certificate)
- 服务发现 (Discovery)
不包含 Server 实现 (Darra 的 Server 由 Darra.PLC.Service 提供)。
安装
pip install darra-opcua
当前 Wheel 仅打包 Windows x64 (依赖
Darra.OpcUa.Core.dll)。 Linux / macOS 后续版本提供。
快速示例
from darra_opcua import Session, NodeId, AttributeId
# 1. 连接 OPC UA Server
session = Session.connect("opc.tcp://127.0.0.1:4840")
# 2. 浏览根节点
for r in session.browse(NodeId.numeric(0, 84)):
print(f"{r.browse_name} -> {r.node_id}")
# 3. 读节点值
val = session.read_value(NodeId.string(2, "MyVar"))
print("Value =", val)
# 4. 创建订阅 + 监控项 (1000ms 采样)
sub_id = session.create_subscription(publishing_interval=1000.0)
session.create_monitored_item(sub_id, NodeId.string(2, "MyVar"))
# 5. 关闭
session.close()
更多示例: examples/demo.py
状态
- 当前版本: 0.6.0 (Beta)
- 协议: OPC UA 1.04
- Python: 3.8 - 3.12
- 平台: Windows x64 (主), Linux x64 / macOS 跟进中
- 与 C# / Rust / Java SDK 完全对齐 (相同方法名 / 相同枚举 / 相同行为)
许可证
MIT — 完全免费, 商用闭源亦可. 详见 https://opcua.darra.xyz/docs/faq/licensing
链接
- 完整 API 文档: https://opcua.darra.xyz/docs/sdk/python
- 常见问题: https://opcua.darra.xyz/docs/faq
- 其他语言: C# / C / C++ / Rust / Java
Release files for darra-opcua 0.6.0.post1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| darra_opcua-0.6.0.post1.tar.gz | 12.4 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| darra_opcua-0.6.0.post1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.9 MB
Release files / darra_opcua-0.6.0.post1.tar.gz
| Download URL | darra_opcua-0.6.0.post1.tar.gz |
|---|---|
| Size | 12.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
163b6880312364aa53051ec491186b17f59141357ea98dfaee70ee59e3fc2ef1
|
|
BLAKE2b-256 checksum How to use checksums |
9683bca0383e763ff0f516e3b09f570e631e9f5c527db5be31beaf3e345f4519
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.13
|
Release files / darra_opcua-0.6.0.post1-py3-none-any.whl
| Download URL | darra_opcua-0.6.0.post1-py3-none-any.whl |
|---|---|
| Size | 12.4 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1e94b356fc99eb0598603944b9ee4c7a13bc7529323fe335e78820c43ddf3bd3
|
|
BLAKE2b-256 checksum How to use checksums |
f9f803d4612cc226750713b5c42237664a4348146bb5e58e7b5b5796053d8bfa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.13
|