This file contains hidden or 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 requests | |
import json | |
import pymongo | |
connection = pymongo.MongoClient("mongodb://localhost") | |
db = connection.bnmp | |
mandados_mongoDB = db.mandados | |
cabeçalho = { | |
'Host': 'www.cnj.jus.br', |
This file contains hidden or 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
https://gist.github.com/fmasanori/ee2b554ee6e05f298d5014bcbf730fd7 | |
Cats | |
Abdul Abel Abelarda Abelardo Abelhinha Abigail Abner Abu Acacia Ace Acerola Adda Adonis Adrik Adry Afrodite Agapi Agostinho Agripina(o) Aiara Aícha Aika(o) Aiki Aila Aileen Aima Aimee Aislan Aiwa Akan Akaya Akenaton Akesa Alanis Alec Alecrim Aleetza Alef Alegria Aleluia Alemã Alemão Aleska Alex Alf Alfa Alface Algodão Alice Alicia Alika Alina Alisson Alita Alladim Alma Almôndega Aloha Alone Alpha Alphi Alvinha Amapola Amaral Amarula Amaya Ambar Amber Ameli Amendoim Amie Amiga(o) Amigão Amiguinha(o) Amin Amira Amon Amor Amora Amoreko Amoroso Amy Anakin Anda Andie Andora Andy Angel Angra Angus Anjinha Anjinho Anúbis Anukh Apache Apagão Aphou Apiá Apoena Apolo Apple April Aquiles Arã Arabi Aragon Aramis Aranha Arashi Archie Arena Aretha Argos Ariadne Ariel Ariela Arine Aristóteles Arkan Armani Aroeira Aron Arrepio Arteira Artemis Arthur Aruan Aruane Aruck Aruska Ashley Aska Asla Aslam Aspen Asrama Assombroso Aster Asterix Asthar Astolfo As |
This file contains hidden or 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
f = open('UFRJ.txt') | |
dic = {} | |
for linha in f: | |
id_servidor, nome, valor = linha.strip().split(',') | |
dic[id_servidor] = [nome, float(valor)] | |
f.close() | |
def salário(a): return a[1][1] | |
maiores = sorted(dic.items(), key=salário, reverse=True) | |
for f in maiores[:50]: |
This file contains hidden or 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 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] |
This file contains hidden or 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 | |
import csv | |
linhas = 0 | |
def extrai_valores(t): | |
k = 1 | |
while True: | |
j = k | |
k = t.find(' ', k) | |
k += 1 |
This file contains hidden or 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 PyPDF2 | |
import os | |
import os.path | |
def traduz(f): | |
pdfFileObj = open(f, 'rb') | |
try: | |
pdfReader = PyPDF2.PdfFileReader(pdfFileObj) | |
except: | |
print (f, 'corrompido') |
This file contains hidden or 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 requests | |
from bs4 import BeautifulSoup as bs | |
from urllib.request import urlretrieve | |
u1 = 'https://www.al.sp.gov.br/alesp/pesquisa-proposicoes/?direction=acima&lastPage=5167¤tPage=' | |
u2 = '&act=detalhe&idDocumento=&rowsPerPage=10¤tPageDetalhe=1&tpDocumento=&method=search&text=&natureId=4005&legislativeNumber=&legislativeYear=&natureIdMainDoc=loa&anoDeExercicio=&legislativeNumberMainDoc=&legislativeYearMainDoc=&strInitialDate=01%2F01%2F2010&strFinalDate=31%2F12%2F2014&author=&supporter=&politicalPartyId=&tipoDocumento=&stageId=&strVotedInitialDate=&strVotedFinalDate=' | |
base = 'https://www.al.sp.gov.br' | |
def baixa_pdf(u, nome): | |
url = base + u | |
fim = nome.find('-') - 1 | |
nome = nome.replace('/', '-') |
This file contains hidden or 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 | |
""" | |
Converts PDF text content (though not images containing text) to plain text, html, xml or "tags". | |
""" | |
import sys | |
import logging | |
import six | |
import pdfminer.settings | |
pdfminer.settings.STRICT = False |
This file contains hidden or 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 requests | |
from bs4 import BeautifulSoup as bs | |
import string | |
pets = [] | |
for pet in ('Gatos', 'Caes'): | |
for letra in string.ascii_uppercase: | |
for k in (1, 2, 3): | |
u = 'https://www.bayerpet.com.br/%s/lista-nomes/%s%s' %(pet, letra, str(k)) | |
p = requests.get(u) |
This file contains hidden or 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
#Laura Maia e Letícia Barreto | |
import requests | |
from bs4 import BeautifulSoup | |
url='https://pt.wikipedia.org/wiki/Os_100_livros_do_s%C3%A9culo_segundo_Le_Monde' | |
soup = BeautifulSoup(requests.get(url).text, 'html.parser') | |
nome=[nome.string.strip() | |
for nome in soup.findAll('i')] | |
ranking=[rank.string |