Giter Site home page Giter Site logo

hacf-fr / meteofrance-api Goto Github PK

View Code? Open in Web Editor NEW
68.0 68.0 21.0 1 MB

Python client for Météo-France API. | Client python pour l'API Météo-France

Home Page: https://readthedocs.org/projects/meteofrance-api/

License: MIT License

Python 100.00%
hacktoberfest meteo weather weather-api

meteofrance-api's People

Contributors

balloob avatar bbesset avatar cleming avatar dav1dnix avatar dependabot[bot] avatar dx44 avatar epenet avatar fabaff avatar faizpuru avatar ludovicrousseau avatar oncleben31 avatar quentame avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

meteofrance-api's Issues

Where did you get the API token?

I am also trying to access Météo France's API but I don't know how to get a valid token. Can someone please explain to me how you got it?

PS: I know this isn't the right place for this kind of message, but I don't know where to ask my question... 😅

Hypermodern python setup

Is your feature request related to a problem? Please describe.
Development environment setting rely on lot of manual tasks. Same thing for tests and linting.

Describe the solution you'd like
Apply the best practice from Hypermodern Python blog posts based on poetry and nox.

  • implement poetry
  • implement nox
  • implement lint checks
  • implement type hint checks
  • implement documentation for code
  • implement documentation for test
  • implement best practice for tests
  • improve CI/CD

Describe alternatives you've considered
N/A

Additional context
N/A

Les vitesses de vent ne correspondent pas

Avec l'API, j'obtiens des valeurs de vitesse de vent en dessous de celles affichées sur le site de Météo France.

Par example 14 au lieu de 40 km/h ou 8 au lieu de 15 km/h.

Est-ce que le problème vient de l'unité de la valeur donnée par l'API (km/h et noeuds ne correspondent pas) ou est-ce qu'il y a un calcul à faire avec cette valeur pour obtenir la vitesse réelle ?

J'utilise le champ forecast["wind"]["speed"] pour obtenir la vitesse du vent avec l'API. Est-ce le bon paramètre ou est-ce que je ne sais tout simplement pas utiliser le site de Météo France ?

Edit:
Il semblerai qu'en prenant le double de la valeur de l'API puis en la convertissant en km/h, on trouve la bonne valeur. Est-ce la bonne solution ?

Add description, format and unit of the parameter in the API

Is your feature request related to a problem? Please describe.
#31 shows that it could be appreciated to have a description of the current API with at least units.

Describe the solution you'd like
Could be documentation in code, wiki or external documentation.

Describe alternatives you've considered
N/A

Additional context
Easy for beginners of hacktoberfest.

Rename Python module name with meteofrance_api

Is your feature request related to a problem? Please describe.
Consistency with organization good practice and easier for developers.

Describe the solution you'd like
Rename the Python module and update code.

Describe alternatives you've considered
N/A

Additional context
N/A

Improve tests

Describe the bug
Current test suite is mixing unit tests and end-to-end tests.

We should have a unit test suite to cover 100% of the code. And add some end-to-end tests on top to check the good integration with the Meteo-France REST API.

log
N/A

Example to get historical data

Hi,
Congrats for this project!
How to get historical data with your module?

Example query: daily min temperature for 51100 Reims for date_start=2021-01-01, date_end=2021-07-31

I haven't found an example for historical data in your docs.

Thanks in advance :)

Meteo France Cloud Cover between 10% and 90% - Octas ?

Bonjour l'équipe,

I'm using the meteo France integration for some time now and my values are always between 10% and 90%, never 0 or 100% (see below).

Could it be an error in the units, as cloud cover is normally defined by octas (0/8 to 8/8) ?

image

Requirement is pinned for meteofrance-api 1.0.1: pytz<2021.0,>=2020.4

Describe the bug

Thanks for your support of Home Assistant!

log

(home-assistant) x:~/dev/home-assistant/core$ pip install -r requirements_all.txt
(home-assistant) x:~/dev/home-assistant/core$ pipdeptree -w silence -r -p pytz | grep meteofrance-api
  - meteofrance-api==1.0.1 [requires: pytz>=2020.4,<2021.0]

Weather icons reference ?

[Sorry not really an issue] Hi and thanks a lot for this really usefull API, I've started to use it recently and it's great but it may lack a bit of documentation. I'd like to use this API (instead of OWM api, less accurate in France) to feed my temp sensor and weather screen (using an epaper screen and domoticz) but I can't without weather icons references. In these results the weather_icon is set to "p1bisj" and I don't know where I can find a list of matches between these names and the icons:

