This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, os.path | |
import sys | |
import re | |
import requests | |
import lxml.html | |
class Scraper(object): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
import pandas as pd | |
anos = range(2003, 2015) | |
planilhas = {ano: pd.read_excel('basedadosexecucao{}.xls'.format(ano)) for ano in anos} | |
colunas = {ano: [col for col in planilha.columns] for ano, planilha in planilhas.iteritems()} | |
colunas_novas = sorted(list(set(list(itertools.chain(*[[col.upper() for col in cols] for _, cols in colunas.items()]))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import unicodedata | |
import sqlalchemy | |
import sqlalchemy.orm | |
from datapackage import DataPackage | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import date, timedelta | |
import os, os.path | |
import sys | |
import requests | |
import lxml.html | |
class DateIterator(object): | |
def __init__(self, start_date, end_date): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**** Parte html ****/ | |
<!-- Só criar quantos containers precisar //--> | |
<div id="preview1"></div> | |
<div id="preview2"></div> | |
<div id="preview3"></div> | |
/**** Parte javascript ****/ | |
require(['jquery', 'map.jquery'], function($) { | |
/* Nao precisa criar esses objetos, soh criei para ter onde armazenar mais organizadamente algumas referencias */ | |
var preview1 = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Funcao sincrona que devolve uma string | |
var devolveTextoSincrono = function ( valor ) { | |
return 'Devolve um texto concatenado com ' + valor; | |
}; | |
// Funcao assincrona que devolve uma "promessa" de uma string | |
var devolveTextoAssincrono = function ( valor ) { | |
// Cria o objeto "deferred" | |
var dfd = $.Deferred(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
######################################################################## | |
# # | |
# Licença: Este código é de uso livre, exceto para criar interfaces # | |
# horríveis que destoem e comprometam a coerência visual do ambiente # | |
# de trabalho do usuário ;) # | |
# # | |
######################################################################## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
######################################################################## | |
# # | |
# Licença: Este código é de uso livre, exceto para criar interfaces # | |
# horríveis que destoem e comprometam a coerência visual do ambiente # | |
# de trabalho do usuário ;) # | |
# # | |
######################################################################## |