Closed Wanhenri closed 4 years ago
Leitura realizada diretamente do link ftp:
import requests
import json
url="http://ftp.cptec.inpe.br/modelos/tempo/BAM/TQ0666L064/recortes/grh/json/2020/01/27/00/220.json"
response_forecast = requests.get(url)
json_res_forecast = response_forecast.json()
print(json.dumps(json_res_forecast, indent=2, sort_keys=True))
Após a atualização no código do link, foi feito um teste usando o Postman. Durante o teste ocorreu uma grande demora no processamento da informação. Ainda sem uma solução para essa demora.
Baixar os dados utilizando o Python?
Realizará a leitura diretamente do link?
Será necessário acrescentar etapas no diretório api:
Script no diretório routes;
Realizar a chamada no server.py
Assim finalizando essa primeira parte dessa nova API JSON.
Desenvolvido um endpoint para a API wrf_ams05km.
Realizar a implantação da leitura dos json do modelo de chuva do INPE que esta disponível nos links:
link 1 link 2
Dúvidas:
today = date.today() d = today.strftime("%Y%m%d")
dir = "/home/smagnum/Documentos/INPE2020/projeto1-0-0" local_dir = dir + "inicio09012020-outroRun-outroRUN"
dir_tmp = dir + "/tmp"
print("Today's date:", d) for i, z in zip(range(12,240,24), range(0,10,1)): a = f'{i:03}' print("http://dd.weather.gc.ca/model_gem_global/25km/grib2/lat_lon/00/"+ a + "/CMC_glb_ACPCP_SFC_0latlon.24x.24"+ d +"00_P" + a + ".grib2") urllib.request.urlretrieve("http://dd.weather.gc.ca/model_gem_global/25km/grib2/lat_lon/00/"+ a + "/CMC_glb_ACPCP_SFC_0latlon.24x.24"+ d +"00P" + a + ".grib2", "GDPS"+ str(z) + ".grb2")