Access data from the Brazilian Public Sector (SICONFI)
Project description
siconfipy
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
orcod
. Example:year=[2018,2019,2020]
orcod=[35,33]
. More detailshelp(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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file siconfipy-0.0.4b1.tar.gz
.
File metadata
- Download URL: siconfipy-0.0.4b1.tar.gz
- Upload date:
- Size: 119.1 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5c869381ce00c64978a5ab5add0d642c7206701d5c891da2cbed45a27b4d80b |
|
MD5 | d4b235f626b6c25fc5764d0e5e54c5fb |
|
BLAKE2b-256 | 339f6aa8cb4d713fff1b5fdc34d61edcf14aadcb26481726aebeabb1a5738bdc |