Skip to main content

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

Project description

iec61850

Async-first, type-hinted IEC 61850 client for Python.

Features

  • TCP connect / disconnect with timeout
  • Typed scalar read / write: bool, int32, int64, uint32, float, float64, string, timestamp (decoded to datetime), quality (decoded to a Quality dataclass)
  • 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

Install

pip install iec61850

Requires Python 3.11+. Wheels are 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:
    ...   # connection timed out
except iec61850.IedConnectionError:
    ...   # TCP / OSI stack failure
except iec61850.IedError:
    ...   # catch-all base for any IEC 61850 error

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.5.0-cp311-abi3-win_amd64.whl (806.4 kB view details)

Uploaded CPython 3.11+Windows x86-64

iec61850-0.5.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (742.3 kB view details)

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

File details

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

File metadata

  • Download URL: iec61850-0.5.0-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 806.4 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.5.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 78bd554bc351fed46671ebee2b2f7e586e82f30d29092f3a5c5c9350d73a1f8a
MD5 fbb11bc59874d7c9a936420e4994dc87
BLAKE2b-256 b9ea37c4aac9495b4dcf7ba48b249e5bbf7a1066c17f223d5a2f8acda4e9a86a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for iec61850-0.5.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2e0de8ed350d62b172c2a453791ff90a1eaed708ab28f988fe8c9a2705f1e681
MD5 06ef6b9b9881a39bf2a20fc8f5e83016
BLAKE2b-256 85e2b3948a61ab6bfdc2820cc4d4938b97c37ace16894a6ed30eaf5be426d877

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