gardenpy-meteocat
Reference evapotranspiration (ETo) calculations from Meteocat station data for the Meteocat Home Assistant integration.
gardenpy-meteocat is a Python library that computes the reference evapotranspiration (ETo) locally from the weather data already fetched by the Meteocat Home Assistant integration, following the FAO-56 methodology. This avoids calling the Meteocat XEMA API for the ETo variable (6006), saving quota.
Features
- FAO-56 Penman-Monteith (daily and hourly), the reference standard.
- Nighttime ETo included: the hourly equation computes evapotranspiration during the night when wind is present and humidity is low, matching the behaviour of Meteocat's official ETo since July 2026.
- Hargreaves-Samani fallback when humidity, wind or radiation data are missing.
- Solar radiation estimated from temperature range when no radiometer is available.
- Consumes the same station JSON returned by
MeteocatStationData.get_station_data(no extra API calls). - Returns hourly values in the same format as the Meteocat variable 6006 (
baseHorariaHO), so it can be used as a drop-in replacement.
Installation
pip install gardenpy-meteocat
Quick start
from gardenpy_meteocat import Evapotranspiration
eto = Evapotranspiration(latitude=41.38197, longitude=1.93564, elevation=252)
# station_data is the JSON returned by MeteocatStationData.get_station_data
daily = eto.daily(station_data) # -> {"date", "method", "eto_mm", "inputs"}
hourly = eto.hourly(station_data) # -> {"date", "method", "eto_daily_mm", "codi": 6006, "lectures": [...]}
The hourly() result matches the structure of the Meteocat API variable 6006, allowing it to replace the API call without consuming XEMA quota.
Methods
penman_monteith_daily(tmax, tmin, rh_max, rh_min, u2, rs, latitude, jday, elevation)penman_monteith_hourly(t, rh, u2, rs, latitude, jday, hour, longitude, elevation)hargreaves_samani(tmax, tmin, latitude, jday)estimated_solar_radiation(tmax, tmin, latitude, jday)
All equations follow the FAO-56 documentation (Chapters 3 and 4).
Tests
pip install -e .[test]
pytest
Release
El repositorio incluye un workflow de GitHub Actions (.github/workflows/release.yml)
basado en python-semantic-release. Cada push a la rama master ejecuta los tests y,
si los commits siguen el formato conventional commits, calcula la versión siguiente,
actualiza pyproject.toml y gardenpy/version.py, genera el changelog, crea la tag
vX.Y.Z, crea el release de GitHub y publica el paquete en PyPI — todo automáticamente.
Para publicar una versión nueva no hay que tocar nada a mano; basta con usar mensajes de commit convencionales:
feat: ...→ incremento de versión menor (1.1.0)fix: ...→ incremento de parche (1.0.1)feat!: ...oBREAKING CHANGE:→ incremento de versión mayor (2.0.0)- otros tipos (
docs:,chore:,refactor:, ...) → no generan release
La primera vez, si el repositorio no tiene ninguna tag, es recomendable empujar una
tag base v1.0.0 para que PSR tome como referencia el estado actual antes del flujo
automático (aunque no dispara el workflow, que solo reacciona a push a master).
Requisitos previos:
- La publicación en PyPI usa Trusted Publishing (OIDC, sin tokens). El trusted
publisher debe registrarse una vez en
https://pypi.org/manage/account/publishing/ para el proyecto
gardenpy-meteocatconfigorr/gardenpyy el workflowrelease.yml; la primera publicación crea el proyecto en PyPI. pytestse ejecuta en CI; los ficheros de validación entests/files/deben estar incluidos en el repositorio para que el test contra los datos oficiales se ejecute (si no están, ese test se omite).
License
Apache-2.0
Metadata
Release files for gardenpy-meteocat 1.1.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 | Actions |
|---|---|---|---|---|
| gardenpy_meteocat-1.1.0.tar.gz | 27.8 kB | With provenance | Details for gardenpy_meteocat-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gardenpy_meteocat-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for gardenpy_meteocat-1.1.0-py3-none-any.whl |
Total release size: 49.1 kB
Release files / gardenpy_meteocat-1.1.0.tar.gz
| Download URL | gardenpy_meteocat-1.1.0.tar.gz |
|---|---|
| Size | 27.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
edc8b6ea27dc39e901461d0fec42f83922dc0df5c7254d47388598cc28163792
|
|
BLAKE2b-256 checksum How to use checksums |
ea544cd5fd652748e8fc9c283422919585b0d80af93d8a65025e5b08c49a861f
|
| 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 Aug 1, 2026.
Transparency logRelease files / gardenpy_meteocat-1.1.0-py3-none-any.whl
| Download URL | gardenpy_meteocat-1.1.0-py3-none-any.whl |
|---|---|
| Size | 21.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dec0024e314b967943ce50b34dfc640b90b8ad71d6b477ed8eb7cb29af2fd875
|
|
BLAKE2b-256 checksum How to use checksums |
e606d4c968ac021397e7bc70cb8456e54faeaa3c0c110ecec57303a0624c95e8
|
| 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 Aug 1, 2026.
Transparency logSecurity for gardenpy-meteocat 1.1.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 gardenpy_meteocat-1.1.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 Aug 1, 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.