Introducing alitiq-py: Your Gateway to High-Performance Energy Forecasting ๐Ÿš€

Posted . Visible to the public.

Overview ๐Ÿ› ๏ธ

alitiq-py is a versatile Python SDK designed to interact with alitiqโ€™s Solar and Demand Forecast APIs. This SDK empowers developers with tools to manage solar PV systems, push and retrieve energy measurements, and obtain forecasts tailored to energy demand for heat, gas, and electricity. It is a production-ready solution built for scalability and ease of use.

Why Use alitiq-py?

  • Seamless Integration: Quickly integrate with alitiq's powerful forecasting services.
  • Comprehensive API Support: Manage solar portfolios, fetch demand forecasts, and push measurementsโ€”all in one package.
  • Future-Proof: Supports Python 3.10, 3.11, and 3.12.
  • Pydantic-Powered Validation: Ensure accurate and reliable data exchange with the API.

Before using the SDK, you need an API key:


Features โœจ

  • ๐ŸŒž Solar Power Forecasting:
    Effortlessly manage solar PV portfolios and fetch accurate forecasts.
  • ๐Ÿ”‹ Demand Forecasting:
    Analyze and predict energy demand for heat, gas, and electricity.
  • ๐Ÿ“ค Push Measurements:
    Add real-time or historical measurement data to refine forecasting accuracy.
  • ๐Ÿ›ก๏ธ Robust Validation:
    Built-in Pydantic models ensure data reliability.

Installation ๐Ÿ“ฆ

Install via pip:

pip install alitiq

For local setup:

  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. Install the SDK locally:

    pip install .
    

Quickstart ๐Ÿš€

Adding a New Solar PV System and Fetching Forecasts

This example shows how to create a solar PV system, retrieve forecasts, and submit measurements:

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 (available 1-6 hours after creation)
forecast = solar_api.get_forecast(location_id="SP123")
print(forecast)

# Post measurements
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,
    ),
]

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

Documentation ๐Ÿ“–

For a detailed guide on setting up your PV system, check out:
How to Setup PV Systems at Alitiq.

Comprehensive API documentation is coming soon! ๐Ÿšง


License ๐Ÿ“œ

This SDK is licensed under the MIT License.


Support & Contact ๐Ÿ“ง

For any questions or issues, please reach out to:

๐ŸŒŸ Happy Forecasting with alitiq-py! ๐ŸŒŸ

Last edit
Daniel
Keywords
alitiq, python, api
Tags
Posted by Daniel to alitiq Knowledge (2024-12-23 12:53)