Metadata-Version: 2.4
Name: iec61850
Version: 0.0.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.10
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.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Repository, https://github.com/csp0924/iec61850-rust

# iec61850 — Python bindings for rust_61850

**Status: Phase 1.0 scaffold (v0.0.0).** The public API shape is defined here for
review; method bodies raise `NotImplementedError` until v0.1.0 vertical slice
lands (`connect` + `read_int32` + `write_int32` end-to-end).

## Layout

```
bindings/python/
  Cargo.toml          # PyO3 extension crate (cdylib, name = _native)
  pyproject.toml      # maturin build backend, PyPI package name = iec61850
  src/lib.rs          # PyO3 #[pymodule] — exception hierarchy + __version__
  python/iec61850/    # pure-Python facade (loaded by Python import system)
    __init__.py       # re-exports public surface
    _facade.py        # class shapes (IedConnection, RcbHandle, ...) with NIE stubs
    _enums.py         # FC / AcsiClass / Validity (StrEnum)
    _dataclasses.py   # frozen value types (TriggerOptions, ClientReport, ...)
    py.typed          # PEP 561 marker
  tests/              # pytest — import / shape / exception hierarchy smoke
```

Pure-value types stay in Python because they are immutable. Opaque handles
(`IedConnection`, `RcbHandle`, `ControlObjectClient`, `MmsValue`, …) will become
PyO3 classes in `_native` as their implementations land per vertical slice.

## Build (development)

From this directory:

```bash
uv venv
uv pip install maturin pytest pytest-asyncio
maturin develop      # build + install into the venv
pytest tests/
```

## Publish to PyPI

For v0.0.0 placeholder squat (sdist only — no platform wheels needed):

```bash
maturin sdist
# uploads target/wheels/iec61850-0.0.0.tar.gz
twine upload target/wheels/iec61850-0.0.0.tar.gz
```

For v0.1.0+ proper releases, switch to `maturin publish` with abi3 wheels for
Python 3.10+ across the Linux/macOS/Windows matrix (CI workflow lands later).

## Why same repo as rust_61850

The PyO3 facade is a thin shim — it must move in lockstep with the
`iec61850-client` Rust API. Same-repo lets a single commit update both. csp_lib
(or any other Python consumer) sees only the PyPI package `iec61850`; the
upstream Rust workspace stays invisible.

