Skip to content

Instantly share code, notes, and snippets.

View gabrielacaesar's full-sized avatar
🎯
Focusing

Gabriela Caesar gabrielacaesar

🎯
Focusing
View GitHub Profile
@yanofsky
yanofsky / LICENSE
Last active June 5, 2024 21:51
A script to download all of a user's tweets into a csv
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@fmasanori
fmasanori / QEduAvancada2.py
Last active October 22, 2019 17:11
QEdu exemplo de Busca Avançada: escolas, em funcionamento, sem água, energia e esgoto, mostrando alguns detalhes
#The context of this program is a course of an hour to journalists who know nothing about programming in a lab with Python 3 only.
import urllib.request
import json
def analisa_detalhe(cod):
url = 'http://educacao.dadosabertosbr.com/api/escola/'
resp = urllib.request.urlopen(url+str(cod)).read()
resp = json.loads(resp.decode('utf-8'))
if int(resp['salasExistentes']) > 1:
print ('Salas Existentes:', resp['salasExistentes'])
@fmasanori
fmasanori / super salários USP.py
Created July 4, 2017 23:27
Super Salários USP
"""
Autores:
Tiago Henrique da Cruz Pereira
João Felipe de Moraes Borges
"""
import threading
import time
import os
from urllib.request import urlopen
@fmasanori
fmasanori / Raspa_salarios_UFRJ.py
Last active July 12, 2018 20:40
Raspa 15 mil vencimentos da UFRJ e mostra os maiores
import requests
from bs4 import BeautifulSoup as bs
u = 'http://www.portaldatransparencia.gov.br/servidores/OrgaoLotacao-ListaServidores.asp?CodOS=15000&DescOS=MINISTERIO%20DA%20EDUCACAO&CodOrg=26245&DescOrg=UNIVERSIDADE%20FEDERAL%20DO%20RIO%20DE%20JANEIRO&Pagina='
base = 'http://www.portaldatransparencia.gov.br/'
def extrai_valor(u):
j = u.find('=') + 1
k = u.find('&', j)
id_servidor = u[j: k]
@dannguyen
dannguyen / _inclass-spatial-sql-and-joins.md
Last active May 29, 2021 20:19
padjo-2017 Spatial SQL and joins
@fmasanori
fmasanori / raspa_cnj.py
Last active April 26, 2019 19:13
Raspa os mandados da BNMP
import requests
import json
import pymongo
connection = pymongo.MongoClient("mongodb://localhost")
db = connection.bnmp
mandados_mongoDB = db.mandados
cabeçalho = {
'Host': 'www.cnj.jus.br',
import re
titles = ['Deputado Federal ', 'General ', 'Ex-presidente ', 'Senadora ', 'Senador ', 'do Exército', 'Tenente-Brigadeiro']
novas_linhas = []
for _, row in agenda2016_limpa_final.iterrows():
nova_linha = [row["oque"], row["onde"], row["ano"], row["mes"], row["dia"], row["hora"]]
pessoas = [re.sub('|'.join(titles),'',i.split(', ')[0]) for i in row["oque"].split('; ')]
for pessoa in pessoas:
linha_com_pessoa = nova_linha[:] # o lista[:] eh para copiar a lista
linha_com_pessoa.append(pessoa)
novas_linhas.append(linha_com_pessoa)
@lgelape
lgelape / stopwords_pt.R
Last active March 7, 2023 18:45
Create a dataset with stopwords in Portuguese (from Stopwords ISO, tidytext and tm packages)
### STOPWORDS IN PORTUGUESE
## Create a unique dataset from several datasets with stopwords in Portuguese
# Lucas Gelape
# Packages
library(dplyr)
library(stringi)
library(readr)