Skip to content

Instantly share code, notes, and snippets.

@villares
Forked from fmasanori/QEduAvancada.py
Created May 23, 2017 12:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save villares/a70696ac04f48c7ce96e5427369f3f02 to your computer and use it in GitHub Desktop.
Save villares/a70696ac04f48c7ce96e5427369f3f02 to your computer and use it in GitHub Desktop.
QEdu Exemplo de Busca Avançada: escolas, em funcionamento, sem energia, água e esgoto
import urllib.request
import json
url = 'http://educacao.dadosabertosbr.com/api/escolas/buscaavancada?situacaoFuncionamento=1&energiaInexistente=on&aguaInexistente=on&esgotoInexistente=on'
resp = urllib.request.urlopen(url).read()
resp = json.loads(resp.decode('utf-8'))
print ('Número de Escolas em funcionamento sem energia, água e esgoto:', resp[0])
for x in resp[1]:
print (x['nome'], x['cod'])
print (x['cidade'], x['estado'], x['regiao'])
print ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment