{"id":21220783,"url":"https://github.com/aspeddro/siconfipy","last_synced_at":"2025-09-10T14:41:21.844Z","repository":{"id":57467029,"uuid":"338980393","full_name":"aspeddro/siconfipy","owner":"aspeddro","description":"Python library to access data from the Brazilian Public Sector Accounting and Tax Information System (Siconfi/National Treasure)","archived":false,"fork":false,"pushed_at":"2021-12-21T04:10:17.000Z","size":124,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-07T00:35:59.401Z","etag":null,"topics":["accounts","brazil","brazilian","budget","economics","python","siconfi"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/siconfipy/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aspeddro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-15T05:52:57.000Z","updated_at":"2023-02-14T13:27:27.000Z","dependencies_parsed_at":"2022-09-10T02:01:17.654Z","dependency_job_id":null,"html_url":"https://github.com/aspeddro/siconfipy","commit_stats":null,"previous_names":["pedrocastroo/siconfipy"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspeddro%2Fsiconfipy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspeddro%2Fsiconfipy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspeddro%2Fsiconfipy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspeddro%2Fsiconfipy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aspeddro","download_url":"https://codeload.github.com/aspeddro/siconfipy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225637112,"owners_count":17500365,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["accounts","brazil","brazilian","budget","economics","python","siconfi"],"created_at":"2024-11-20T22:14:05.878Z","updated_at":"2024-11-20T22:14:06.571Z","avatar_url":"https://github.com/aspeddro.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# siconfipy\n\n[![pypi](https://img.shields.io/pypi/v/siconfipy.svg)](https://pypi.python.org/pypi/siconfipy/)\n[![PyPI status](https://img.shields.io/pypi/status/siconfipy.svg)](https://pypi.python.org/pypi/siconfipy/)\n[![PyPI license](https://img.shields.io/pypi/l/siconfipy.svg)](https://pypi.python.org/pypi/siconfipy/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\nPython library to access data from the Brazilian Public Sector Accounting and Tax Information System (SICONFI/[National Treasure](https://www.gov.br/tesouronacional/en?set_language=en))\n\nThis package is available for [**R**](https://github.com/pedrocastroo/siconfir)\n\n## Installation\n\nInstall from [pip](https://pypi.org/project/siconfipy)\n\n```bash\npip install siconfipy\n```\n\nInstall from github\n\n```bash\npip install git+https://github.com/pedrocastroo/siconfipy.git\n```\n\nDependencies:\n\n* `pandas\u003e=2.25.1`\n* `requests\u003e=1.2.1`\n\n## Using\n\nsiconfipy provides four main functions:\n\n* `get_fiscal()` - Fiscal Management Report\n\n* `get_budget()` - Budget Execution Summary Report\n  \n* `get_annual_acc()` - Annual Statement of Accounts\n\n* `get_info()` - Basic information of the federation entities\n\nUtility functions:\n\n`find_cod()` to get the id (`cod_ibge`) for each state or city\n\nDatasets:\n\n* `br_cods`\n\n## Examples\n\nLoad `siconfipy`\n\n```python\nimport siconfipy\n```\n\nor load functions\n\n```python\nfrom siconfipy import get_fiscal, get_budget, br_cods\n```\n\nFiscal management report for the state of Sao Paulo (`35`) for the first four months of 2020:\n\n```python\nget_fiscal(year=2020, period=1, cod=35)\n```\n\n\u003e 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)`\n\nSummary of the budget execution report for the state of Rio de Janeiro (`33`) of 2018 for the first two months:\n\n```python\nget_budget(year=2018, period=1, cod=33)\n```\n\nAnnual accounts statement of the Federal District (`53`) for 2018:\n\n```python\nget_annual_acc(year=2018, cod=53)\n```\n\nUse `find_cod()` to get the `cod` (`cod_ibge` column) parameter:\n\n```python\nfind_cod(\"Rio de Janeiro\")\n      cod_ibge            ente  capital regiao  uf esfera  exercicio  populacao          cnpj\n124         33  Rio de Janeiro        0     SE  BR      E       2021   17366189  4.249860e+13\n3156   3304557  Rio de Janeiro        1     SE  RJ      M       2021    6747815  4.249873e+13\n```\n\nAcess basic information of the federation entities:\n\n```python\nget_info()\n```\n\n`br_cods` provides results similar to `get_info()`, but with some corrections, see [`utils/build_datasets.py`](utils/build_datasets.py)\n\n\u003e All data, as column name is in pt-BR, the [API](http://apidatalake.tesouro.gov.br/docs/siconfi/) does not provide an endpoint in en.\n\n## TODO\n\n- [ ] `README.md` pt-br\n- [ ] Add Accounting Balance Matrix - balance sheet accounts\n- [ ] Add Accounting Balances Matrix - Budget Accounts \n- [ ] Add Accounting Balances Matrix - Control Accounts\n- [ ] Add Extract of approved reports and matrices delivered\n- [ ] Add Attachments of reports by sphere of government \n\n## Contributing\n\nBugs or suggestions: open an [issue](https://github.com/pedrocastroo/siconfipy/issues) detailing the problem/suggestion, be as reproducible as possible.\n\n## License\n\nThis project is released under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faspeddro%2Fsiconfipy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faspeddro%2Fsiconfipy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faspeddro%2Fsiconfipy/lists"}