Skip to main content

A wrapper of the portail-api.meteofrance.fr datasets

Project description

meteofranceapi

python wrapper of the portail-api.meteofrance.fr datasets

Disclaimer

The tool is not officialy provided by MétéoFrance.

It is build by trials-and-errors.

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

Register an account and get the API key

You need an account on https://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.

Obtaining the Application ID

From the website https://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 curl field
  • 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

TODO

  • Add local cache capabilities, for instance with joblib
  • Add persistent storage, locally or with a could provider

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

meteofrance-publicapi-0.1.1.tar.gz (47.4 kB view details)

Uploaded Source

Built Distribution

meteofrance_publicapi-0.1.1-py3-none-any.whl (34.5 kB view details)

Uploaded Python 3

File details

Details for the file meteofrance-publicapi-0.1.1.tar.gz.

File metadata

  • Download URL: meteofrance-publicapi-0.1.1.tar.gz
  • Upload date:
  • Size: 47.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for meteofrance-publicapi-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0a723ec902c107b24c409684d74db1253670325d9f029b231915e5dd40765abd
MD5 a94f93f1efd7df17d665f39fc0817a06
BLAKE2b-256 f63fabdd61de97612b747758301a235bdc2faa681202821615455710aa5d814f

See more details on using hashes here.

File details

Details for the file meteofrance_publicapi-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for meteofrance_publicapi-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 879a8202c54cf5218494424b6052192a159b42b26f9bf10ab40fdb1dba9f8cab
MD5 846f579ef683938cc2b4948c400d9cbf
BLAKE2b-256 787ccb9c3a313afc301eecfe466f1ab26793a44e24d29dc25e5f00a1cc5140b5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page