Python wrapper for the frost.met.no API
Project description
# frost-client
This Python client wraps the [Frost API](https://frost.met.no/concepts#getting_started). You should
read up on those docs before using this client. And be sure to check out met.no's
[Terms of Use](https://frost.met.no/termsofuse)
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
## Install
`pipenv install git+https://github.com/bergenstidende/frost-client.git@master#egg=frost-client`
This will install the frost-client and 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
```
from client import APIError, Frost
f = Frost()
res = self.f.get_sources(county='12')
# return as Pandas Dataframe
df = res.to_df()
# return IDs of sources as list
ids = res.to_ids_list()
```
## 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`
This Python client wraps the [Frost API](https://frost.met.no/concepts#getting_started). You should
read up on those docs before using this client. And be sure to check out met.no's
[Terms of Use](https://frost.met.no/termsofuse)
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
## Install
`pipenv install git+https://github.com/bergenstidende/frost-client.git@master#egg=frost-client`
This will install the frost-client and 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
```
from client import APIError, Frost
f = Frost()
res = self.f.get_sources(county='12')
# return as Pandas Dataframe
df = res.to_df()
# return IDs of sources as list
ids = res.to_ids_list()
```
## 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`
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
frost-client-0.1.tar.gz
(6.9 kB
view hashes)
Built Distribution
Close
Hashes for frost_client-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b40a9a393fac2f5de844ef1e535954281eca4fa1157b583759084cced2d159b6 |
|
MD5 | cf69129e21ad56f79c9b67f4e9ffbe42 |
|
BLAKE2b-256 | 30731b2d62192ca1b857f2852f5f8b138790cc5ddf966d67a0bda05f17626c20 |