Observation(    timezone=Europe/Paris,  time=2023-10-10T09:00:00.000Z,  temperature=19.1°C,     wind_speed=0.7 km/h,   wind_direction=87°,      wind_icon=E,    weather_icon=p1bisj,    weather_description=Peu nuageux)
{'status': 'OK', 'title': 'Update Device'}

I don't minf if it's only a named list (like here p1bisj="Peu nuageux") or a link to an icon set (like p1bisj=p1bisj.png) as I can workaround both solutions.

EDIT: just found out that the icon name can be found on meteo-france website (https://meteofrance.com/modules/custom/mf_tools_common_theme_public/svg/weather/p1bisj.svg) but, once again, a list could be usefull.

Is it possible to find this reference somewhere ?

API return 502 HTTP error when trying to get full warning

Describe the bug
When I try to get the full warnign with the "get_warning_full()" method, I get a 502 HTTP error.
The "get_warning_full()" method seams only work with Paris (75)

log

Traceback (most recent call last):
  File "/var/www/html/weather/weather.py", line 137, in <module>
    get_weather(WXCity)
  File "/var/www/html/weather/weather.py", line 46, in get_weather
    wx_warns = getWarnsFromAPI(anMeteoAPI)
  File "/var/www/html/weather/weather.py", line 35, in getWarnsFromAPI
    my_place_warn = aMeteoAPI.client.get_warning_full(aMeteoAPI.my_place.admin2)
  File "/home/pi/.local/lib/python3.9/site-packages/meteofrance_api/client.py", line 275, in get_warning_full
    resp = self.session.request("get", "warning/full", params={"domain": domain})
  File "/home/pi/.local/lib/python3.9/site-packages/meteofrance_api/session.py", line 52, in request
    response.raise_for_status()
  File "/usr/lib/python3/dist-packages/requests/models.py", line 943, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 502 Server Error: Bad Gateway for url: https://webservice.meteofrance.com/warning/full?token=__<token>__&domain=60

Add Python 3.9 support

Is your feature request related to a problem? Please describe.
Python 3.9 released and will be the version used by HA in few weeks.

Describe the solution you'd like
Add support of Python 3.9 in test suite.

API key for meteoFranceAPI does not give actual phenomenons

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
I had a problem to work with meteofrance-api because the API key doesn't give result of phenomenons in the function : get_warning_current_phenomenoms .
Describe the solution you'd like
A clear and concise description of what you want to happen.

  • Adding the possibility to easily change the API key and API url,
  • (if possible) Adding a new default APIkey that gives actual phenomenons with the function in the file client.py get_warning_current_phenomenoms
    Describe alternatives you've considered
    A clear and concise description of any alternative solutions or features you've considered.
    There's no real alternatives except maybe contacting meteo france concerning the api.
    Additional context
    Add any other context or screenshots about the feature request here.

Générer son propre token ?

Is your feature request related to a problem? Please describe.
Bonjour, c'est un superbe projet ! Le code est vraiment simple à comprendre, c'est très utile car je suis actuellement en train d'utiliser cette API sur Javascript.

Je voudrais savoir, y a-t-il un moyen automatique pour générer son propre token plutôt que d'utiliser celui du repo ? À moins que celui-ci est fiable ?

Describe the solution you'd like
Une méthode permettant de retourner un nouveau token pour utiliser l'API.

Describe alternatives you've considered
Utiliser le token fourni par le repo, et espérer qu'il fonctionne assez longtemps.

Use the v2/observation API endpoint

Is your feature request related to a problem? Please describe.
The meteo-france component in home-assistant uses current_forecast as temperature. Resulting values are discontinuous :

image

I think it is due current_forecast oscillating between observation and next forecasted temperature.

Describe the solution you'd like
A continous temperature.

Describe alternatives you've considered
The v2/observation API endpoint returns latest observation. I think it would be nice to expose it as a new method in client.py.
I've created a PR #520

Possible values of meteofrance-api nextrain

Hello,
The nextrain prediction from the meteo france api is very useful in my case to retract my awnings.
But it would be nice to have a reference of all possible values of weather, or point to the meteofrance api specifications... I couldn't find them

Cheers !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.