requests-forecast
For complete docs and API options see: https://developer.forecast.io/docs/v2
Requirements
- Python 3.6+
- requests
Installation
To install requests-forecast, simply:
$ pip install requests-forecast
Documentation
- Development version: http://requests-forecast.rtfd.org.
Quickstart
Creating a client
from requests_forecast import Forecast
forecast = Forecast(apikey='YOUR-API-KEY')
Getting the current conditions
current = forecast.currently()
print current['temperature']
58.9
Getting minutely conditions
current = forecast.minutely()
current['summary']
u'Mostly cloudy for the hour.'
current['data'][0].keys()
[u'precipIntensity', u'time']
Getting hourly conditions
current = forecast.hourly()
current['temperature']
59.52
forecast.hourly()['summary']
Mostly cloudy until tomorrow afternoon.
forecast.hourly()['data'][0]['temperature']
59.52
Getting daily conditions
forecast.daily()['summary']
u'Mixed precipitation off-and-on throughout the week; temperatures peaking at 70\xb0 on Sunday.'
forecast.daily()['data'][0]['temperatureMax']
63.85
forecast.daily()['data'][0]['temperatureMin']
35.05
Getting alerts
forecast.alerts()
{
"expires": 1366898400,
"uri": "http://alerts.weather.gov/cap/wwacapget.php?x=KS124EFAC89CD0.FreezeWarning.124EFAD6F320KS.TOPNPWTOP.8ab7d76a4db42b9136a1a6849a631097",
"title": "Freeze Warning for Douglas, KS"
}
Example usage
from datetime import datetime
from requests_forecast import Forecast
forecast = Forecast(apikey='YOUR-API-KEY')
data = forecast.get(latitude=38.9717, longitude=-95.235)
forecast.currently()['temperature']
58.9
data = forecast.get(latitude=38.9717, longitude=-95.235,
time=datetime(year=2013, month=12, day=29))
forecast.currently()['temperature']
58.9
forecast.currently()['temperature']
36.75
License
New BSD
Metadata
Release files for requests-forecast 1.0.0
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 |
|---|---|---|---|---|
| requests-forecast-1.0.0.tar.gz | 20.1 kB | Without provenance | Details for requests-forecast-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| requests_forecast-1.0.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for requests_forecast-1.0.0-py2.py3-none-any.whl |
Total release size: 25.1 kB
Release files / requests-forecast-1.0.0.tar.gz
| Download URL | requests-forecast-1.0.0.tar.gz |
|---|---|
| Size | 20.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b8dbd3c244bbb54cbb3e295bed8299497ac4f6d1b6b0260971c0545b9c3f7f65
|
|
BLAKE2b-256 checksum How to use checksums |
c95f9d5e24645bdca48766e3aefa04950a458b612c2d415a9207b98d4d198e5a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Release files / requests_forecast-1.0.0-py2.py3-none-any.whl
| Download URL | requests_forecast-1.0.0-py2.py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
2e2e2dba15adb9e6f84cae006767cea8300c3e364caf9f47ccf68397dc5f2c5a
|
|
BLAKE2b-256 checksum How to use checksums |
1c268e4f15daf4a58b045524441208cc33f63f7532b220c6b55897cc6548e4b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Security for requests-forecast 1.0.0
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.