frost-client
This Python client wraps the Frost API. You should read up on those docs before using this client. And be sure to check out met.no's Terms of Use
The main purpose of this client is returns Pandas Dataframes from Frost API data.
This is an unofficial client. We have no relationship to met.no
Documentation: https://frost-client.readthedocs.io/en/latest/
Install
Requires Python 3.7
pip install frost-client
or if you want the response from the API returned as Pandas DataFrame, use:
pip install frost-client[pandas]
or using pipenv:
pipenv install frost-client[pandas]
Usage
The Frost API key should be exposed as a environment variable:
FROST_API_KEY=xxxxxx
or passed as a username parameter when creating and instance of the class.
Get weather data sources
Get all available observation sources (stations) for Hordaland county (12)
from frost.client import APIError, Frost
f = Frost()
res = f.get_sources(county='12')
# return as Pandas Dataframe (requires Pandas installed)
df = res.to_df()
# return IDs of sources as list
ids = res.to_ids_list()
Get available time series
Display available time series for a station (here Bergen - Florida)
from frost.client import APIError, Frost
f = Frost()
res = f.get_available_timeseries(sources=['SN50540'])
# return as Pandas Dataframe
df = res.to_df()
Get observations
Display observations for a station (here Bergen - Florida)
from frost.client import APIError, Frost
f = Frost()
res = f.get_observations(
sources=['SN50540'],
elements=['sum(precipitation_amount P1D)'],
timeoffsets=['PT6H'],
referencetime='2018-01-01/2018-02-01')
df = res.to_df()
See tests for more examples.
Local development
You should use pipenv
Tests
Enable the pipenv with
pipenv shell
Make sure to export env variable
FROST_API_KEY=xxxxxx
To run all tests:
nosetests
To run specific tests:
nosetests tests.test_requests:TestFrostRequests.test_get_sources
Metadata
Release files for frost-client 0.1.4
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 | |
|---|---|---|---|---|
| frost-client-0.1.4.tar.gz | 8.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| frost_client-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.1 kB
Release files / frost-client-0.1.4.tar.gz
| Download URL | frost-client-0.1.4.tar.gz |
|---|---|
| Size | 8.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
27860e41aff86a9ea9b9d8f6dba1ec7657c535a0032ccb07b3698e02b8dc0e0a
|
|
BLAKE2b-256 checksum How to use checksums |
14b8d721bc36833a9ab7556096ba22d077dd83d19a8e8672e363b468898adb05
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.1 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.4
|
Release files / frost_client-0.1.4-py3-none-any.whl
| Download URL | frost_client-0.1.4-py3-none-any.whl |
|---|---|
| Size | 11.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
adaea2f0fdaa9c7d4ba5eb977fe9f590f7c54bee19769269196215d60f18d86c
|
|
BLAKE2b-256 checksum How to use checksums |
d14a53966380833707382cb8f7455d12ab08ed8b00a6cf856c6eb6ed0bbcc2ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.1 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.4
|
Security for frost-client 0.1.4
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.