Metadata-Version: 2.4
Name: darra-opcua
Version: 0.6.0
Summary: Darra OPC UA Client SDK — Python bindings (六语言对齐 C# 基准, 完全免费)
Author-email: Darra <jtl1207@darra.xyz>
License: MIT
Project-URL: Homepage, https://opcua.darra.xyz
Project-URL: Documentation, https://opcua.darra.xyz/docs/sdk/python
Project-URL: Repository, https://github.com/DarraTechnology/DarraOpcUaClient
Project-URL: Issues, https://github.com/DarraTechnology/DarraOpcUaClient/issues
Keywords: opcua,opc-ua,industrial,iiot,client
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Manufacturing
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Communications
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# 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 提供)。

## 安装

```bash
pip install darra-opcua
```

> 当前 Wheel 仅打包 Windows x64 (依赖 `Darra.OpcUa.Core.dll`)。
> Linux / macOS 后续版本提供。

## 快速示例

```python
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](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
