Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

siconfipy

pypi PyPI status PyPI license Code style: black

Python library to access data from the Brazilian Public Sector Accounting and Tax Information System (SICONFI/National Treasure)

This package is available for R

Installation

Install from pip

pip install siconfipy

Install from github

pip install git+https://github.com/pedrocastroo/siconfipy.git

Dependencies:

  • pandas>=2.25.1
  • requests>=1.2.1

Using

siconfipy provides four main functions:

  • get_fiscal() - Fiscal Management Report

  • get_budget() - Budget Execution Summary Report

  • get_annual_acc() - Annual Statement of Accounts

  • get_info() - Basic information of the federation entities

Utility functions:

find_cod() to get the id (cod_ibge) for each state or city

Datasets:

  • br_cods

Examples

Load siconfipy

import siconfipy

or load functions

from siconfipy import get_fiscal, get_budget, br_cods

Fiscal management report for the state of Sao Paulo (35) for the first four months of 2020:

get_fiscal(year=2020, period=1, cod=35)

You can pass a list of integers in year, period or cod. Example: year=[2018,2019,2020] or cod=[35,33]. More details help(get_fiscal)

Summary of the budget execution report for the state of Rio de Janeiro (33) of 2018 for the first two months:

get_budget(year=2018, period=1, cod=33)

Annual accounts statement of the Federal District (53) for 2018:

get_annual_acc(year=2018, cod=53)

Use find_cod() to get the cod (cod_ibge column) parameter:

find_cod("Rio de Janeiro")
      cod_ibge            ente  capital regiao  uf esfera  exercicio  populacao          cnpj
124         33  Rio de Janeiro        0     SE  BR      E       2021   17366189  4.249860e+13
3156   3304557  Rio de Janeiro        1     SE  RJ      M       2021    6747815  4.249873e+13

Acess basic information of the federation entities:

get_info()

br_cods provides results similar to get_info(), but with some corrections, see utils/build_datasets.py

All data, as column name is in pt-BR, the API does not provide an endpoint in en.

TODO

  • README.md pt-br
  • Add Accounting Balance Matrix - balance sheet accounts
  • Add Accounting Balances Matrix - Budget Accounts
  • Add Accounting Balances Matrix - Control Accounts
  • Add Extract of approved reports and matrices delivered
  • Add Attachments of reports by sphere of government

Contributing

Bugs or suggestions: open an issue detailing the problem/suggestion, be as reproducible as possible.

License

This project is released under the MIT License.

Metadata

Release files for siconfipy 0.0.4b1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for siconfipy 0.0.4b1
File Size Uploaded
siconfipy-0.0.4b1.tar.gz 119.1 kB Details

Release files / siconfipy-0.0.4b1.tar.gz

Download URL siconfipy-0.0.4b1.tar.gz
Size 119.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f5c869381ce00c64978a5ab5add0d642c7206701d5c891da2cbed45a27b4d80b
BLAKE2b-256 checksum
How to use checksums
339f6aa8cb4d713fff1b5fdc34d61edcf14aadcb26481726aebeabb1a5738bdc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.1.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.2
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page