Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
40f90a5
Markdown file formatting
GF-D6 Nov 18, 2025
8448ffb
Remove changelog file
GF-D6 Nov 18, 2025
01a34d5
Make a response instance callable to fix self.response(...) calls lin…
GF-D6 Nov 18, 2025
f94fc6f
Fix self.data unbounded linting error
GF-D6 Nov 18, 2025
73698c7
Add soiling endpoint urls
GF-D6 Nov 18, 2025
cfaced8
Fix tuple return type hinting
GF-D6 Nov 18, 2025
71ff132
Get rid of bare return linting error
GF-D6 Nov 18, 2025
e385084
Bump base python required version to 3.8
GF-D6 Nov 18, 2025
712c928
uvfiy
GF-D6 Nov 18, 2025
b4cd7b4
Add build dist dir to gitignore
GF-D6 Nov 18, 2025
9c5075a
isort and black
GF-D6 Nov 18, 2025
154d84b
uvfiy github build action
GF-D6 Nov 18, 2025
c6060d4
Update rooftop pv power tmy test
GF-D6 Nov 18, 2025
c692de8
Uvfity test action
GF-D6 Nov 18, 2025
5855deb
Add soiling methods to live historic and forecast
GF-D6 Nov 18, 2025
fb8bdc8
Add tests for kimber and hsu
GF-D6 Nov 19, 2025
260c1b9
fix rooftop pv power test
GF-D6 Nov 19, 2025
8ca69a4
Update os matrix
GF-D6 Nov 19, 2025
81a3e63
Remove typing.Self as it is not in python3.8
GF-D6 Nov 19, 2025
b4e22be
Add pytest settings for vscode
GF-D6 Nov 19, 2025
d54e211
Uvfiy docs workflow
GF-D6 Nov 19, 2025
6f0074c
Fix uv sync command
GF-D6 Nov 19, 2025
8a3466e
Remove uv.lock and .python-version and prevent git tracking them
GF-D6 Nov 19, 2025
61a9673
Revert 204 guard logic
GF-D6 Nov 19, 2025
7eb796b
Split out dev only dependency groups from project optional dependency…
GF-D6 Nov 19, 2025
d0b5352
Support macos-14 as oldest version in tests
GF-D6 Nov 19, 2025
7692675
Added back and updated changelog
GF-D6 Nov 19, 2025
040bb94
Remove manual_washdates as a named parameter
GF-D6 Nov 19, 2025
e57b12f
Revert typing experiments
GF-D6 Nov 19, 2025
31d8e03
Update contributing instructions
GF-D6 Nov 19, 2025
adf90dc
Clean up request parameters and doc strings
GF-D6 Nov 19, 2025
7f09ddf
Add to_pandas tests
GF-D6 Nov 20, 2025
48c9170
Update test workflow command
GF-D6 Nov 24, 2025
2be41be
Update docs workflow command
GF-D6 Nov 24, 2025
28c0fd5
Add missing required format request parameter
GF-D6 Nov 24, 2025
dd20e4d
Update mkdocstrings version to fix docs worksflow
GF-D6 Nov 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
name: Docs

on:
push:
branches:
- master
- master
- main

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4

- uses: astral-sh/setup-uv@v4
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v3
python-version: "3.11"

- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV

- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
key: uv-mkdocs-material-${{ env.cache_id }}
path: ~/.cache/uv
restore-keys: |
mkdocs-material-
- run: pip install .[docs]
- run: mkdocs gh-deploy --force
uv-mkdocs-material-

- run: uv sync --group docs

- run: uv run mkdocs gh-deploy --force
30 changes: 13 additions & 17 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,33 @@ name: Publish 📦 to PyPI
on:
push:
tags:
- '*'
- "*"

jobs:
build-and-publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5

- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Install uv
uses: astral-sh/setup-uv@v6

- name: Build a binary wheel and a source tarball
run: >-
python3 -m
uv
build
--sdist
--wheel
--outdir dist/
.
# - name: Publish distribution 📦 to Test PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# repository-url: https://test.pypi.org/legacy/
--out-dir dist/
# - name: Publish distribution 📦 to Test PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# repository-url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
password: ${{ secrets.PYPI_API_TOKEN }}

22 changes: 12 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,23 @@ jobs:
build:
strategy:
matrix:
os: ['ubuntu-latest', 'macos-13', 'windows-latest']
os: ["ubuntu-latest", "macos-14", "windows-latest"]
python-version: ["3.8", "3.11"]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v4

- name: Install dependencies with uv
run: |
python -m pip install --upgrade pip
pip install .[all]
uv python install ${{ matrix.python-version }}
uv sync --python ${{ matrix.python-version }} --extra all --all-groups

- name: Test with pytest
env:
SOLCAST_API_KEY: ${{ secrets.SOLCAST_API_KEY }}
run: |
pytest tests
uv run --python ${{ matrix.python-version }} --group test pytest tests
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
public
dist
uv.lock
.python-version
.idea
*.ipynb_checkpoints
.pytest_cache
Expand Down
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"python.testing.pytestArgs": ["tests"],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Changelog

## [1.3.0] - 2024-07-10
## [1.3.1] - 2025-11-19

- Add the `Kimber` and `HSU` to live, forecast, and historic module

- Add the `aggregations` module. No tests as we are yet to expose unmetered aggregations.
## [1.3.0] - 2024-07-10

- Add the `aggregations` module. No tests as we are yet to expose unmetered aggregations.

## [1.2.5] - 2024-07-05

Expand Down
31 changes: 26 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,22 @@
**Documentation**: <a href="https://solcast.github.io/solcast-api-python-sdk/" target="_blank">https://solcast.github.io/solcast-api-python-sdk/ </a>

## Install

```commandline
pip install solcast
```
or from source:

or from source:

```commandline
git clone https://github.com/Solcast/solcast-api-python-sdk.git
cd solcast-api-python-sdk
pip install .
```

The vanilla version doesn't have any dependency. For full functionality,
for example for getting the data into `DataFrames`, and for development, use the `[all]` tag:
for example for getting the data into `DataFrames`, and for development, use the `[all]` tag:

```commandline
pip install .[all] for the dev libs
```
Expand All @@ -39,15 +43,32 @@ df = live.radiation_and_weather(
).to_pandas()
```

Don't forget to set your [account Api Key](https://toolkit.solcast.com.au/register) with:
```export SOLCAST_API_KEY={your commercial api_key}```
Don't forget to set your [account Api Key](https://toolkit.solcast.com.au/register) 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.

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.

```commandline
pytest tests
```

### Formatters and Linters

| Language | Formatter/Linter |
| -------- | ---------------- |
| `yaml` | `yamlls` |
| `toml` | `taplo` |
| `python` | `black` |

### Recommended Python Development Version

Develop on the oldest supported `Python` version.

```bash
uv python pin 3.8
```
73 changes: 33 additions & 40 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@ build-backend = "hatchling.build"
name = "solcast"
description = "a simple Python SDK for the Solcast API"
readme = "README.md"
requires-python = ">=3.7"
requires-python = ">=3.8"
license = "Apache-2.0"
classifiers = [
"Intended Audience :: Information Technology",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python",
"Topic :: Internet",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development",
"Topic :: Scientific/Engineering",
"Typing :: Typed",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Intended Audience :: Information Technology",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python",
"Topic :: Internet",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development",
"Topic :: Scientific/Engineering",
"Typing :: Typed",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]

dynamic = ["version"]
Expand All @@ -38,21 +38,7 @@ Documentation = "https://solcast.github.io/solcast-api-python-sdk"
Repository = "https://github.com/Solcast/solcast-api-python-sdk"

[project.optional-dependencies]
docs = [
"pytest",
"mkdocs",
"mkdocs-material",
"mkdocstrings[python]==0.25",
"mkdocs-jupyter",
"kaleido"
]
all = [
"notebook",
"matplotlib",
"pandas",
"black",
"solcast[docs]"
]
all = ["notebook", "matplotlib", "pandas"]

[tool.hatch.version]
path = "solcast/__init__.py"
Expand All @@ -65,9 +51,16 @@ junit_family = "xunit2"

[tool.coverage.run]
parallel = true
source = [
"docs",
"tests",
"solcast"
]
source = ["docs", "tests", "solcast"]
context = '${CONTEXT}'

[dependency-groups]
docs = [
"kaleido>=1.2.0",
"mkdocs>=1.6.1",
"mkdocs-jupyter>=0.24.8",
"mkdocs-material>=9.7.0",
"mkdocstrings[python]==0.26.1",
]
lint = ["black>=24.8.0", "isort>=5.13.2"]
test = ["pytest>=8.3.5"]
8 changes: 3 additions & 5 deletions solcast/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
__version__ = "1.3.0"
__version__ = "1.3.1"

from . import (
api,
aggregations,
forecast,
historic,
live,
pv_power_sites,
tmy,
aggregations,
unmetered_locations,
urls,
pv_power_sites,
)

__all__ = [
Expand Down
6 changes: 1 addition & 5 deletions solcast/aggregations.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
from typing import Optional

from .api import Client, PandafiableResponse
from .urls import (
base_url,
forecast_grid_aggregations,
live_grid_aggregations,
)
from .urls import base_url, forecast_grid_aggregations, live_grid_aggregations


def live(
Expand Down
Loading