Skip to content

Commit

Permalink
migraçao para cdprocesso
Browse files Browse the repository at this point in the history
  • Loading branch information
jjesusfilho committed Aug 30, 2023
1 parent c4cfae9 commit 43e4d3a
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: tjsp
Version: 1.0.0
Version: 2.0.0
Date: 2023-08-08
Title: Coleta e organização de dados do Tribunal de Justiça de São
Paulo
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export(tjsp_classificar_recurso)
export(tjsp_classificar_sentenca)
export(tjsp_classificar_writ)
export(tjsp_combinar_docs)
export(tjsp_combinar_docs_cd_processo)
export(tjsp_corrigir_varas)
export(tjsp_cpopg_baixar_tabela_docs)
export(tjsp_ler_acordaos_cjsg)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ tjsp_combinar_docs_cd_processo <- function(arquivos = NULL,


lista <- tibble::tibble(arquivos) |>
dplyr::mutate(cd_processo = stringr::str_extract(arquivos,"\\w+?(?<=_id_doc)"),
dplyr::mutate(cd_processo = stringr::str_extract(arquivos,"\\w+?(?=_id_doc)"),
id_doc = stringr::str_extract(arquivos,'(?<=id_doc_)\\d+') |> as.integer(),
pagina_inicial = stringr::str_extract(arquivos, '(?<=inicial_)\\d+') |> as.integer()) |> # nolint
dplyr::arrange(cd_processo,id_doc,pagina_inicial)
Expand All @@ -42,7 +42,7 @@ tjsp_combinar_docs_cd_processo <- function(arquivos = NULL,

purrr::walk(lista, purrr::possibly(~{

processo <- unique(.x$cd_processo)
cd_processo <- unique(.x$cd_processo)

qpdf::pdf_combine(.x$arquivos, file.path(dir_destino,paste0(cd_processo,".pdf")))

Expand All @@ -51,10 +51,10 @@ tjsp_combinar_docs_cd_processo <- function(arquivos = NULL,

} else {

lista <- dplyr::group_split(lista, processo, id_doc)
lista <- dplyr::group_split(lista, cd_processo, id_doc)

purrr::walk(lista, purrr::possibly(~{
processo <- unique(.x$cd_processo)
cd_processo <- unique(.x$cd_processo)
id_doc <- unique(.x$id_doc)
suppressWarnings(
qpdf::pdf_combine(.x$arquivos, file.path(dir_destino,
Expand Down
29 changes: 29 additions & 0 deletions man/tjsp_combinar_docs_cd_processo.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 43e4d3a

Please sign in to comment.