Code Monkey home page Code Monkey logo

python-saih-hidrosur's Introduction

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}

python-saih-hidrosur's People

Contributors

frankkkkk avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.