API reference¶
Auto-generated from the docstrings. Every public function has a Portuguese name and an English alias; both are listed below, grouped by API.
Utilities¶
tesouropy_clear_cache ¶
Clear the tesouropy in-memory cache.
Removes all cached API responses stored during the current session. This applies to every API covered by the package (SICONFI, CUSTOS, SADIPEM, Transferencias, SIORG, SIOPE): they share a single in-memory store.
Source code in src/tesouropy/_core.py
set_verbose ¶
Set the package-wide default for the verbose argument.
Equivalent to options(tesouror.verbose = TRUE) in the R package.
TesouroError ¶
SICONFI¶
siconfi ¶
SICONFI API functions (RREO, RGF, DCA, MSC, entities).
API docs: https://apidatalake.tesouro.gov.br/docs/siconfi/
Every public function has a Portuguese name (PT parameters) and an English alias that maps the English parameter names onto the PT ones.
get_entes ¶
Get the list of Brazilian government entities (states, municipalities, DF).
Returns a polars DataFrame with columns cod_ibge, ente, capital,
regiao, uf, esfera, an_exercicio, populacao, co_cnpj.
Source code in src/tesouropy/siconfi.py
get_entities ¶
English alias for :func:get_entes.
get_anexos ¶
Get the report appendix reference table grouped by government sphere.
Source code in src/tesouropy/siconfi.py
get_annexes ¶
English alias for :func:get_anexos.
get_dca_ufs ¶
get_dca_ufs(
an_exercicio,
id_ente,
no_anexo=None,
use_cache=True,
verbose=False,
page_size=None,
max_rows=INF,
)
Get Annual Accounts Declaration (DCA) data for an entity and fiscal year.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
an_exercicio
|
int
|
Fiscal year (e.g. |
required |
id_ente
|
int
|
IBGE code of the entity. Required. |
required |
no_anexo
|
str
|
Appendix name filter (e.g. |
None
|
Source code in src/tesouropy/siconfi.py
get_annual_accounts_ufs ¶
get_annual_accounts_ufs(
fiscal_year,
entity_id,
appendix=None,
use_cache=True,
verbose=False,
page_size=None,
max_rows=INF,
)
English alias for :func:get_dca_ufs.
Source code in src/tesouropy/siconfi.py
get_dca_municipios ¶
get_dca_municipios(
state_uf,
an_exercicio,
no_anexo=None,
include_capital=True,
on_error="warn",
use_cache=True,
verbose=False,
page_size=None,
max_rows=INF,
)
Get DCA data for every municipality of a Brazilian state (fault tolerant).
Failed calls are recorded on result.failed.
Source code in src/tesouropy/siconfi.py
get_annual_accounts_municipalities ¶
get_annual_accounts_municipalities(
state_uf,
fiscal_year,
appendix=None,
include_capital=True,
on_error="warn",
use_cache=True,
verbose=False,
page_size=None,
max_rows=INF,
)
English alias for :func:get_dca_municipios.
Source code in src/tesouropy/siconfi.py
get_extrato ¶
Get the delivery status extract for an entity and reference year.
Source code in src/tesouropy/siconfi.py
get_delivery_status ¶
get_delivery_status(
entity_id,
year,
use_cache=True,
verbose=False,
page_size=None,
max_rows=INF,
)
English alias for :func:get_extrato.
Source code in src/tesouropy/siconfi.py
get_rreo_ufs ¶
get_rreo_ufs(
an_exercicio,
nr_periodo,
co_tipo_demonstrativo,
no_anexo,
id_ente,
co_esfera=None,
use_cache=True,
verbose=False,
page_size=None,
max_rows=INF,
)
Get Budget Execution Summary Report (RREO) data.
co_esfera is optional: some entities (e.g. the Federal District
constitutional fund) only return data when the sphere filter is omitted, so
leave it None if a sphere-filtered call comes back empty.
Source code in src/tesouropy/siconfi.py
get_budget_report_ufs ¶
get_budget_report_ufs(
fiscal_year,
period,
report_type,
appendix,
entity_id,
sphere=None,
use_cache=True,
verbose=False,
page_size=None,
max_rows=INF,
)
English alias for :func:get_rreo_ufs.
Source code in src/tesouropy/siconfi.py
get_rreo_municipios ¶
get_rreo_municipios(
state_uf,
an_exercicio,
nr_periodo,
co_tipo_demonstrativo,
no_anexo,
include_capital=True,
on_error="warn",
use_cache=True,
verbose=False,
page_size=None,
max_rows=INF,
)
Get RREO data for every municipality of a Brazilian state (fault tolerant).
Failed calls are recorded on result.failed.
Source code in src/tesouropy/siconfi.py
get_budget_report_municipalities ¶
get_budget_report_municipalities(
state_uf,
fiscal_year,
period,
report_type,
appendix,
include_capital=True,
on_error="warn",
use_cache=True,
verbose=False,
page_size=None,
max_rows=INF,
)
English alias for :func:get_rreo_municipios.
Source code in src/tesouropy/siconfi.py
get_rgf_ufs ¶
get_rgf_ufs(
an_exercicio,
in_periodicidade,
nr_periodo,
co_tipo_demonstrativo,
no_anexo,
co_esfera,
co_poder,
id_ente,
use_cache=True,
verbose=False,
page_size=None,
max_rows=INF,
)
Get Fiscal Management Report (RGF) data.
in_periodicidade is "Q" (four-monthly) or "S" (semi-annual);
co_poder is the branch: "E" exec, "L" legislative, "J"
judiciary, "M" public ministry, "D" public defender.
Source code in src/tesouropy/siconfi.py
get_fiscal_report_ufs ¶
get_fiscal_report_ufs(
fiscal_year,
periodicity,
period,
report_type,
appendix,
sphere,
branch,
entity_id,
use_cache=True,
verbose=False,
page_size=None,
max_rows=INF,
)
English alias for :func:get_rgf_ufs.
Source code in src/tesouropy/siconfi.py
get_rgf_municipios ¶
get_rgf_municipios(
state_uf,
an_exercicio,
in_periodicidade,
nr_periodo,
co_tipo_demonstrativo,
no_anexo,
co_poder,
include_capital=True,
on_error="warn",
use_cache=True,
verbose=False,
page_size=None,
max_rows=INF,
)
Get RGF data for every municipality of a Brazilian state (fault tolerant).
Source code in src/tesouropy/siconfi.py
get_fiscal_report_municipalities ¶
get_fiscal_report_municipalities(
state_uf,
fiscal_year,
periodicity,
period,
report_type,
appendix,
branch,
include_capital=True,
on_error="warn",
use_cache=True,
verbose=False,
page_size=None,
max_rows=INF,
)
English alias for :func:get_rgf_municipios.
Source code in src/tesouropy/siconfi.py
get_msc_controle ¶
get_msc_controle(
id_ente,
an_referencia,
me_referencia,
co_tipo_matriz,
classe_conta,
id_tv,
use_cache=True,
verbose=False,
page_size=None,
max_rows=INF,
)
Get MSC control accounts data (classes 7 and 8).
co_tipo_matriz is "MSCC" (monthly aggregate) or "MSCE" (annual
closing); id_tv is "beginning_balance", "ending_balance" or
"period_change".
Source code in src/tesouropy/siconfi.py
get_msc_control ¶
get_msc_control(
entity_id,
year,
month,
matrix_type,
account_class,
value_type,
use_cache=True,
verbose=False,
page_size=None,
max_rows=INF,
)
English alias for :func:get_msc_controle.
Source code in src/tesouropy/siconfi.py
get_msc_orcamentaria ¶
get_msc_orcamentaria(
id_ente,
an_referencia,
me_referencia,
co_tipo_matriz,
classe_conta,
id_tv,
use_cache=True,
verbose=False,
page_size=None,
max_rows=INF,
)
Get MSC budgetary accounts data (classes 5 and 6).
Source code in src/tesouropy/siconfi.py
get_msc_budget ¶
get_msc_budget(
entity_id,
year,
month,
matrix_type,
account_class,
value_type,
use_cache=True,
verbose=False,
page_size=None,
max_rows=INF,
)
English alias for :func:get_msc_orcamentaria.
Source code in src/tesouropy/siconfi.py
get_msc_patrimonial ¶
get_msc_patrimonial(
id_ente,
an_referencia,
me_referencia,
co_tipo_matriz,
classe_conta,
id_tv,
use_cache=True,
verbose=False,
page_size=None,
max_rows=INF,
)
Get MSC equity/asset accounts data (classes 1 to 4).
Source code in src/tesouropy/siconfi.py
get_msc_equity ¶
get_msc_equity(
entity_id,
year,
month,
matrix_type,
account_class,
value_type,
use_cache=True,
verbose=False,
page_size=None,
max_rows=INF,
)
English alias for :func:get_msc_patrimonial.
Source code in src/tesouropy/siconfi.py
CUSTOS¶
custos ¶
CUSTOS API functions (federal government cost data).
API docs: https://apidatalake.tesouro.gov.br/docs/custos/
PERFORMANCE WARNING: the CUSTOS API is slow (server default 250 rows/page,
frequent HTTP 504 timeouts). Unfiltered queries return hundreds of thousands of
rows. Always filter by organizacao_n1 + organizacao_n2, ano +
mes, natureza_juridica, and/or cap with max_rows.
SIORG codes are auto-padded: pass 244 or "244"; both become "000244".
Use :func:tesouropy.get_siorg_orgaos / :func:tesouropy.get_siorg_estrutura
to look up codes.
get_custos_pessoal_ativo ¶
get_custos_pessoal_ativo(
ano=None,
mes=None,
natureza_juridica=None,
organizacao_n1=None,
organizacao_n2=None,
organizacao_n3=None,
use_cache=True,
verbose=False,
page_size=500,
max_rows=INF,
)
Get active staff cost data. All parameters are optional filters.
natureza_juridica: 1 Public Company, 2 Public Foundation,
3 Direct Administration, 4 Autarchy, 6 Mixed Economy Company.
organizacao_n* are SIORG codes (auto zero-padded to 6 digits).
Source code in src/tesouropy/custos.py
get_costs_active_staff ¶
get_costs_active_staff(
year=None,
month=None,
legal_nature=None,
org_level1=None,
org_level2=None,
org_level3=None,
use_cache=True,
verbose=False,
page_size=500,
max_rows=INF,
)
English alias for :func:get_custos_pessoal_ativo.
Source code in src/tesouropy/custos.py
get_custos_pessoal_inativo ¶
get_custos_pessoal_inativo(
ano=None,
mes=None,
natureza_juridica=None,
organizacao_n1=None,
organizacao_n2=None,
organizacao_n3=None,
use_cache=True,
verbose=False,
page_size=500,
max_rows=INF,
)
Get retired (inactive) staff cost data. All parameters are optional.
Source code in src/tesouropy/custos.py
get_costs_retired_staff ¶
get_costs_retired_staff(
year=None,
month=None,
legal_nature=None,
org_level1=None,
org_level2=None,
org_level3=None,
use_cache=True,
verbose=False,
page_size=500,
max_rows=INF,
)
English alias for :func:get_custos_pessoal_inativo.
Source code in src/tesouropy/custos.py
get_custos_pensionistas ¶
get_custos_pensionistas(
ano=None,
mes=None,
natureza_juridica=None,
organizacao_n1=None,
organizacao_n2=None,
organizacao_n3=None,
use_cache=True,
verbose=False,
page_size=500,
max_rows=INF,
)
Get pensioner cost data. All parameters are optional filters.
Source code in src/tesouropy/custos.py
get_costs_pensioners ¶
get_costs_pensioners(
year=None,
month=None,
legal_nature=None,
org_level1=None,
org_level2=None,
org_level3=None,
use_cache=True,
verbose=False,
page_size=500,
max_rows=INF,
)
English alias for :func:get_custos_pensionistas.
Source code in src/tesouropy/custos.py
get_custos_demais ¶
get_custos_demais(
ano=None,
mes=None,
natureza_juridica=None,
organizacao_n1=None,
organizacao_n2=None,
organizacao_n3=None,
use_cache=True,
verbose=False,
page_size=500,
max_rows=INF,
)
Get other (non-personnel) cost data. All parameters are optional.
Source code in src/tesouropy/custos.py
get_costs_other ¶
get_costs_other(
year=None,
month=None,
legal_nature=None,
org_level1=None,
org_level2=None,
org_level3=None,
use_cache=True,
verbose=False,
page_size=500,
max_rows=INF,
)
English alias for :func:get_custos_demais.
Source code in src/tesouropy/custos.py
get_custos_depreciacao ¶
get_custos_depreciacao(
ano=None,
mes=None,
natureza_juridica=None,
organizacao_n1=None,
organizacao_n2=None,
organizacao_n3=None,
use_cache=True,
verbose=False,
page_size=500,
max_rows=INF,
)
Get depreciation cost data. All parameters are optional filters.
Source code in src/tesouropy/custos.py
get_costs_depreciation ¶
get_costs_depreciation(
year=None,
month=None,
legal_nature=None,
org_level1=None,
org_level2=None,
org_level3=None,
use_cache=True,
verbose=False,
page_size=500,
max_rows=INF,
)
English alias for :func:get_custos_depreciacao.
Source code in src/tesouropy/custos.py
get_custos_transferencias ¶
get_custos_transferencias(
ano=None,
mes=None,
natureza_juridica=None,
organizacao_n1=None,
organizacao_n2=None,
organizacao_n3=None,
use_cache=True,
verbose=False,
page_size=500,
max_rows=INF,
)
Get transfer cost data. All parameters are optional filters.
Source code in src/tesouropy/custos.py
get_costs_transfers ¶
get_costs_transfers(
year=None,
month=None,
legal_nature=None,
org_level1=None,
org_level2=None,
org_level3=None,
use_cache=True,
verbose=False,
page_size=500,
max_rows=INF,
)
English alias for :func:get_custos_transferencias.
Source code in src/tesouropy/custos.py
SADIPEM¶
sadipem ¶
SADIPEM API functions (public debt and credit operations).
API docs: https://apidatalake.tesouro.gov.br/docs/sadipem/
Typical workflow:
1. Search PVLs with :func:get_pvl / :func:get_debt_requests.
2. Pick an id_pleito from the results.
3. Use that id_pleito in the detail functions below.
get_pvl ¶
get_pvl(
uf=None,
tipo_interessado=None,
id_ente=None,
use_cache=True,
verbose=False,
page_size=None,
max_rows=INF,
)
Get public debt verification requests (PVL).
Use the resulting id_pleito column to query the detail functions
(:func:get_pvl_tramitacao, :func:get_opc_cronograma_liberacoes, ...).
Source code in src/tesouropy/sadipem.py
get_debt_requests ¶
get_debt_requests(
state=None,
entity_type=None,
entity_id=None,
use_cache=True,
verbose=False,
page_size=None,
max_rows=INF,
)
English alias for :func:get_pvl.
Source code in src/tesouropy/sadipem.py
get_pvl_tramitacao ¶
Get PVL processing status for approved non-credit operations.
Only returns data for PVLs with status "Deferido"; otherwise an empty
DataFrame is returned.
Source code in src/tesouropy/sadipem.py
get_pvl_status ¶
English alias for :func:get_pvl_tramitacao.
Source code in src/tesouropy/sadipem.py
get_opc_cronograma_liberacoes ¶
get_opc_cronograma_liberacoes(
id_pleito,
use_cache=True,
verbose=False,
page_size=None,
max_rows=INF,
)
Get the credit operation release schedule for a PVL request.
Source code in src/tesouropy/sadipem.py
get_credit_release_schedule ¶
get_credit_release_schedule(
request_id,
use_cache=True,
verbose=False,
page_size=None,
max_rows=INF,
)
English alias for :func:get_opc_cronograma_liberacoes.
Source code in src/tesouropy/sadipem.py
get_opc_cronograma_pagamentos ¶
get_opc_cronograma_pagamentos(
id_pleito,
use_cache=True,
verbose=False,
page_size=None,
max_rows=INF,
)
Get the credit operation payment schedule for a PVL request.
Source code in src/tesouropy/sadipem.py
get_credit_payment_schedule ¶
get_credit_payment_schedule(
request_id,
use_cache=True,
verbose=False,
page_size=None,
max_rows=INF,
)
English alias for :func:get_opc_cronograma_pagamentos.
Source code in src/tesouropy/sadipem.py
get_opc_taxa_cambio ¶
Get credit operation exchange rate data for a PVL request.
Source code in src/tesouropy/sadipem.py
get_credit_exchange_rate ¶
get_credit_exchange_rate(
request_id,
use_cache=True,
verbose=False,
page_size=None,
max_rows=INF,
)
English alias for :func:get_opc_taxa_cambio.
Source code in src/tesouropy/sadipem.py
get_res_cdp ¶
Get the Debt Capacity Result (CDP) for a PVL request.
Source code in src/tesouropy/sadipem.py
get_debt_capacity ¶
English alias for :func:get_res_cdp.
Source code in src/tesouropy/sadipem.py
get_res_cronograma_pagamentos ¶
get_res_cronograma_pagamentos(
id_pleito,
use_cache=True,
verbose=False,
page_size=None,
max_rows=INF,
)
Get the debt payment schedule result for a PVL request.
Source code in src/tesouropy/sadipem.py
get_debt_payment_schedule ¶
get_debt_payment_schedule(
request_id,
use_cache=True,
verbose=False,
page_size=None,
max_rows=INF,
)
English alias for :func:get_res_cronograma_pagamentos.
Source code in src/tesouropy/sadipem.py
Transferências Constitucionais¶
transferencias ¶
Transferencias Constitucionais API functions.
Docs: https://apiapex.tesouro.gov.br/aria/v1/transferencias_constitucionais/docs
IMPORTANT: all filter parameters use NUMERIC CODES from the Treasury's internal
systems. These are NOT IBGE codes. Use the dictionary functions to look codes
up: :func:get_tc_transferencias, :func:get_tc_estados,
:func:get_tc_municipios.
Multi-value parameters accept either a colon-separated string ("1:2:3") or
a Python sequence ([1, 2, 3]).
get_tc_transferencias ¶
Get the transfer-type dictionary (codigo, nome).
These are internal Treasury codes, not IBGE codes.
Source code in src/tesouropy/transferencias.py
get_tc_transfer_types ¶
get_tc_estados ¶
Get the state dictionary (codigo, nome).
These are internal Treasury codes, not IBGE codes.
get_tc_states ¶
get_tc_municipios ¶
Get the municipality dictionary.
p_uf is a Treasury state code from :func:get_tc_estados (not a UF
abbreviation or IBGE code).
Source code in src/tesouropy/transferencias.py
get_tc_municipalities ¶
English alias for :func:get_tc_municipios.
get_tc_por_estados ¶
get_tc_por_estados(
p_estado=None,
p_ano=None,
p_mes=None,
p_transferencia=None,
p_sn_detalhar=None,
use_cache=True,
verbose=False,
)
Get constitutional transfers aggregated by state.
Multi-value parameters accept a sequence or a colon-separated string.
Source code in src/tesouropy/transferencias.py
get_tc_by_state ¶
get_tc_by_state(
state_code=None,
year=None,
month=None,
transfer_type=None,
detailed=None,
use_cache=True,
verbose=False,
)
English alias for :func:get_tc_por_estados.
Source code in src/tesouropy/transferencias.py
get_tc_por_estados_detalhe ¶
get_tc_por_estados_detalhe(
p_estado=None,
p_ano=None,
p_mes=None,
p_transferencia=None,
use_cache=True,
verbose=False,
)
Get detailed constitutional transfers by state.
Source code in src/tesouropy/transferencias.py
get_tc_by_state_detail ¶
get_tc_by_state_detail(
state_code=None,
year=None,
month=None,
transfer_type=None,
use_cache=True,
verbose=False,
)
English alias for :func:get_tc_por_estados_detalhe.
Source code in src/tesouropy/transferencias.py
get_tc_por_municipio ¶
get_tc_por_municipio(
p_estado=None,
p_municipio=None,
p_ano=None,
p_mes=None,
p_transferencia=None,
p_sn_detalhar=None,
use_cache=True,
verbose=False,
page_size=1000,
max_rows=INF,
)
Get constitutional transfers for municipalities within states.
The server-side contract changed in 2026-09: parameter names are
case-sensitive lower case (p_municipio in the singular) and the
response is paginated (10 rows per page by default upstream). With the
old upper-case names the server ignored every filter and timed out
(HTTP 504), so this function fetches every page with the names the
server expects. If a page after the first fails, the rows already
fetched are returned with result.partial == True.
Source code in src/tesouropy/transferencias.py
get_tc_by_municipality ¶
get_tc_by_municipality(
state_code=None,
municipality=None,
year=None,
month=None,
transfer_type=None,
detailed=None,
use_cache=True,
verbose=False,
page_size=1000,
max_rows=INF,
)
English alias for :func:get_tc_por_municipio.
Source code in src/tesouropy/transferencias.py
get_tc_por_municipio_detalhe ¶
get_tc_por_municipio_detalhe(
p_estado=None,
p_municipio=None,
p_ano=None,
p_mes=None,
p_transferencia=None,
use_cache=True,
verbose=False,
)
Get detailed constitutional transfers by municipality.
Unlike /por_estado_municipio, this endpoint kept its original
contract: UPPERCASE parameter names, P_MUNICIPIOS in the plural and
no pagination (lower-case names answer HTTP 504). It returns the three
ten-day installments (va_primeiro_dec, va_segundo_dec,
va_terceiro_dec) plus total.
Source code in src/tesouropy/transferencias.py
get_tc_by_municipality_detail ¶
get_tc_by_municipality_detail(
state_code=None,
municipality=None,
year=None,
month=None,
transfer_type=None,
use_cache=True,
verbose=False,
)
English alias for :func:get_tc_por_municipio_detalhe.
Source code in src/tesouropy/transferencias.py
SIORG¶
siorg ¶
SIORG API functions (federal organizational structure).
API docs: https://api.siorg.economia.gov.br/ Base URL: https://estruturaorganizacional.dados.gov.br
SIORG codes are used as the organizacao_n1/n2/n3 parameters in the CUSTOS
API. The API returns identifiers as URIs (e.g.
https://.../id/unidade-organizacional/46); the numeric tail is extracted
for ease of use.
get_siorg_orgaos ¶
Get federal organizations (organs and entities) from SIORG.
codigo_poder: 1 Executive, 2 Legislative, 3 Judiciary.
codigo_esfera: 1 Federal, 2 State/District, 3 Municipal.
Use the returned codigo_unidade as organizacao_n1 in CUSTOS.
Source code in src/tesouropy/siorg.py
get_siorg_organizations ¶
English alias for :func:get_siorg_orgaos.
Source code in src/tesouropy/siorg.py
get_siorg_estrutura ¶
Get the organizational structure tree for a SIORG unit (flat DataFrame).
Use the returned codes as organizacao_n2/organizacao_n3 in CUSTOS.
vinculados is "SIM" or "NAO".
Source code in src/tesouropy/siorg.py
get_siorg_structure ¶
English alias for :func:get_siorg_estrutura.
Source code in src/tesouropy/siorg.py
get_siorg_unidade ¶
Get details of a single SIORG unit by its code (single-row DataFrame).
Source code in src/tesouropy/siorg.py
get_siorg_unit ¶
English alias for :func:get_siorg_unidade.
SIOPE¶
siope ¶
SIOPE API functions (education spending data, FNDE/MEC).
API docs: https://www.fnde.gov.br/olinda-ide/servico/DADOS_ABERTOS_SIOPE/versao/v1/aplicacao Base URL: https://www.fnde.gov.br/olinda-ide/servico/DADOS_ABERTOS_SIOPE/versao/v1/odata
Most endpoints share three required parameters: ano / year,
periodo / period (bimester 1-6) and uf / state.
get_siope_remuneracao additionally requires mes / month.
All functions accept OData filter, orderby and select to narrow
results server-side. Column names in those options must use the original API
names (uppercase), e.g. filter="NOM_MUNI eq 'Recife'".
They also accept a convenience tipo (type in the English aliases) to
filter by entity type server-side via the DS_TIPO column: pass
tipo="estado" (or "uf") for the state-level row only, or
tipo="municipio" for the municipalities, instead of downloading the whole
UF payload. Accepts PT/EN synonyms (accent- and case-insensitive) and combines
with an existing filter via and.
get_siope_dados_gerais ¶
get_siope_dados_gerais(
ano,
periodo,
uf,
use_cache=True,
verbose=False,
page_size=1000,
max_rows=INF,
filter=None,
orderby=None,
select=None,
tipo=None,
)
Get SIOPE general data (demographics, GDP, revenues, expenses, metadata).
Source code in src/tesouropy/siope.py
get_siope_general_data ¶
get_siope_general_data(
year,
period,
state,
use_cache=True,
verbose=False,
page_size=1000,
max_rows=INF,
filter=None,
orderby=None,
select=None,
type=None,
)
English alias for :func:get_siope_dados_gerais.
Source code in src/tesouropy/siope.py
get_siope_responsaveis ¶
get_siope_responsaveis(
ano,
periodo,
uf,
use_cache=True,
verbose=False,
page_size=1000,
max_rows=INF,
filter=None,
orderby=None,
select=None,
tipo=None,
)
Get SIOPE officials/responsible persons data.
Source code in src/tesouropy/siope.py
get_siope_officials ¶
get_siope_officials(
year,
period,
state,
use_cache=True,
verbose=False,
page_size=1000,
max_rows=INF,
filter=None,
orderby=None,
select=None,
type=None,
)
English alias for :func:get_siope_responsaveis.
Source code in src/tesouropy/siope.py
get_siope_despesas ¶
get_siope_despesas(
ano,
periodo,
uf,
use_cache=True,
verbose=False,
page_size=1000,
max_rows=INF,
filter=None,
orderby=None,
select=None,
tipo=None,
)
Get SIOPE education expenses data broken down by category.
Source code in src/tesouropy/siope.py
get_siope_expenses ¶
get_siope_expenses(
year,
period,
state,
use_cache=True,
verbose=False,
page_size=1000,
max_rows=INF,
filter=None,
orderby=None,
select=None,
type=None,
)
English alias for :func:get_siope_despesas.
Source code in src/tesouropy/siope.py
get_siope_despesas_funcao ¶
get_siope_despesas_funcao(
ano,
periodo,
uf,
use_cache=True,
verbose=False,
page_size=1000,
max_rows=INF,
filter=None,
orderby=None,
select=None,
tipo=None,
)
Get SIOPE expenses broken down by government function.
Source code in src/tesouropy/siope.py
get_siope_expenses_by_function ¶
get_siope_expenses_by_function(
year,
period,
state,
use_cache=True,
verbose=False,
page_size=1000,
max_rows=INF,
filter=None,
orderby=None,
select=None,
type=None,
)
English alias for :func:get_siope_despesas_funcao.
Source code in src/tesouropy/siope.py
get_siope_indicadores ¶
get_siope_indicadores(
ano,
periodo,
uf,
use_cache=True,
verbose=False,
page_size=1000,
max_rows=INF,
filter=None,
orderby=None,
select=None,
tipo=None,
)
Get SIOPE education indicators (e.g. % of revenue applied to education).
Source code in src/tesouropy/siope.py
get_siope_indicators ¶
get_siope_indicators(
year,
period,
state,
use_cache=True,
verbose=False,
page_size=1000,
max_rows=INF,
filter=None,
orderby=None,
select=None,
type=None,
)
English alias for :func:get_siope_indicadores.
Source code in src/tesouropy/siope.py
get_siope_info_complementares ¶
get_siope_info_complementares(
ano,
periodo,
uf,
use_cache=True,
verbose=False,
page_size=1000,
max_rows=INF,
filter=None,
orderby=None,
select=None,
tipo=None,
)
Get SIOPE supplementary information from declarations.
Source code in src/tesouropy/siope.py
get_siope_supplementary ¶
get_siope_supplementary(
year,
period,
state,
use_cache=True,
verbose=False,
page_size=1000,
max_rows=INF,
filter=None,
orderby=None,
select=None,
type=None,
)
English alias for :func:get_siope_info_complementares.
Source code in src/tesouropy/siope.py
get_siope_receitas ¶
get_siope_receitas(
ano,
periodo,
uf,
use_cache=True,
verbose=False,
page_size=1000,
max_rows=INF,
filter=None,
orderby=None,
select=None,
tipo=None,
)
Get SIOPE education revenue data (tax revenues, transfers, FUNDEB).
Source code in src/tesouropy/siope.py
get_siope_revenues ¶
get_siope_revenues(
year,
period,
state,
use_cache=True,
verbose=False,
page_size=1000,
max_rows=INF,
filter=None,
orderby=None,
select=None,
type=None,
)
English alias for :func:get_siope_receitas.
Source code in src/tesouropy/siope.py
get_siope_remuneracao ¶
get_siope_remuneracao(
ano,
periodo,
mes,
uf,
use_cache=True,
verbose=False,
page_size=1000,
max_rows=INF,
filter=None,
orderby=None,
select=None,
tipo=None,
)
Get SIOPE staff compensation data. Requires an extra mes (month).
Source code in src/tesouropy/siope.py
get_siope_compensation ¶
get_siope_compensation(
year,
period,
month,
state,
use_cache=True,
verbose=False,
page_size=1000,
max_rows=INF,
filter=None,
orderby=None,
select=None,
type=None,
)
English alias for :func:get_siope_remuneracao.
Source code in src/tesouropy/siope.py
RREO tidy layer¶
rreo_tidy ¶
RREO tidy layer — handles SICONFI's drifting labels across years.
SICONFI's RREO appendix names, account labels, and column suffixes drift across
fiscal years. The package ships a small reference table
(data/rreo_layout.csv) mapping (topic, regime, year_range) to the
correct appendix and account-matching key, and uses it to assemble
layout-stable indicators across years.
rreo_layout ¶
Return the bundled RREO layout reference table.
Columns: topic, regime, first_year, last_year,
co_esfera, no_anexo, conta_match, cod_conta_match,
indicador. Each rule matches either on a cleaned account label
(conta_match) or on SICONFI's stable semantic account code
(cod_conta_match); exactly one of the two is non-empty per row.
Source code in src/tesouropy/rreo_tidy.py
rreo_normalize_columns ¶
Normalize the coluna field of an RREO DataFrame across years.
Appends two columns:
coluna_padrao: the column label with any trailing/ YYYYorEM YYYYsuffix removed (whitespace squished).coluna_ano: the year that appeared in the suffix (Int64), or null when no year was present.
Source code in src/tesouropy/rreo_tidy.py
tidy_rreo ¶
Tidy an RREO DataFrame by topic, reconciling layout drift across years.
Filters data (typically from :func:tesouropy.get_rreo_ufs) to the rows
matching a known indicator for topic (and optionally regime), using
the rules in :func:rreo_layout. Accounts are matched on a year-stable,
accent-folded key — or, where the free-text label is ambiguous, on
SICONFI's stable semantic account code (cod_conta) — so the same call
returns a coherent series across years even when SICONFI relabelled the
appendix or account.
Currently supported topics:
"previdencia"— federal RGPS / RPPS civis / FCDF / militares inativos (União sphere, Anexos 04.x)."rcl"— Receita Corrente Líquida (Anexo 03), all spheres; regimes"total"(2015+) plus"ajustada_endividamento"and"ajustada_pessoal"(states/municipalities, 2020+)."balanco"— Balanço Orçamentário (Anexo 01), all spheres, 2015+, matched oncod_conta: revenue/expenditure subtotals, current and capital categories, superávit and déficit."resultado"— primary and nominal results (Anexo 06) across the three label eras (2015-2017, 2018-2022, 2023+), matched oncod_conta, including the 2023+ com/sem RPPS split for states and municipalities. The nominal series starts in 2018.
When data carries an anexo column (the raw SICONFI output always
does), rows only match the rule for their own appendix — Anexo 14
repeats accounts from other appendices under identical labels. Topics
matched on cod_conta require that column in the input.
Source code in src/tesouropy/rreo_tidy.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 | |
Deprecated names¶
Renamed in 0.2.0; these still work but emit a DeprecationWarning and forward
to the new names. See the SICONFI section above for the replacements.
deprecated ¶
Deprecated function names.
In 0.2.0 the SICONFI report getters were renamed to make their scope explicit:
the single-entity getters gained the _ufs suffix and the state-wide sweeps
(every municipality of a UF) moved from _for_state to _municipios /
_municipalities. The old names below still work but emit a
:class:DeprecationWarning and forward to the new names. They are kept for at
least one release cycle for backward compatibility.