python API python to get active weather alerts fromhttp://vigilance.meteofrance.com/
Project description
Vigilance Météo
Vigilance Météo provides a python API to fetch weather alerts in France or Andorre from Météo France (http://vigilance.meteofrance.com) website.
Class descritpion
ZoneAlerte class allows to fetch active weather alerts for a french department or Andorre.
Public Methods from ZoneAlerte class:
mise_a_jour_etat()
: update alerts list by feching latest info from MétéoFrance forcast.message_de_synthese(msg_format)
: return a string with textual synthesis of the active weather alerts in the department. Depending of themsg_format
value, the string change:'text'
(default) or'html'
.
Public attributes from ZoneAlerte class
synthese_couleur
: return the overall criticity color for the department.url_pour_en_savoir_plus
: return the URL to access more information about department weather alerts on the MétéoFrance website.date_mise_a_jour
: return latest bulletin update date & time.departement
: get or set the department number corresponding to the area watched. Should be a 2 characters string.liste_alertes
: return the list of active alerts.
Examples
>>>import vigilancemeteo
>>>zone = vigilancemeteo.ZoneAlerte('92')
>>>zone.synthese_couleur
'Jaune'
>>>zone.url_pour_en_savoir_plus
'http://vigilance.meteofrance.com/Bulletin_sans.html?a=dept75&b=1&c='
>>>zone.message_de_synthese('text')
'Alerte météo Jaune en cours :\n - Vent violent: Jaune'
Installation
You can use official release using the pyPi package. Install it with the command:
pip install vigilancemeteo
Contribute
If you want to contribute to the development:
- Start by cloning this repository.
- Setup a virtual environment
- Install the python package in edition mode:
pip install -e .
- Create a branch for your feature
- Test your change using
tox
- Send a PR when ready.
References
Thank you to Lunarok to show an implementation example in PHP for Jeedom. Lot of inspiration for this python implementation.
License
This software is under the MIT License.
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
Built Distribution
Hashes for vigilancemeteo-2.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50f4710079ff3418950b66320864e07a81b0b310485903d34b5513ec74f9f1f9 |
|
MD5 | 967ccac5e16bac7aeba4d10573837d01 |
|
BLAKE2b-256 | c448a191f5e075e65a1d9b02a87af437abf0c4310419f1f5c19bb1d098182ec3 |