Skip to content
Snippets Groups Projects
Commit 30c04ea8 authored by Alexander Martínez Méndez's avatar Alexander Martínez Méndez
Browse files

Correcciones en requerimientos por dependencias

parent b773c575
No related branches found
No related tags found
No related merge requests found
Pipeline #2061 failed with stages
in 1 minute and 39 seconds
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
# Uso del API MakeSens # Uso del API MakeSens
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
Instalar Librerias Instalar Librerias
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` ```
#!pip install APIMakeSens #!pip install APIMakeSens
#!pip install tk #!pip install tk
``` ```
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
Cargar librería *MakeSens* Cargar librería *MakeSens*
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` ```
# Makesens # Makesens
from MakeSens import MakeSens from MakeSens import MakeSens
# Pandas # Pandas
import pandas as pd import pandas as pd
# datetime para manejo de fechas # datetime para manejo de fechas
import datetime import datetime
# pytz para manejo de zonas horarias # pytz para manejo de zonas horarias
import pytz import pytz
``` ```
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
Definir token y cargar listado de estaciones Definir token y cargar listado de estaciones
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` ```
token = 'tokenUsr' token = 'tokenUsr'
estaciones = pd.read_csv("evas.csv") estaciones = pd.read_csv("evasLA-CoNGA.csv")
``` ```
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
Definir rango de fechas para descarga Definir rango de fechas para descarga
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` ```
fechaFin = datetime.datetime.now(pytz.timezone('America/Bogota')).strftime('%Y-%m-%d %H:%M:%S') fechaFin = datetime.datetime.now(pytz.timezone('America/Bogota')).strftime('%Y-%m-%d %H:%M:%S')
fechaInicio = (datetime.datetime.now(pytz.timezone('America/Bogota'))-datetime.timedelta(hours=1)).strftime('%Y-%m-%d %H:%M:%S') fechaInicio = (datetime.datetime.now(pytz.timezone('America/Bogota'))-datetime.timedelta(hours=1)).strftime('%Y-%m-%d %H:%M:%S')
``` ```
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` ```
for eva in estaciones["id"]: for eva in estaciones["id"]:
data = MakeSens.download_data(eva, fechaInicio, fechaFin, 'h', token, None) data = MakeSens.download_data(eva, fechaInicio, fechaFin, 'h', token, None)
if data.empty: if data.empty:
print(eva, 'Offline') print(eva, 'Offline')
else: else:
print(eva, data['temperatura'][0]) print(eva, data['temperatura'][0])
``` ```
%% Output %% Output
DE2_00010 Offline DE2_00010 Offline
DE2_00011 Offline DE2_00011 Offline
DE2_00012 22.36809542857143 DE2_00012 22.36809542857143
DE2_00013 Offline DE2_00013 Offline
DE2_00014 Offline DE2_00014 Offline
DE2_00015 Offline DE2_00015 Offline
DE2_00016 23.72797557142857 DE2_00016 23.72797557142857
DE2_00017 16.2979185 DE2_00017 16.2979185
DE2_00018 27.151353375 DE2_00018 27.151353375
DE2_00019 Offline DE2_00019 Offline
......
# dependencia MakeSens
tk
click
matplotlib
seaborn
# API MakeSens # API MakeSens
APIMakeSens APIMakeSens
# tk (dependencia MakeSens)
tk
# Pandas # Pandas
pandas pandas
...@@ -12,3 +15,4 @@ datetime ...@@ -12,3 +15,4 @@ datetime
# pytz para manejo de zonas horarias # pytz para manejo de zonas horarias
pytz pytz
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment