Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new functions to siconvr based on 2022 updates #13

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ siconv_arqs <- function(dataset){
else if(dataset == "proponentes") return("siconv_proponentes.csv.zip")
else if(dataset == "cronograma_desembolsos") return("siconv_cronograma_desembolso.csv.zip")
else if(dataset == "justificativas") return("siconv_justificativas_proposta.csv.zip")
#New datasets added in 2022
else if(dataset == "historico_projeto_basico") return("siconv_historico_projeto_basico.csv.zip")
else if(dataset == "desbloqueio_cr") return("siconv_desbloqueio_cr.csv.zip")
else if(dataset == "licitacao") return("siconv_licitacao.csv.zip")
else if(dataset == "prorroga_oficio") return("siconv_prorroga_oficio.csv.zip")
else if(dataset == "termo_aditivo") return("siconv_termo_aditivo.csv.zip")
#Those are also part of the 2022 group, but they are more than one in an only zip.
#1. siconv_acomp_obras_mod_empresas.csv.zip (2 csvs)
#2. siconv_inst_cont_aio_mod_empresas.csv.zip (3 csvs)
#3. siconv_projeto_basico_mod_empresas.csv.zip (5csvs)
#4. siconv_vrpl_mod_empresas.csv.zip (3 csvs)

else return("Invalid")
}

Expand All @@ -32,7 +44,7 @@ retrieve_siconv <- function(link, dest_folder, arq, verbose){
dest_file <- file.path(dest_folder, arq)

if(verbose){
siconv_url <- "http://antigo.plataformamaisbrasil.gov.br/"
siconv_url <- "https://repositorio.dados.gov.br/seges/detru/"
cli::cli_alert_info("Downloading files from {.url {siconv_url}}")
x <- httr::GET(link, httr::write_disk(dest_file, overwrite = TRUE),
httr::progress("down"))
Expand Down