A Python SDK for interacting with the OpenElectricity API. This SDK provides both synchronous and asynchronous clients for accessing OpenElectricity data.
- 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
pip install openelectricity
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())
For detailed usage instructions and API reference, see the documentation.
-
Clone the repository
-
Install development dependencies:
make install
-
Run tests:
make test
-
Format code:
make format
-
Run linters:
make lint
This project is licensed under the MIT License - see the LICENSE file for details.