Skip to main content

IEC 61850 client for Python, backed by rust_61850 (Rust core).

Project description

iec61850

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

Status: early development (v0.3.x). Wired surface:

  • TCP connect / disconnect with timeout
  • Full typed scalar read/write: bool / int32 / uint32 / int64 / float / float64 / string / timestamp (→ datetime) / quality (→ Quality dataclass) + corresponding writes
  • Directory queries: get_server_directory / get_logical_device_directory / get_logical_node_directory(AcsiClass) / get_data_directory
  • Typed exception hierarchy (IedError / IedConnectionError / IedTimeoutError / IedDataAccessError / IedServiceError / IedControlError)

Pending (raises NotImplementedError): TLS connect, generic composite read/write, get_variable_specification, reporting (URCB / BRCB), control objects, datasets.

Install

pip install iec61850

Requires Python 3.11+. Wheels published for Windows x86_64 and Linux x86_64 (manylinux 2014).

Quick start

import asyncio
import iec61850

async def main():
    conn = await iec61850.IedConnection.connect("127.0.0.1:102", timeout_ms=5000)
    try:
        status = await conn.read_int32("simpleIOGenericIO/LLN0.Mod.stVal", iec61850.FC.ST)
        vendor = await conn.read_string("simpleIOGenericIO/LLN0.NamPlt.vendor", iec61850.FC.DC)
        quality = await conn.read_quality("simpleIOGenericIO/GGIO1.Ind1.q", iec61850.FC.ST)
        print(status, vendor, quality.validity)
    finally:
        await conn.disconnect()

asyncio.run(main())

Error handling

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

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

iec61850-0.3.0-cp311-abi3-win_amd64.whl (606.2 kB view details)

Uploaded CPython 3.11+Windows x86-64

iec61850-0.3.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (598.7 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ x86-64

File details

Details for the file iec61850-0.3.0-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: iec61850-0.3.0-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 606.2 kB
  • Tags: CPython 3.11+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for iec61850-0.3.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 bb105ced12dea4c07d0ca6a4c336b4fed9d8eff1b5d7d18fd619a4bcd57a0766
MD5 a787d0132cfc28ab01541b5ce567eec8
BLAKE2b-256 bf1b540b0d9257368d5861d924103b4d3508cba04095c30cefc1c4d6c5eababd

See more details on using hashes here.

File details

Details for the file iec61850-0.3.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for iec61850-0.3.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e768b2ca58a716121aa991c759786a964e3230ef3ba99447f5ead95874d0602a
MD5 74b20dc8ce8e7c3ee32d90a17e2d9bd1
BLAKE2b-256 2143252661f2df6d6466ac75698675a7c0fb91a8a65d88978c289b910fe31075

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