View gist:e81289ed90d50b3278b1c36734538582
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
# https://gitlab.mister-muffin.de/josch/img2pdf | |
ls *.jpg | sort -n | tr '\n' ' ' | xargs img2pdf -o ebook.pdf |
View dict_to_json.py
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 dataclasses import asdict | |
import json | |
json.dump(asdict(my_object), open("my_object.json", "w")) |
View errors_from_sentry.py
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 json | |
import requests | |
def retrieve_errors(issue_id): | |
issue_id = "" # FIXME | |
endpoint = f"https://sentry.io/api/0/issues/{issue_id}/events/?full=True" | |
token = "" # FIXME | |
headers = {"Authorization": f"Bearer {token}"} |
View propostas-de-governo-se.csv
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
codigo_cidade_tse | municipio | sigla_estado | codigo_prefeito_tse | nome_urna | url | |
---|---|---|---|---|---|---|
31011 | Amparo de São Francisco | SE | 260000686461 | ALZIRA DE SALETE | https://divulgacandcontas.tse.jus.br/candidaturas/oficial/2020/SE/31011/426/candidatos/401877/5_1600439475109.pdf | |
31011 | Amparo de São Francisco | SE | 260000663375 | ATEVALDO | https://divulgacandcontas.tse.jus.br/candidaturas/oficial/2020/SE/31011/426/candidatos/361378/5_1600363475075.pdf | |
31011 | Amparo de São Francisco | SE | 260001234505 | FRANKLIN FREIRE | https://divulgacandcontas.tse.jus.br/candidaturas/oficial/2020/SE/31011/426/candidatos/780356/5_1601143241998.pdf | |
31038 | Aquidabã | SE | 260000863851 | ANDERSON ANDRADE | https://divulgacandcontas.tse.jus.br/candidaturas/oficial/2020/SE/31038/426/candidatos/583189/Proposta.pdf | |
31038 | Aquidabã | SE | 260000660580 | DR MÁRIO LUCENA | https://divulgacandcontas.tse.jus.br/candidaturas/oficial/2020/SE/31038/2030402020/260000660580/pje-d2d8f962-Proposta de governo.pdf | |
31038 | Aquidabã | SE | 260001041576 | DR PHILIPPE | https://divulgacandcontas.tse.jus.br/candidaturas |
View spider.py
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 scrapy | |
class ImprensaOficialSpider(scrapy.Spider): | |
start_urls = ["http://www.imprensaoficial.org/acesso.htm"] | |
# example http://pmameliarodriguesba.imprensaoficial.org/ | |
name = "imprensa_oficial" | |
TERRITORY_ID = None | |
handle_httpstatus_list = [301] |
View api.py
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 flask import Flask, request | |
from twilio.twiml.voice_response import Dial, VoiceResponse, Gather | |
from calls import CallQueue | |
call_queue = CallQueue("support") | |
app = Flask(__name__) | |
AGENTS = { | |
"+000000000001": "Ana", |
View README.md
Classificação da Despesa Orçamentária por Natureza
Até então só havia encontrado PDFs ou XLSs com a classificação das despesa orçamentária por natureza.
Converti o conteúdo da Tabela de despesa e classificação por fonte e destinação de recurso 2020 do SICOM TCE-MG em um CSV, adicionando apenas uma coluna para o código sem máscara.
Legenda
Coluna | Descrição |
---|
View override_silently.py
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
"""Find class or methods override by Python silently.""" | |
import argparse | |
import os | |
import re | |
from pprint import pprint | |
CLASS_OR_METHOD = r'\b(class|def) (.*)\(' | |
CLASS_OR_METHOD_PATTERN = re.compile(CLASS_OR_METHOD) |
NewerOlder