MeteoFrance_PublicAPI: A Python Wrapper for the MétéoFrance API !
python wrapper of the portail-api.meteofrance.fr datasets
It especially allows to manage easily the API key.
Documentation: antoinetavant.github.io/meteofranceapi (WIP)
Source Code: github.com/antoinetavant/meteofranceapi
Disclaimer
The tool is not officially provided by MétéoFrance.
It is build by trials-and-errors and revers-engineering by an amateur.
Most of the functionalities should work, but it may not be the best way to achieve it.
Installation
Using pip
pip install meteofrance-publicapi
Usage
To use the ressources, you need an account at MeteoFrance. It is free (as in free-beer).
How to get the API key
First register on portail-api.meteofrance.fr
Once your account is activated, several options are possible to use meteofrance-publicapi :
- an API key for the API requested
- a token for the API requested (limited to max 1 hour)
- an Application ID to the classes which will manage the API token.
The Application ID is the recommended use, as it allows to requests dynamically new tokens.
However, you need to keep it a secret !
Obtaining the Application ID
From the website portail-api.meteofrance.fr
- click on the Bonjour User Name button (upper right corner)
- click Mes API
- click "Générer Token" for any API
- scroll down to the
curlfield - The Application Key is the last field of the curl commend :
curl -k -X POST [... ... ...] "Authorization: Basic <YourAPPLICATION_ID>
Examples
Accessing observation data
Observation data are measured by a station. The list of the stations can be accessed by
import meteofrance_publicapi as mpa
observation_client = mpa.Observations(application_id=<YourApplicationID>)
observation_client.list_stations()
| Id_station | Id_omm | Nom_usuel | Latitude | Longitude | Altitude | Date_ouverture | Pack | |
|---|---|---|---|---|---|---|---|---|
| 0 | 01014002 | NaN | ARBENT | 46.278167 | 5.669000 | 534 | 2003-10-01 | RADOME |
| 1 | 01027003 | NaN | BALAN_AERO | 45.833000 | 5.106667 | 196 | 2014-05-26 | ETENDU |
| 2 | 01034004 | NaN | BELLEY | 45.769333 | 5.688000 | 330 | 2001-09-13 | RADOME |
| 3 | 01064001 | NaN | VERIZIEU | 45.777167 | 5.487167 | 281 | 2015-01-01 | ETENDU |
| 4 | 01071001 | NaN | CESSY | 46.310333 | 6.080333 | 507 | 2002-05-01 | RADOME |
| ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 2098 | 98832004 | 91588 | MTGNE SOURCES | -22.143833 | 166.593167 | 773 | 1989-08-01 | ETENDU |
| 2099 | 98832005 | NaN | OUINNE | -21.984000 | 166.680500 | 54 | 1974-01-01 | ETENDU |
| 2100 | 98832006 | NaN | RIVIERE BLANCHE | -22.132667 | 166.726333 | 171 | 2000-11-01 | ETENDU |
| 2101 | 98832101 | NaN | GORO_ANCIENNE_PEPINIERE | -22.269167 | 166.967500 | 298 | 1995-01-01 | ETENDU |
| 2102 | 98833002 | NaN | MEA | -21.455500 | 165.767333 | 571 | 1988-01-01 | ETENDU |
Accessing Arome Forecasts
See the notebook Arome Forecast for examples of accessing the forecast of the AROME model.
TODO
- Add local cache capabilities, for instance with joblib
- Add persistent storage, locally or with a could provider
Metadata
Release files for meteofrance-publicapi 0.1.5
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 |
|---|---|---|---|---|
| meteofrance_publicapi-0.1.5.tar.gz | 22.8 kB | Without provenance | Details for meteofrance_publicapi-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| meteofrance_publicapi-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for meteofrance_publicapi-0.1.5-py3-none-any.whl |
Total release size: 43.8 kB
Release files / meteofrance_publicapi-0.1.5.tar.gz
| Download URL | meteofrance_publicapi-0.1.5.tar.gz |
|---|---|
| Size | 22.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
180aa1e8767749359f8bc26fb28787290a346d1dfc02e8270b9fb586eb6d9cb6
|
|
BLAKE2b-256 checksum How to use checksums |
cd1d66f9b504a14f366c0f8f6ff5c94a9cb6ebf60fc8926650f537b3c485ff3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.9.21
|
Release files / meteofrance_publicapi-0.1.5-py3-none-any.whl
| Download URL | meteofrance_publicapi-0.1.5-py3-none-any.whl |
|---|---|
| Size | 20.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b80b2067e61053957488c6dbc88f7c7515ddb188d5e9c80c9fa284e853aa3861
|
|
BLAKE2b-256 checksum How to use checksums |
5e349bedd699e601265662e41b55b7c8105d038d29b04af4f746c6df1dc342f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.9.21
|
Security for meteofrance-publicapi 0.1.5
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.