Library around SAIH Hidrosur data
Project description
python-saih-hidrosur
What is this lib ?
Python library around S.A.I.H Hidrosur data
How to install the lib ?
You can get it from pypi like so:
pip3 install saih-hidrosur
How to use the lib
>>> import datetime
>>> from pprint import pprint as pprint
>>> from saihhidrosur import get_stations, Station
>>> pprint(get_stations())
{1: 'SIERRA MIJAS (MA)',
2: 'SIERRA DE LUNA (CA)',
3: 'EMBALSE DE CHARCO REDONDO (CA)',
4: 'DEPÓSITO REGULADOR CHARCO RDO (CA)',
5: 'TORRE TOMA DE CHARCO REDONDO (CA)',
6: 'LOS REALES (MA)',
7: 'DEPÓSITO DI-1 (CA)',
8: 'EMBALSE DE GUADARRANQUE (CA)',
...}
>>> murtas = Station(59)
>>> murtas
<MURTAS (GR) with sensors ['TEMPERATURA EXTERIOR', 'NIVOMETRO', 'PLUVIOMETRO']>
>>> murtas.sensors
{'NIVOMETRO': '059N02',
'PLUVIOMETRO': '059P01',
'TEMPERATURA EXTERIOR': '059M02'}
>>> date_from = datetime.datetime(2022, 1, 1)
>>> date_to = datetime.datetime(2022, 1, 2)
>>> murtas.sensor_values('TEMPERATURA EXTERIOR', date_from, date_to)
{datetime.datetime(2022, 10, 1, 0, 0): 15.2,
datetime.datetime(2022, 10, 1, 1, 0): 14.7,
…
datetime.datetime(2022, 10, 1, 23, 0): 17.0,
datetime.datetime(2022, 10, 2, 0, 0): 16.6}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
saih-hidrosur-0.1.tar.gz
(2.2 kB
view hashes)
Built Distribution
Close
Hashes for saih_hidrosur-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbfe7e9e33df1aa9bd6c58c41e6d0172ed990fcfd004bec7432e0022047d5716 |
|
MD5 | b958ef23f806aebf15d4446a0b8908d1 |
|
BLAKE2b-256 | 3d32d2956f5dbf7f3365bca0ea49975301d8bca185cb77d8b7c7700dbc08a76a |