Skip to content

GF-D6/solcast-api-python-sdk

 
 

Repository files navigation

Solcast API Python SDK

Python SDK to access the Solcast API

Docs Tests Publish 📦 to PyPI


Documentation: https://solcast.github.io/solcast-api-python-sdk/

Install

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]

Basic Usage

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 installation

Don't forget to set your account Api Key with: export SOLCAST_API_KEY={your commercial api_key}


Contributing

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

Docs

From the directory run

mkdocs build
mkdocs serve

In a browser navigate to localhost:8000 to see the documentation.

Formatters and Linters

Language Formatter/Linter
yaml yamlls
toml taplo
python black

Recommended Python Development Version

Develop on the oldest supported Python version.

uv python pin 3.8

About

Python SDK for the Solcast API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%