Skip to main content

OpenElectricity Python Client

Project description

OpenElectricity Python SDK

A Python SDK for interacting with the OpenElectricity API. This SDK provides both synchronous and asynchronous clients for accessing OpenElectricity data.

Features

  • Synchronous and asynchronous API clients
  • Type hints for better IDE support
  • Automatic request retries and error handling
  • Context manager support for proper resource cleanup
  • Modern Python (3.12+) with full type annotations

Installation

pip install openelectricity

Quick Start

from openelectricity import Client

# Using environment variable OPENELECTRICITY_API_KEY
with Client() as client:
    # API calls will be implemented here
    pass

# Or provide API key directly
client = Client(api_key="your-api-key")

For async usage:

from openelectricity import AsyncClient
import asyncio

async def main():
    async with AsyncClient() as client:
        # API calls will be implemented here
        pass

asyncio.run(main())

Documentation

For detailed usage instructions and API reference, see the documentation.

Development

  1. Clone the repository

  2. Install development dependencies:

    make install
    
  3. Run tests:

    make test
    
  4. Format code:

    make format
    
  5. Run linters:

    make lint
    

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

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

Source Distribution

openelectricity-0.1.0.tar.gz (43.7 kB view details)

Uploaded Source

Built Distribution

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

openelectricity-0.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file openelectricity-0.1.0.tar.gz.

File metadata

  • Download URL: openelectricity-0.1.0.tar.gz
  • Upload date:
  • Size: 43.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.1

File hashes

Hashes for openelectricity-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1c545526433d2a8e24d1185cb5d06b622a13941ff5aeea8650386a0e7ebcc35a
MD5 00a1f706f846816b5321e11933ea618e
BLAKE2b-256 637712152d2e65b7b940f53a38199612c52f50f7933f8c3dee1228f12a5fef68

See more details on using hashes here.

File details

Details for the file openelectricity-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for openelectricity-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 403325e7d839874ad50a75a63756353c7d33078b745d91a9a20627998ad4e48d
MD5 dd73176f24eb107d43b3dfe816c270ba
BLAKE2b-256 46b39921500432b17fec4e87dfbd2caeb9c79257b56a75c7d57432372e00c73c

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