OpenWeatherMap Requests
Python package to fetch data from OpenWeatherMap.org using Requests and Requests-cache and get Pandas DataFrame with weather history.
Command Line Interface Usage
Current weather
Get current weather data
$ python openweathermap_requests.py --lon 0.34189 --lat 46.5798114
Historical weather data
Fetch historical weather data from nearest weather station of coordinates (lon=0.34189, lat=46.5798114) from 2014/01/01 to 2014/12/01 using:
$ python openweathermap_requests.py --lon 0.34189 --lat 46.5798114 --range 20140101:20141201
Library Usage
import datetime import logging logger = logging.getLogger() logger.setLevel(logging.DEBUG) from openweathermap_requests import OpenWeatherMapRequests ow = OpenWeatherMapRequests(api_key='', cache_name='cache-openweathermap', expire_after=5*60) (lon, lat) = (0.34189, 46.5798114) # Poitiers data = ow.get_weather(lon=lon, lat=lat) # display current weather data print(data) stations = ow.find_stations_near(lon=lon, lat=lat, cnt=10) # get 10 nearest stations from coordinates (lon, lat) station_id = stations.iloc[0]['station.id'] # get station_id of nearest station start_date = datetime.datetime(2014, 1, 1) end_date = datetime.datetime(2014, 6, 1) data = ow.get_historic_weather(station_id, start_date, end_date) # get historic weather from start date to end date print(data)
Install
From Python package index
$ pip install openweathermap_requests
From source
Get latest version using Git
$ git clone https://github.com/scls19fr/openweathermap_requests.git $ cd openweathermap_requests $ python setup.py install
Links
Documentation can be found at Read The Docs ;
Source code and issue tracking can be found at GitHub.
Feel free to tip me!
Metadata
Release files for openweathermap_requests 0.0.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 |
|---|---|---|---|---|
| openweathermap_requests-0.0.5.tar.gz | 6.4 kB | Without provenance | Details for openweathermap_requests-0.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| openweathermap_requests-0.0.5-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for openweathermap_requests-0.0.5-py2.py3-none-any.whl |
Total release size: 14.9 kB
Release files / openweathermap_requests-0.0.5.tar.gz
| Download URL | openweathermap_requests-0.0.5.tar.gz |
|---|---|
| Size | 6.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f81350e72eda058ffbf5ab99623cf810f44632c0fa6b205945c509c57af90620
|
|
BLAKE2b-256 checksum How to use checksums |
c9c400e9c707349ed99163e62f1f1144bdadf74f4b3ae0a05822a5bb1aaea046
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / openweathermap_requests-0.0.5-py2.py3-none-any.whl
| Download URL | openweathermap_requests-0.0.5-py2.py3-none-any.whl |
|---|---|
| Size | 8.5 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
721290a416a44a8d6308b9fa3a4cd4d4255c792ad5df1279943953c190fc95d0
|
|
BLAKE2b-256 checksum How to use checksums |
7425f2aa31e6895cf45cf33105e056e6c1174d8a1c66abeff400f11fb53b25b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for openweathermap_requests 0.0.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.