Skip to main content

GridAPPSD IEEE 2030.5 Client

Python Tests PyPI version License Code style: black

A Python client library for IEEE 2030.5 (Smart Energy Profile 2.0) servers with persistent connections and extensible event handling.

Features

  • Persistent Connections: Uses modern HTTP client with connection pooling
  • Extensible Event Handling: Abstract base class for custom event processing
  • Async Support: Full asyncio integration for non-blocking operations
  • Subscription Management: Automatic tracking and renewal of subscriptions
  • Multi-format Support: Handles XML, JSON, and EXI content types
  • TLS Authentication: Certificate-based authentication for secure communications
  • Type Annotations: Modern Python typing for better IDE support and validation

Installation

# Install from PyPI
pip install gridappsd-2030-5-client

# Or with Poetry
poetry add gridappsd-2030-5-client

Quick Start

Basic Usage

import logging
from gridappsd_2030_5_client import IEEE2030Client, IEEE2030EventHandler

# Configure logging
logging.basicConfig(level=logging.INFO)

# Create a custom event handler
class MyEventHandler(IEEE2030EventHandler):
    def on_connect(self, client):
        print("Connected to IEEE 2030.5 server!")

    def on_subscription_update(self, client, resource, data):
        print(f"Received update for {resource}: {data}")

# Create and use the client
client = IEEE2030Client(
    base_url="https://ieee2030server.example.com/api",
    event_handler=MyEventHandler(),
    cert_path="client_cert.pem",
    key_path="client_key.pem",
    ca_cert_path="ca_cert.pem"
)

try:
    # Connect to the server
    if client.connect():
        # Get device capability
        capability = client.get_device_capability()
        print(f"Device capability: {capability}")
    
        # Subscribe to resources
        client.create_subscription("drp/1/dre") # Demand response events
    
        # Start polling for updates
        client.start_polling()
    
        # Wait for events
        input("Press Enter to stop...")
finally:
    # Disconnect and clean up
    client.disconnect()

Async Usage

import asyncio
from gridappsd_2030_5_client import IEEE2030Client, IEEE2030EventHandler

# Create a custom event handler
class MyEventHandler(IEEE2030EventHandler):
    def on_connect(self, client):
        print("Connected to IEEE 2030.5 server!")

async def main():
    # Create client
    client = IEEE2030Client(
        base_url="https://ieee2030server.example.com/api",
        event_handler=MyEventHandler(),
        cert_path="client_cert.pem",
        key_path="client_key.pem",
        ca_cert_path="ca_cert.pem"
    )

    try:
        # Connect to the server asynchronously
        if await client.async_connect():
            # Start polling for updates
            client.start_polling()

        # Wait for some time
        await asyncio.sleep(300) # Run for 5 minutes
    finally:
    # Disconnect and clean up
    client.disconnect()

# Run the async program
asyncio.run(main())

Development

# Clone the repository
git clone https://github.com/GRIDAPPSD/gridappsd-2030-5-client.git
cd gridappsd-2030-5-client

# Install dependencies with Poetry
poetry install

# Run tests
poetry run pytest

# Run tests with coverage
poetry run pytest --cov=gridappsd_2030_5_client

# Format code
poetry run black gridappsd_2030_5_client

License

BSD 3-Clause License

Copyright (c) 2023, GridAPPSD Contributors All rights reserved.

Metadata

Release files for gridappsd-2030-5-client 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gridappsd-2030-5-client 0.2.2
File Size Uploaded Provenance Actions
gridappsd_2030_5_client-0.2.2.tar.gz 9.3 kB With provenance Details for gridappsd_2030_5_client-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gridappsd-2030-5-client 0.2.2
File Interpreter ABI Platform Actions
gridappsd_2030_5_client-0.2.2-py3-none-any.whl Python 3 none any Details for gridappsd_2030_5_client-0.2.2-py3-none-any.whl

Total release size: 20.3 kB

Release files / gridappsd_2030_5_client-0.2.2.tar.gz

Download URL gridappsd_2030_5_client-0.2.2.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5402452f6bf61cbbe89fd90f9926188ab4725e04eb2eba1efe1034aca9bd61f1
BLAKE2b-256 checksum
How to use checksums
f2c047209618ff7b85a42270a5bed1dc8a995972c4ec5193672b7e08baf10433
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 16, 2025.

Transparency log

Release files / gridappsd_2030_5_client-0.2.2-py3-none-any.whl

Download URL gridappsd_2030_5_client-0.2.2-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0cfeb65d39bba2fb8e1aef5725c7af1672e55a2e8eddaa02108e6203c3cececd
BLAKE2b-256 checksum
How to use checksums
11076da23f833eecc1f3fd1184090d0a0a1f9d7ad058e81367cf8e5592f849ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 16, 2025.

Transparency log

Security for gridappsd-2030-5-client 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for gridappsd_2030_5_client-0.2.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 16, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page