Skip to main content

Python bindings for libiec61850 - IEC 61850 protocol implementation

Project description

pyiec61850-ng

Next Generation Python bindings for libiec61850, packaged as a Python wheel.

Build and Test PyPI version Python Versions

This repository provides Python bindings for the libiec61850 library, which is an open-source implementation of the IEC 61850 standard for communication networks and systems in substations.

Installation

Install from PyPI (Recommended)

pip install pyiec61850-ng

Install from GitHub Release

pip install pyiec61850-ng --find-links https://github.com/f0rw4rd/pyiec61850-ng/releases/latest/download/

Install directly from GitHub

pip install git+https://github.com/f0rw4rd/pyiec61850-ng.git

Install from local wheel

pip install pyiec61850-ng-*.whl

Usage

Quick Start

import pyiec61850.pyiec61850 as pyiec61850

# Create and connect to an IEC 61850 server
connection = pyiec61850.IedConnection_create()
error = pyiec61850.IedConnection_connect(connection, "192.168.1.100", 102)

if error == pyiec61850.IED_ERROR_OK:
    print("Connected successfully!")
    # Perform operations...
    pyiec61850.IedConnection_close(connection)

pyiec61850.IedConnection_destroy(connection)

Examples

For comprehensive examples, see the examples directory:

Run examples:

python examples/01_basic_connection.py 192.168.1.100
python examples/02_device_discovery.py 192.168.1.100

Building from Source

The wheel package is built using Docker:

docker build -t pyiec61850-builder --build-arg LIBIEC61850_VERSION=v1.6 .

To extract the wheel file:

mkdir -p ./dist
docker create --name wheel-container pyiec61850-builder
docker cp wheel-container:/wheels/. ./dist/
docker rm wheel-container

Versioning

This package uses the format: LIBIEC61850_VERSION.REVISION

  • Example: 1.6.0.1 = libiec61850 v1.6.0, first package revision
  • 1.6.0: The exact libiec61850 version included (static)
  • .1: Package revision for bug fixes, rebuilds, binding improvements

This clearly shows which libiec61850 version you're getting and our package iteration.

Check current version:

python version.py        # Package version: 1.6.0.1
python version.py --libiec61850  # libiec61850 version: v1.6.0

TASE.2/ICCP Support

pyiec61850-ng includes support for TASE.2 (IEC 60870-6), also known as ICCP (Inter-Control Center Communications Protocol), used for real-time data exchange between control centers in the electric utility industry.

TASE.2 Quick Start

from pyiec61850.tase2 import TASE2Client

client = TASE2Client(
    local_ap_title="1.1.1.999",
    remote_ap_title="1.1.1.998"
)
client.connect("192.168.1.100", port=102)

# Discover domains (VCC/ICC)
domains = client.get_domains()
for domain in domains:
    print(f"Domain: {domain.name} ({domain.domain_type})")

# Read a data point
value = client.read_point("ICC1", "Voltage")
print(f"Value: {value.value}, Quality: {value.quality}")

# Security analysis
security = client.analyze_security()
print(f"Readable points: {security['readable_points']}")
print(f"Concerns: {security['concerns']}")

client.disconnect()

TASE.2 Features

  • Domain Discovery: VCC (Virtual Control Center) and ICC (Indication Control Center)
  • Variable Enumeration: List and read data points with quality information
  • Data Point Access: Read/write individual points or bulk enumeration
  • Transfer Sets (Block 2): RBE (Report-by-Exception) management
  • Device Control (Block 5): Select-Before-Operate, commands, setpoints
  • Bilateral Tables: Access control configuration queries
  • Security Analysis: Automated security assessment and recommendations

TASE.2 Data Types

from pyiec61850.tase2 import (
    Domain,          # VCC/ICC domain
    PointValue,      # Data point with value and quality
    TransferSet,     # Block 2 transfer set
    BilateralTable,  # Access control table
    ServerInfo,      # Server information
)

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.

pyiec61850_ng-1.6.0.6-cp313-cp313-manylinux1_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.13

pyiec61850_ng-1.6.0.6-cp312-cp312-manylinux1_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.12

pyiec61850_ng-1.6.0.6-cp311-cp311-manylinux1_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.11

pyiec61850_ng-1.6.0.6-cp310-cp310-manylinux1_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.10

pyiec61850_ng-1.6.0.6-cp39-cp39-manylinux1_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.9

pyiec61850_ng-1.6.0.6-cp38-cp38-manylinux1_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.8

File details

Details for the file pyiec61850_ng-1.6.0.6-cp313-cp313-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyiec61850_ng-1.6.0.6-cp313-cp313-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5cb9d9f2f71a8e1870f2c2f17044c7ef179bde45c88b5416e8b9dc095339852b
MD5 dd39836e7bfd477ccb35325b7cda299d
BLAKE2b-256 e05d768c0aa03e7bf61938242fba63aeb4f308ce002e12e8e8bfffdad19ddda5

See more details on using hashes here.

File details

Details for the file pyiec61850_ng-1.6.0.6-cp312-cp312-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyiec61850_ng-1.6.0.6-cp312-cp312-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 6a1c0ee32f6c693f217c91973066785faf314fa7606e1046afa4c5ef59dd2581
MD5 a53a16c2431b0604954945c03d0de846
BLAKE2b-256 f64c71cb69089189c46cc71eab739d8e7f2b7950aef6a6ec25f427fccc12161f

See more details on using hashes here.

File details

Details for the file pyiec61850_ng-1.6.0.6-cp311-cp311-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyiec61850_ng-1.6.0.6-cp311-cp311-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e4ace1d0147ea0bbf7c297f7f0eb2e038b48481ba29867ed92801aedbf97a8ca
MD5 a2e7847c6251752a9866a95cb8f53ea9
BLAKE2b-256 962e46540856df630cd2a8b74e7074f1f5180ba0b7d71ecf06e8d926074d23c5

See more details on using hashes here.

File details

Details for the file pyiec61850_ng-1.6.0.6-cp310-cp310-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyiec61850_ng-1.6.0.6-cp310-cp310-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 01503de469b3e2dd3b995846dff470edc5c51d58b45ea763295da27552a6ce2c
MD5 f7c42434e1e15f1df3e5451c6ad32d54
BLAKE2b-256 11b091fa0cf92719e66f2dbacaa82c0a2836158391a2026dac26cc710cb286bc

See more details on using hashes here.

File details

Details for the file pyiec61850_ng-1.6.0.6-cp39-cp39-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyiec61850_ng-1.6.0.6-cp39-cp39-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 74964b8290eb1ed3280567cec36d4d1cfd20e77b5ce40178176d06a223867294
MD5 18ed914b52865f1f2d2fffa71b18daea
BLAKE2b-256 746e319c1db34f0dd25d019b644c6feabacbe689ac549acc7b3243a3e4ec60d7

See more details on using hashes here.

File details

Details for the file pyiec61850_ng-1.6.0.6-cp38-cp38-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pyiec61850_ng-1.6.0.6-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a261c293cbf35556cfb95ed0b1a134ae160f829a0bbaa03011eb0ab6c5619359
MD5 886ac52a76a6aa7c1b350b8b5cbe8f1e
BLAKE2b-256 b3b12bada743e0ebafb38d6cdeec6bcdcf5541b02263f80e0d665c383ac3735c

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