Python SDK to access the Solcast API
Documentation: https://solcast.github.io/solcast-api-python-sdk/
pip install solcast
or from source:
git clone https://github.com/Solcast/solcast-api-python-sdk.git
cd solcast-api-python-sdk
pip install .
The base solcast sdk install requires only the python standard library. Pandas is the only optional dependency that adds functionality to the package.
pip install solcast pandas
The example notebooks use a variety of optional dependencies to showcase different ways in which the Solcast API may be used. To install these dependencies run
pip install solcast[all]
from solcast import live
res = live.radiation_and_weather(
latitude=-33.856784,
longitude=151.215297,
output_parameters=['air_temp', 'dni', 'ghi']
)
res.to_dict()
res.to_pandas() # requires optional pandas installationDon't forget to set your account Api Key with:
export SOLCAST_API_KEY={your commercial api_key}
Tests are run against the Solcast API, you will need an API key to run them.
They are executed on unmetered locations and as such won't consume your requests.
pytest tests
From the directory run
mkdocs build
mkdocs serveIn a browser navigate to localhost:8000 to see the documentation.
| Language | Formatter/Linter |
|---|---|
yaml |
yamlls |
toml |
taplo |
python |
black |
Develop on the oldest supported Python version.
uv python pin 3.8