sondera
Overview
sondera is a python package providing clients for accessing Swedish hydrology and meteorology related open data and observations. Data sources currently include SMHI open data API and SGU groundwater API.
Development Status: Pre-Alpha. Consider the API unstable, it may change at short or no notice.
Data sources and licenses
It is the end users responsibility to adhere to the license of each respective data provider. See the links to the licenses below.
The following clients are currently implemented or under implementation:
Observations
- SMHI Open Data Meteorological Observations (license, host link)
- SMHI Open Data Hydrological Observations (license, host link)
- SGU Groundwater level time series (license, host link)
Model products
Requirements and installation
Requirements:
numpy
pandas
geopandas
requests
tqdm
Install from pypi using pip
pip install sondera
General description and example usage
Observational data which is linked to a station is returned as a DataSeries object, which contains metadata information in addition to the observed data series.
Modelling products are returned as the data series only, which is either a pandas Series or DataFrame, or xarray for multi-dimensional data.
# Example getting hourly air temperature for the latest months from
# SMHI station Stockholm-Observatoriekullen A (number 98230)
from sondera.clients.smhi import MetObsClient, ParametersMetObs
client = MetObsClient()
# For the parameter we can pass either the ParametersMetObs enum
# or simply the SMHI integer id (which is 1 for hourly air temperature)
air_temp = client.get_observations(parameter=ParametersMetObs.TemperatureAirHour,
station=98230,
period='latest-months')
# observations are stored under "data" attribute as a pandas.Series
air_temp.data.head(5)
timestamp
2021-12-31 01:00:00 4.9
2021-12-31 02:00:00 4.2
2021-12-31 03:00:00 3.5
2021-12-31 04:00:00 3.1
2021-12-31 05:00:00 3.0
Name: TemperatureAirHour, dtype: float64
# additional data, such as quality tags are stored under "aux_data"
air_temp.aux_data.head(5)
quality
timestamp
2021-12-31 01:00:00 G
2021-12-31 02:00:00 G
2021-12-31 03:00:00 G
2021-12-31 04:00:00 G
2021-12-31 05:00:00 G
# information on the station is also available, such as name, id, coordinates,
# and history
air_temp.station
Station(name='Stockholm-Observatoriekullen A', id=98230, agency='SMHI',
position=Coordinate(y=59.341681, x=18.054928, z=43.133, epsg_xy=4326, epsg_z=5613),
station_type=<StationType.MetStation: 2>, active_station=True,
active_period=[Timestamp('1996-10-01 00:00:00'), Timestamp('2022-05-10 07:00:00')],
last_updated=Timestamp('2022-05-10 07:00:00'), station_info={},
position_history=[{'from': Timestamp('1996-10-01 00:00:00'),
'to': Timestamp('2022-05-10 07:00:00'),
'position': Coordinate(y=59.341681, x=18.054928, z=43.133,
epsg_xy=4326, epsg_z=5613)}])
Feedback and issues
Please report issues here: https://github.com/rhkarls/sondera/issues
General feedback is most welcome, please post that as well under issues.
MIT License
Copyright (c) 2021, Reinert Huseby Karlsen
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Metadata
Release files for sondera 0.0.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 | Actions |
|---|---|---|---|---|
| sondera-0.0.4.tar.gz | 20.0 kB | Without provenance | Details for sondera-0.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sondera-0.0.4-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for sondera-0.0.4-py2.py3-none-any.whl |
Total release size: 42.0 kB
Release files / sondera-0.0.4.tar.gz
| Download URL | sondera-0.0.4.tar.gz |
|---|---|
| Size | 20.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c4520f30063849f1183d7d6144520de33814743f04a21fd0e802dfdec1735d28
|
|
BLAKE2b-256 checksum How to use checksums |
ee1f0eb3658f8fefccff62391a31714d0c5a0ce60ce124ebcc4136a6966eb42a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.5
|
Release files / sondera-0.0.4-py2.py3-none-any.whl
| Download URL | sondera-0.0.4-py2.py3-none-any.whl |
|---|---|
| Size | 22.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
b6d12ac17bf842503da5dcf688bc12d640e33bf6c97a2f02fa41611280caa9a4
|
|
BLAKE2b-256 checksum How to use checksums |
42ef7fbfacad09a898010672d91e71b528e66d7c907f7c5ffc63730508b1d6a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.5
|
Security for sondera 0.0.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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.