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.
Classes descritpion
VigilanceMeteoFranceProxy class manages the communication with the source website. The
algorithm request a cheksum tiny file to download and update the XML source only when
needed.
DepartmentWeatherAlert class allows to fetch all weather alerts for a french department or Andorre. Each DepartmenWeatherAlert instance can have its own proxy, but you should use
only one proxy for all DepartmenWeatherAlert instances in your program to avoid too much HTTP request on source website.
Public attributes from DepartmentWeatherAlert class
department_color: return the overall criticity color for the departmentadditional_info_URL: return the URL to access more information about department weather alerts from the MétéoFrance websitebulletin_date: return the latest bulletin update date & time with timezonedepartment: get or set the department number corresponding to the area watchedalerts_list: return the list of all alert typesproxy: return the client (aVigilanceMeteoFranceProxyinstance) used by the object
Public methods from DepartmentWeatherAlert class
update_department_status(): update alerts list by feching latest info from MétéoFrance forcast.summary_message(format): return a string with textual synthesis of the active alerts in department. According to value of 'format' parameter, the string return change: 'text' (default) or 'html'
Public attributes from VigilanceMeteoFranceProxy class
xml_tree= XML representation of the weather alert bulletinbulletin_date= Date of the bulletin (with timezone)checksum= Checksum of the weather alert bulletinstatus= current status of the proxy (possible value inconstant.py)
Public Methods from VigilanceMeteoFranceProxyclass
update_date(): Check if new information are available and download them if any.get_alert_list(department): of a given department return the list of the alerts.
Examples
>>>import vigilancemeteo
>>>zone = vigilancemeteo.DepartmentWeatherAlert('92')
>>>zone.department_color
'Jaune'
>>>zone.additional_info_URL
'http://vigilance.meteofrance.com/Bulletin_sans.html?a=dept75&b=1&c='
>>>zone.summary_message('text')
'Alerte météo Jaune en cours :\n - Vent violent: Jaune'
Installation
You can use the 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 the first python implementation.
Since release 3.0.0, the python implementation use the the recommendation made by Météo France on www.data.gouv.fr.
License
This software is under the MIT License.
Metadata
Release files for vigilancemeteo 3.0.1
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 |
|---|---|---|---|---|
| vigilancemeteo-3.0.1.tar.gz | 11.5 kB | Without provenance | Details for vigilancemeteo-3.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vigilancemeteo-3.0.1-py3-none-any.whl | Python 3 | none | any | Details for vigilancemeteo-3.0.1-py3-none-any.whl |
Total release size: 22.3 kB
Release files / vigilancemeteo-3.0.1.tar.gz
| Download URL | vigilancemeteo-3.0.1.tar.gz |
|---|---|
| Size | 11.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
70b8f957b5c8f13b2e7a0724f97aba0366161926f774b5013793c6d53f3f6fc0
|
|
BLAKE2b-256 checksum How to use checksums |
fd3db14faaee7556a7977fd7e8ee81a007dbe9678dcad7b904c8b8595d840b29
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
|
Release files / vigilancemeteo-3.0.1-py3-none-any.whl
| Download URL | vigilancemeteo-3.0.1-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
acf2ba81f9b1b066309ee0f5b5be6db19e63595b11db00336ffbb1a30463229f
|
|
BLAKE2b-256 checksum How to use checksums |
55f4ad32178fb9d4c7c0e7b1d2594e0d001a23e374758c86c9e7236474b2efaa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
|
Security for vigilancemeteo 3.0.1
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.