Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.6] - February, 2026
### Features
* Added the ability to retrieve observations from a single station at a time.
* Updated tests and documentation to reflect these additions
See #21

## [0.2.5] - January, 2026
### Bugs
Depending on the indicators, the geographic boundary envelope of the indicators may have a height component or other components.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "meteole"
version = "0.2.5"
version = "0.2.6"
requires-python = ">3.8.0"
description = "A Python client library for forecast model APIs (e.g., Météo-France)."
readme = "README.md"
Expand Down
11 changes: 10 additions & 1 deletion src/meteole/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,18 @@
from meteole._arome_ensemble import AromePEForecast
from meteole._arome_instantane import AromePIForecast
from meteole._arpege import ArpegeForecast
from meteole._dpclim import DPClim
from meteole._piaf import PiafForecast
from meteole._vigilance import Vigilance

__all__ = ["AromeForecast", "AromePIForecast", "ArpegeForecast", "PiafForecast", "Vigilance", "AromePEForecast"]
__all__ = [
"AromeForecast",
"AromePIForecast",
"ArpegeForecast",
"PiafForecast",
"Vigilance",
"AromePEForecast",
"DPClim",
]

__version__ = version("meteole")
32 changes: 32 additions & 0 deletions src/meteole/_dpclim.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from __future__ import annotations

import logging
from typing import final

from meteole.clients import BaseClient, MeteoFranceClient
from meteole.climat import WeatherObservation

logger = logging.getLogger(__name__)


@final
class DPClim(WeatherObservation):
"""Access the "Données Climatologiques" data from Meteo-France API.

Doc:
- https://https://portail-api.meteofrance.fr/web/fr/api/DonneesPubliquesClimatologie
"""

# Model constants
MODEL_NAME: str = "DPClim"
BASE_ENTRY_POINT: str = "DPClim"
CLIENT_CLASS: type[BaseClient] = MeteoFranceClient

def _validate_parameters(self) -> None:
"""Check the territory and the precision parameters.

Raise:
ValueError: At least, one parameter is not good.
"""
if self.frequency not in ("6m", "hourly", "daily", "decade", "monthly"):
raise ValueError("Parameter `frequency` must be in ('6m','hourly', 'daily', 'decade', 'monthly').")
9 changes: 8 additions & 1 deletion src/meteole/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ class HttpStatus(int, Enum):
"""Http status codes"""

OK = 200
FILE_SENT = 201
REQUEST_ACCEPTED = 202
ORDER_NOT_READY = 204
BAD_REQUEST = 400
UNAUTHORIZED = 401
FORBIDDEN = 403
Expand Down Expand Up @@ -118,7 +121,11 @@ def get(self, path: str, *, params: dict[str, Any] | None = None, max_retries: i
try:
resp: Response = self._session.get(url, params=params, verify=self._verify)

if resp.status_code == HttpStatus.OK:
if (
resp.status_code == HttpStatus.OK
or resp.status_code == HttpStatus.REQUEST_ACCEPTED
or resp.status_code == HttpStatus.FILE_SENT
):
logger.debug("Successful request")
return resp

Expand Down
Loading