| Title: | Access the Open Data API of the Legislative Assembly of Pernambuco |
|---|---|
| Description: | A tidy interface to the open data API of the Legislative Assembly of the State of Pernambuco, Brazil ('ALEPE', <https://dadosabertos.alepe.pe.gov.br>). Retrieve data on representatives, staff, positions, departments, remuneration, contracts, procurement processes, and legislative propositions as tibbles with clean names and parsed column types. Requests are cached locally and retried with exponential backoff; network failures are handled gracefully. |
| Authors: | André Leite [aut, cre] (ORCID: <https://orcid.org/0000-0002-4718-9766>), Marcos Wasiliew [aut] (ORCID: <https://orcid.org/0009-0004-4694-3159>), Hugo Vasconcelos [aut] (ORCID: <https://orcid.org/0000-0001-6249-0920>), Carlos Amorim [aut] (ORCID: <https://orcid.org/0000-0001-6315-8305>), Diogo Bezerra [aut] (ORCID: <https://orcid.org/0000-0002-1216-8674>), Júlia Nascimento Barreto [aut] (ORCID: <https://orcid.org/0009-0004-2851-7770>) |
| Maintainer: | André Leite <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.1 |
| Built: | 2026-09-30 00:44:04 UTC |
| Source: | https://github.com/strategicprojects/alepe |
Every endpoint function has an alias named after the API endpoint it wraps, for analysts who would rather keep their whole pipeline in Portuguese. The aliases are ordinary functions with the same arguments, the same defaults and the same return value as their English counterparts — only the name differs.
alepe_parlamentares(refresh = FALSE) alepe_servidores(status = NULL, refresh = FALSE) alepe_cargos(status = NULL, refresh = FALSE) alepe_lotacoes(refresh = FALSE) alepe_remuneracao(refresh = FALSE) alepe_contratos(refresh = FALSE) alepe_licitacoes(refresh = FALSE) alepe_projetos(numero = NULL, ano = NULL, legislatura = NULL, refresh = FALSE) alepe_indicacoes( numero = NULL, ano = NULL, legislatura = NULL, refresh = FALSE ) alepe_requerimentos( numero = NULL, ano = NULL, legislatura = NULL, refresh = FALSE ) alepe_limpar_cache()alepe_parlamentares(refresh = FALSE) alepe_servidores(status = NULL, refresh = FALSE) alepe_cargos(status = NULL, refresh = FALSE) alepe_lotacoes(refresh = FALSE) alepe_remuneracao(refresh = FALSE) alepe_contratos(refresh = FALSE) alepe_licitacoes(refresh = FALSE) alepe_projetos(numero = NULL, ano = NULL, legislatura = NULL, refresh = FALSE) alepe_indicacoes( numero = NULL, ano = NULL, legislatura = NULL, refresh = FALSE ) alepe_requerimentos( numero = NULL, ano = NULL, legislatura = NULL, refresh = FALSE ) alepe_limpar_cache()
refresh |
If |
status |
Employment status filter, as in |
numero |
Portuguese spelling of |
ano |
Portuguese spelling of |
legislatura |
Portuguese spelling of |
| Portuguese | English |
alepe_parlamentares() |
alepe_representatives() |
alepe_servidores() |
alepe_staff() |
alepe_cargos() |
alepe_positions() |
alepe_lotacoes() |
alepe_departments() |
alepe_remuneracao() |
alepe_remuneration() |
alepe_contratos() |
alepe_contracts() |
alepe_licitacoes() |
alepe_procurements() |
alepe_projetos() |
alepe_bills() |
alepe_indicacoes() |
alepe_indications() |
alepe_requerimentos() |
alepe_requests() |
alepe_limpar_cache() |
alepe_cache_clear()
|
Names are written without accents, since accented characters in R identifiers are awkward to type and travel badly between locales.
Argument values follow the same both-ways rule: status accepts
the English vocabulary and the original API terms alike, so
alepe_servidores(status = "efetivo") and
alepe_staff(status = "permanent") are the same query.
The same tibble the corresponding English function returns.
alepe_parlamentares() alepe_servidores(status = "efetivo") alepe_projetos(ano = 2024)alepe_parlamentares() alepe_servidores(status = "efetivo") alepe_projetos(ano = 2024)
Retrieves legislative propositions from the Assembly: bills
(alepe_bills()), indications (alepe_indications()), and requests
(alepe_requests()). Two query modes are supported by the API:
alepe_bills(number = NULL, year = NULL, legislature = NULL, refresh = FALSE) alepe_indications( number = NULL, year = NULL, legislature = NULL, refresh = FALSE ) alepe_requests(number = NULL, year = NULL, legislature = NULL, refresh = FALSE)alepe_bills(number = NULL, year = NULL, legislature = NULL, refresh = FALSE) alepe_indications( number = NULL, year = NULL, legislature = NULL, refresh = FALSE ) alepe_requests(number = NULL, year = NULL, legislature = NULL, refresh = FALSE)
number |
Proposition number, for the detail mode. Requires
|
year |
Filter by year (listing mode) or select the proposition (detail mode). |
legislature |
Filter by legislature number (listing mode). |
refresh |
If |
Detail: pass number and year to fetch the full record of a
single proposition.
Listing: pass year and/or legislature to fetch summaries of
multiple propositions. When no filter is given, the API defaults to
the current year.
These endpoints serve structured data as XML embedded in CSV; the package parses the XML fields into regular columns, with names normalized to snake_case and HTML markup stripped from free-text fields.
A tibble. In listing mode, one row per proposition with
docid, numero, ano, legislatura, tipo, subtipo,
ementa, data_publicacao (Date), and autores (author names,
;-separated). In detail mode, a single row with numero, ano,
legislatura, tipo, autores, ementa, materia,
justificativa, regime_tramitacao, impacto_orcamentario,
resultado_final, data_publicacao (Date), numero_dpl, and
lotacao_atual. On network failure, a zero-column tibble (with a
warning).
# All bills of the current year alepe_bills() # One specific bill alepe_bills(number = 100, year = 2024)# All bills of the current year alepe_bills() # One specific bill alepe_bills(number = 100, year = 2024)
Responses from the ALEPE API are cached on disk to avoid repeated
downloads. The location follows tools::R_user_dir(), as required by
CRAN policy. Cached entries expire after
getOption("alepe.cache_max_age", 6 * 3600) seconds.
alepe_cache_dir() alepe_cache_clear()alepe_cache_dir() alepe_cache_clear()
The cache directory path, invisibly for alepe_cache_clear().
alepe_cache_dir()alepe_cache_dir()
Retrieves the Assembly's administrative contracts, including modality, contractor name and tax id (CPF/CNPJ), object, value, originating procurement process, and validity period.
alepe_contracts(refresh = FALSE)alepe_contracts(refresh = FALSE)
refresh |
If |
A tibble with one row per contract: modalidade,
numero_contrato, ano, contratada, cpf_cnpj, objeto,
valor (numeric, BRL), numero_licitacao, ano_licitacao,
vigencia_inicio, and vigencia_fim (Date). Identifier fields
are kept as published by the API. Zero rows (with a warning) on
network failure.
alepe_contracts()alepe_contracts()
Retrieves the number of active staff members grouped by department
(lotacao) and employment status. The reference period is fixed by
the API and excludes retired staff.
alepe_departments(refresh = FALSE)alepe_departments(refresh = FALSE)
refresh |
If |
A tibble with total, nome_lotacao, and vinculo. Zero
rows (with a warning) on network failure.
alepe_departments()alepe_departments()
Retrieves the number of staff members per position/level, optionally filtered by employment status.
alepe_positions(status = NULL, refresh = FALSE)alepe_positions(status = NULL, refresh = FALSE)
status |
Employment status filter. One of |
refresh |
If |
A tibble with total and cargo_nivel. Zero rows (with a
warning) on network failure.
alepe_positions(status = "commissioned")alepe_positions(status = "commissioned")
Retrieves the Assembly's procurement (bidding) processes, including process number and year, modality, object, estimated and awarded values, winner, and status.
alepe_procurements(refresh = FALSE)alepe_procurements(refresh = FALSE)
refresh |
If |
A tibble with one row per procurement process:
numero_processo, ano, numero_modalidade, modalidade,
objeto, valor_estimado (numeric, BRL), status, vencedor,
and valor_adjudicado (numeric, BRL). Value and winner fields are
NA when the process has not been decided. Zero rows (with a
warning) on network failure.
alepe_procurements()alepe_procurements()
Retrieves position remuneration values published by the Assembly for the current reference month.
alepe_remuneration(refresh = FALSE)alepe_remuneration(refresh = FALSE)
refresh |
If |
A tibble with cargo, remuneracao (numeric, BRL),
tipo_cargo, mes_competencia, and ano_competencia. Zero rows
(with a warning) on network failure.
alepe_remuneration()alepe_remuneration()
Retrieves the members of the current legislature of the Legislative Assembly of Pernambuco, with name and party.
alepe_representatives(refresh = FALSE)alepe_representatives(refresh = FALSE)
refresh |
If |
A tibble with one row per representative:
nome_parlamentar and partido. On network failure a warning is
issued and a zero-row tibble with the same columns is returned.
alepe_representatives()alepe_representatives()
Retrieves the Assembly's staff roster, optionally filtered by employment status.
alepe_staff(status = NULL, refresh = FALSE)alepe_staff(status = NULL, refresh = FALSE)
status |
Employment status filter. One of |
refresh |
If |
A tibble with one row per staff member: nome,
codigo_lotacao, nome_lotacao, cargo_efetivo, cargo_nivel,
vinculo, and data_admissao (Date). Zero rows (with a
warning) on network failure.
alepe_staff(status = "permanent")alepe_staff(status = "permanent")