SIORG — Organizational structure¶
The SIORG API describes the organizational
structure of the Brazilian Federal Executive Branch. Its codes are exactly the
ones the CUSTOS API expects as organizacao_n1/n2/n3.
SIORG returns identifiers as URIs (e.g.
https://.../id/unidade-organizacional/46); tesouropy extracts the numeric
tail for you, so codigo_unidade columns are plain codes.
Browse organizations¶
import tesouropy as tn
import polars as pl
# All federal executive-branch organizations
orgaos = tn.get_siorg_orgaos(codigo_poder=1, codigo_esfera=1)
# Find a ministry and grab its code
mec = orgaos.filter(pl.col("sigla") == "MEC")
mec_code = mec["codigo_unidade"][0]
codigo_poder:1Executive,2Legislative,3Judiciary.codigo_esfera:1Federal,2State/District,3Municipal.
Drill into the structure tree¶
# All sub-units of a given unit (flat DataFrame)
estrutura = tn.get_siorg_estrutura(codigo_unidade=46) # e.g. AGU
# Navigate the hierarchy with codigo_unidade_pai
filhos = estrutura.filter(pl.col("codigo_unidade_pai") == "46")
A single unit¶
Feeding CUSTOS¶
Functions¶
| Portuguese | English |
|---|---|
get_siorg_orgaos |
get_siorg_organizations |
get_siorg_estrutura |
get_siorg_structure |
get_siorg_unidade |
get_siorg_unit |
See the full signatures in the Reference.