Asynchronous Python client for Solcast.
About
Solcast provides solar radiation and solar power forecasts, estimated and historical data. This package allows you to get the data from the API and use it in your own application.
Rooftop forecasts are supported for Solcast hobbyist accounts.
Installation
pip install solcast-pv
Datasets
- List of all your created rooftop sites linked to your account.
- Get rate limits for your account.
- Fetch rooftop forecasts, including central, lower and upper power estimates.
CLICK HERE! to see all datasets
Rooftop Site
Note: requesting the list of all your created rooftop sites linked to your account, will not affect your daily rate limit.
| Name | Type | Description |
|---|---|---|
name |
str |
The name of the rooftop site. |
resource_id |
str |
The unique identifier of the rooftop site. |
install_date |
datetime |
The installation date of your solar panels. |
capacity |
float |
The capacity of the solar panels. |
capacity_dc |
float |
The capacity of the solar panels in DC. |
azimuth |
int |
The azimuth of the solar panels. |
tilt |
int |
The tilt of the solar panels. |
loss_factor |
float |
The loss factor of the solar panels. |
Rate Limits
Note: requesting the rate limits for your account will not affect your daily rate limit.
| Name | Type | Description |
|---|---|---|
daily_limit |
int |
The daily limit of API calls. |
remaining_daily |
int |
The remaining daily limit of API calls. |
consumed_daily |
int |
How many API calls you have consumed today. |
Example
import asyncio
from solcast_pv import Solcast, RooftopSite
async def main() -> None:
"""Show example on using this package."""
async with Solcast(token="API_KEY") as client:
rooftops: list[RooftopSite] = await client.get_rooftop_sites()
print(rooftops)
if __name__ == "__main__":
asyncio.run(main())
Rooftop forecast
async with Solcast(token="API_KEY", timezone="Europe/Amsterdam") as client:
forecast = await client.get_rooftop_forecast("ROOFTOP_RESOURCE_ID", hours=48)
print(forecast.total_energy_forecast_today) # kWh, local calendar day
print(forecast.power_forecast_now) # W
print(forecast.energy_forecast_current_hour) # kWh, next elapsed hour
Forecast dictionaries contain average power in kW, keyed by interval end in UTC. Energy calculations use each interval's duration and include partial intervals. Calendar-day calculations use the selected timezone, including 23- and 25-hour days. Peak-time methods return the end of the peak interval in that timezone and raise RuntimeError when no interval is available.
Each forecast call makes one API request. The client does not poll or retry requests automatically. Hobbyist accounts currently allow up to 10 requests per UTC day; schedule and cache requests in your application, accounting for all rooftop sites. HTTP 429 raises SolcastRateLimitError (a subclass of SolcastConnectionError). Malformed forecast data raises SolcastResultsError. See the official hobbyist API documentation.
Site listing and usage-allowance methods remain available for compatible accounts; their availability can differ from the documented forecast endpoint.
More examples can be found in the examples folder.
Contributing
This is an active open-source project. We are always open to people who want to use the code or contribute to it.
We've set up a separate document for our contribution guidelines.
Thank you for being involved! 😍
Setting up development environment
The simplest way to begin is by utilizing the Dev Container feature of Visual Studio Code or by opening a CodeSpace directly on GitHub. By clicking the button below you immediately start a Dev Container in Visual Studio Code.
This Python project relies on Poetry as its dependency manager, providing comprehensive management and control over project dependencies.
You need at least:
- Python 3.12+
- Poetry
Installation
Install all packages, including all development requirements:
poetry install
Poetry creates by default an virtual environment where it installs all necessary pip packages.
Prek
This repository uses the prek framework, all changes are linted and tested with each commit. To setup the prek check, run:
poetry run prek install
And to run all checks and tests manually, use the following command:
poetry run prek run --all-files
Testing
It uses pytest as the test framework. To run the tests:
poetry run pytest
To update the syrupy snapshot tests:
poetry run pytest --snapshot-update
License
MIT License
Copyright (c) 2024-2026 Klaas Schoute
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Metadata
Release files for solcast-pv 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| solcast_pv-1.0.0.tar.gz | 12.3 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| solcast_pv-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.1 kB
Release files / solcast_pv-1.0.0.tar.gz
| Download URL | solcast_pv-1.0.0.tar.gz |
|---|---|
| Size | 12.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3ac1aa775fe980af07e162df720a9f3831b85211e565ba026226018d180e614f
|
|
BLAKE2b-256 checksum How to use checksums |
d879ea945d28fe138c4829a47dad7a4f2fc0c164ed31ba944236d2313b6889d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 7, 2026.
Transparency logRelease files / solcast_pv-1.0.0-py3-none-any.whl
| Download URL | solcast_pv-1.0.0-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6fca9489b975dd9ffbce6819491639f7d96fe47f9f2bff0f62c01264b3d9507d
|
|
BLAKE2b-256 checksum How to use checksums |
8194ed5d4d7f4cba6ba4f3f70c3a954cebf8cff128c7b40e49b1928fdb3f108a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 7, 2026.
Transparency logSecurity for solcast-pv 1.0.0
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.
Attestation for solcast_pv-1.0.0.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 Sep 7, 2026.
Transparency logA 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.