Skip to main content

Darra OPC UA Client SDK — Python bindings (六语言对齐 C# 基准, 完全免费)

Project description

darra-opcua

Darra OPC UA Client SDK — Python 绑定。六语言 (C# / C / C++ / Python / Java / Rust) 完全对齐, C# 为接口基准。

简介

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

链接

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

darra_opcua-0.6.0.post1.tar.gz (12.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

darra_opcua-0.6.0.post1-py3-none-any.whl (12.4 MB view details)

Uploaded Python 3

File details

Details for the file darra_opcua-0.6.0.post1.tar.gz.

File metadata

  • Download URL: darra_opcua-0.6.0.post1.tar.gz
  • Upload date:
  • Size: 12.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for darra_opcua-0.6.0.post1.tar.gz
Algorithm Hash digest
SHA256 163b6880312364aa53051ec491186b17f59141357ea98dfaee70ee59e3fc2ef1
MD5 da0c3f4470fc1cd513a663ddb15e5d7f
BLAKE2b-256 9683bca0383e763ff0f516e3b09f570e631e9f5c527db5be31beaf3e345f4519

See more details on using hashes here.

File details

Details for the file darra_opcua-0.6.0.post1-py3-none-any.whl.

File metadata

File hashes

Hashes for darra_opcua-0.6.0.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 1e94b356fc99eb0598603944b9ee4c7a13bc7529323fe335e78820c43ddf3bd3
MD5 e08e980ea2235b21ef06ea1f659de2a7
BLAKE2b-256 f9f803d4612cc226750713b5c42237664a4348146bb5e58e7b5b5796053d8bfa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page