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://towardsdatascience.com/how-to-run-apache-airflow-as-daemon-using-linux-systemd-63a1d85f9702 |
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
baixar_cjpg <- function(busca, diretorio){ | |
url <- "http://esaj.tjsp.jus.br/cjpg/pesquisar.do" | |
query <- | |
list( | |
conversationId = "", | |
dadosConsulta.pesquisaLivre = busca, | |
tipoNumero = "UNIFICADO", | |
numeroDigitoAnoUnificado = "", |
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
## Script para baixar a consulta de julgados de primeiro grau do TJSP | |
### Url da consulta | |
x <- "http://esaj.tjsp.jus.br/cjpg/pesquisar.do;jsessionid=BCB24A785FABE7F341130EEC4B9722F7.cjpg2?conversationId=&dadosConsulta.pesquisaLivre=contratos&tipoNumero=UNIFICADO&numeroDigitoAnoUnificado=&foroNumeroUnificado=&dadosConsulta.nuProcesso=&dadosConsulta.nuProcessoAntigo=&classeTreeSelection.values=&classeTreeSelection.text=&assuntoTreeSelection.values=&assuntoTreeSelection.text=&agenteSelectedEntitiesList=&contadoragente=0&contadorMaioragente=0&cdAgente=&nmAgente=&dadosConsulta.dtInicio=&dadosConsulta.dtFim=&varasTreeSelection.values=&varasTreeSelection.text=&dadosConsulta.ordenacao=DESC" | |
### Pacotes necesários | |
library(httr) | |
remotes::install_github("courtsbr/JurisMiner") ## Paço desnecessário se já instalou |
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
# Esta atividade irá combinar os conhecimentos obtidos nesta unidade com aqueles obtidos na unidade anterior. | |
# Uma importante tarefa jurimétrica é gerar novas colunas a partir da identificação de padrões em outras. | |
# Além disso, gerar sumários estatísticos oferece bons insights sobre os dados à mão. | |
# Iremos usar a mesma base que utilizamos nas duas unidades anteriores. Se achar mais conveniente, você pode obtê-la da seguinte forma: | |
cjsg <- jsonlite::fromJSON("https://gist.githubusercontent.com/jjesusfilho/f140fe3808e8d2dc6c920e1629b1ae1b/raw/46163ac97f48b95ffc0afdbc2804f92765ec56a6/infanticidio.json") | |
## Carregue os pacotes do tidyverse |
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
# Utilize o mesmo dataframe cjsg obtido na atividade anterior para praticar as atividades abaixo. | |
# Caso não o tenha mais, colocarei um link para obtê-lo. | |
# | |
## Use a linha de código abaixo se você não tem mais os dados | |
## obtidos na unidade anterior | |
cjsg <- jsonlite::fromJSON("https://gist.githubusercontent.com/jjesusfilho/f140fe3808e8d2dc6c920e1629b1ae1b/raw/46163ac97f48b95ffc0afdbc2804f92765ec56a6/infanticidio.json") |
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
[ | |
{ | |
"classe": "Habeas Corpus Criminal", | |
"assunto": "Destruição / Subração / Ocultação de Cadáver", | |
"relator": "Mauricio Henrique Guimarães Pereira Filho", | |
"comarca": "Bebedouro", | |
"orgao_julgador": "5ª Câmara de Direito Criminal", | |
"data_julgamento": "2023-02-28", | |
"data_publicacao": "2023-02-28", | |
"processo": "22900517320228260000", |
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
### Instale o pacote remotes | |
install.packages("remotes") | |
## Instale também o pacote writexl para salvar em excel. | |
install.packages("writexl") | |
### Use o pacote remotes para instalar o pacote tjsp: |
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
library(shiny) | |
orgaos <- c("Quinta Turma", "Sexta Turma", "CPPE", "Terceira Seção", | |
"CPRE", "CESP", "Corte Especial") | |
verificar <- readRDS("verificar.rds") | |
ui <- fluidPage( | |
titlePanel("Baixar intimações"), |
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
stj_baixar_intimacoes <- function(usuario = NULL, senha = NULL, diretorio = "."){ | |
if (is.null(usuario) || is.null(password)) { | |
usuario <- Sys.getenv("STJUSUARIO") | |
senha <- Sys.getenv("STJSENHA") | |
if (usuario == "" || senha == "") { | |
usuario <- as.character(getPass::getPass(msg = "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
partes <- partes %>% | |
mutate(pessoa = case_when( | |
str_detect(parte, "(?i)(t[ée]rio p[úu]blico|justi[cç]a\\s+p[uú]blica|\\bmp\\b)") ~ "MP", | |
str_detect(parte, "(?i)defensoria") ~ "Defensoria", | |
str_detect(parte,"(?i)fazenda") ~ "poder_executivo", | |
str_detect(parte,"(?i)partido") ~ "partido", | |
str_detect(parte,"(?i)(assoc|direitos|defesa|sociedade|federa[cç][ãa]o|estudant|acad.mico|ocupante|funcion[áa]rio|prote[cç]|sindicato|\\bsind\\.?\\b|sint|morador|funda[çc][ãa]o|instituto|movimento|organiza|consumidor|cons\\.|ong|usu[áa]rio|conselho)") ~ "TS", | |
str_detect(parte,"(?i)(munic|prefeit|\\estad\\w+)") ~ "poder_executivo", | |
str_detect(parte,"(?i)\\bcentro\\b") ~ "centro", | |
soma > 3 ~ "PF", |