Metadata-Version: 2.4
Name: iec61850
Version: 0.2.0
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: MacOS
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Rust
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: System :: Networking
Summary: IEC 61850 client for Python, backed by rust_61850 (Rust core).
Keywords: iec61850,scada,ics,mms,goose,energy,ems
Author: Cheng Sin Pang
License: Apache-2.0
Requires-Python: >=3.11
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Repository, https://github.com/csp0924/iec61850-rust

# iec61850

IEC 61850 client for Python — async-first, type-hinted.

**Status: early development (v0.1.x).** Vertical slice currently supports:

- TCP connect / disconnect with timeout
- `read_int32` / `write_int32` over MMS
- Typed exception hierarchy (`IedError` / `IedConnectionError` / `IedTimeoutError` /
  `IedDataAccessError` / `IedServiceError` / `IedControlError`)

Additional surface (`read_bool`, `read_float`, reporting, control, datasets, TLS,
GOOSE / SV) is stubbed and will land per release.

## Install

```bash
pip install iec61850
```

Requires Python 3.11+.

> **Platform support note (v0.1.x)**: only Windows x86_64 wheels are published.
> Linux / macOS support arrives in a later release.

## Quick start

```python
import asyncio
import iec61850

async def main():
    conn = await iec61850.IedConnection.connect("127.0.0.1:102", timeout_ms=5000)
    try:
        value = await conn.read_int32("simpleIOGenericIO/LLN0.Mod.stVal", iec61850.FC.ST)
        print("Mod.stVal =", value)
    finally:
        await conn.disconnect()

asyncio.run(main())
```

## Error handling

```python
try:
    conn = await iec61850.IedConnection.connect("10.0.0.1:102", timeout_ms=2000)
except iec61850.IedTimeoutError:
    ...   # 連線超時
except iec61850.IedConnectionError:
    ...   # TCP / OSI stack 失敗
except iec61850.IedError:
    ...   # 其他 IEC 61850 錯誤的 catch-all base
```

## License

Apache-2.0

