Skip to main content

alitiq python SDK

Project description

alitiq Forecasting Energy

alitiq-py , high performance, easy to use, ready for production python software development kit

Supported Python versions

Overview 🛠️

Welcome to alitiq's Forecasting Service SDK, a robust Python-based SDK that simplifies interaction with alitiq’s Solar, and Engine (Demand) Forecast APIs. This SDK enables seamless data retrieval, measurements management, and forecasting for solar power plants, energy demand, and more. Built with flexibility and scalability in mind, it supports a range of features such as pushing measurements, retrieving forecasts, and managing locations.

Before you start using the SDK, you need to obtain an API key. For the engine / demand API you will receive your key and relevant information from the alitiq Team. To obtain a key for the solar power forecasting API register here: Solar-APP

This is a work in progress. We will shortly add an extensive documentation with step by step guides to use our API with python.


Features ✨

  • Solar Power Plant Management:
    Manage PV system configurations and retrieve forecasts for your solar power installations.
  • Demand Forecasting by alitiq Engine:
    Fetch and manage energy demand forecasts for heat, gas, and electricity demand.
  • Pushing and Retrieving Measurements:
    Push new measurement data to the API and inspect historical measurement data.
  • Robust Validation:
    Powered by Pydantic, ensuring data integrity for all API interactions.

Installation 📦

With pip:

pip install alitiq

Or check out locally:

  1. Clone the repository:

    git clone https://github.com/alitiq/forecasting-sdk.git
    cd forecasting-sdk
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. (Optional) Install the SDK locally:

    pip install .
    

Quickstart 🚀

Example shows how to add a new Solar PV power plant, retrieve most recent forecast and push measurements for a given location.

from datetime import datetime
from alitiq import alitiqSolarAPI, SolarPowerPlantModel, PvMeasurementForm

# Initialize the API client
solar_api = alitiqSolarAPI(api_key="your-api-key")

# Create a solar power plant location
plant = SolarPowerPlantModel(
    site_name="My Solar Plant",
    location_id="SP123",
    latitude=48.160170,
    longitude=10.55907,
    installed_power=500.0,
    installed_power_inverter=480.0,
    azimuth=180.0,
    tilt=25.0,
)

response = solar_api.create_location(plant)
print("Location created:", response)

# Retrieve a forecast ( after 1-6 hours after creation available)
forecast = solar_api.get_forecast(location_id="SP123")
print(forecast)

# Post measurements 
pv_measurements = [
    PvMeasurementForm(
        location_id="SP123",
        dt=datetime(2024, 6, 10, 10).isoformat(),
        power=120.5,
        power_measure="kW",
        timezone="UTC",
        interval_in_minutes=15,
    ),
    PvMeasurementForm(
        location_id="SP123",
        dt=datetime(2024, 6, 10, 10, 15).isoformat(),
        power=90.8,
        power_measure="kW",
        timezone="UTC",
        interval_in_minutes=15,
    ),
    PvMeasurementForm(
        location_id="SP123",
        dt=datetime(2024, 6, 10, 10, 30).isoformat(),
        power=150.0,
        power_measure="kW",
        timezone="UTC",
        interval_in_minutes=15,
    ),
]

response = solar_api.post_measurements(pv_measurements)
print(response)

Please note this docs for setting up your PV system locations: How to setup PV systems at alitiq


Project Structure 🏗️

forecasting-sdk/
├── alitiq/
│   ├── base.py              # Base class for interacting with APIs
│   ├── solar_api.py         # Solar forecasting service SDK
│   ├── demand_api.py        # Demand forecasting service SDK
│   └── enumerations/        # Enumerations for services and forecasting models
├── models/
│   ├── solar.py             # Pydantic models for solar APIs
│   └── demand_forecast.py   # Pydantic models for demand APIs
├── tests/                   # Unit tests for the SDK
└── README.md                # Project documentation

Key Modules 📚

Solar Forecasting Module (solar_power_forecast.py)

Manage PV systems and retrieve solar power forecasts. Key methods:

  • create_location: Add new PV system configurations.
  • list_locations: List current portfolio
  • delete_location: Deletes one location from portfolio
  • get_forecast: Retrieve solar power forecasts for a specific location.
  • get_forecast_portfolio: Retrieve solar power forecasts for the whole portfolio.
  • push_measurements: Submit real-time measurements for your solar plant.

Demand Forecasting Module (demand_forecast.py)

Interact with alitiq's demand forecast API for heat, gas, and electricity. Key methods:

  • get_measurements: Retrieve historical data for a location.
  • post_measurements: Push new measurement data.
  • get_forecast: Fetch demand forecasts for your configured location.

Contributing 🤝

We welcome contributions! To contribute:

  1. Fork the repository.
  2. Create a new branch:
    git checkout -b feature/new-feature
    
  3. Commit your changes:
    git commit -m "Add a new feature"
    
  4. Push to your branch and submit a pull request.

License 📜

t.b.d.



Developer Notes

Run python3 -m build to build the package and then upload with twine: twine upload -r pypi dist/*


Support & Contact 📧

For any questions or issues, please contact support@alitiq.com.

🌟 Happy Forecasting! 🌟

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

alitiq-2025.1.1.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

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

alitiq-2025.1.1-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file alitiq-2025.1.1.tar.gz.

File metadata

  • Download URL: alitiq-2025.1.1.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for alitiq-2025.1.1.tar.gz
Algorithm Hash digest
SHA256 e23a6a91500f0b1ebcc2df59905570de502ba35d8c354688dfbdfbdf77269166
MD5 f12af3d3f0727650ced3d6b7369e7ff4
BLAKE2b-256 e66fe32551263be022f46dde937683e03dbf4dce03b44009a05d5355beea829d

See more details on using hashes here.

File details

Details for the file alitiq-2025.1.1-py3-none-any.whl.

File metadata

  • Download URL: alitiq-2025.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for alitiq-2025.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1bd49218252676df6c93fdd014e2d3a20184a7d203573d4255efc549b5cd3aab
MD5 ce90fcba5f7b67c4bc8aec63a4582014
BLAKE2b-256 3a16502e289d19a07c9f8d01a30e12ec5e97f4a5884b3897c7ae7f8f662f3ec9

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