https://github.com/aspeddro/siconfir
R package to access tax and accounting data of Brazilian states and municipalities provided by the Brazilian Public Sector Accounting and Tax Information System (Siconfi/National Treasure)
https://github.com/aspeddro/siconfir
accounts brazil brazilian budget economics r r-package rstats siconfi
Last synced: 3 months ago
JSON representation
R package to access tax and accounting data of Brazilian states and municipalities provided by the Brazilian Public Sector Accounting and Tax Information System (Siconfi/National Treasure)
- Host: GitHub
- URL: https://github.com/aspeddro/siconfir
- Owner: aspeddro
- License: other
- Created: 2021-01-26T23:05:10.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-25T11:23:24.000Z (over 2 years ago)
- Last Synced: 2024-04-17T22:11:00.746Z (over 1 year ago)
- Topics: accounts, brazil, brazilian, budget, economics, r, r-package, rstats, siconfi
- Language: R
- Homepage:
- Size: 335 KB
- Stars: 13
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Citation: CITATION.cff
Awesome Lists containing this project
README
# siconfir
R package to access tax and accounting data of Brazilian states and municipalities provided by the Brazilian Public Sector Accounting and Tax Information System (SICONFI/[National Treasure](https://www.gov.br/tesouronacional/en?set_language=en))
## Installation
```r
install.packages("remotes")
remotes::install_github("aspeddro/siconfir")
```## Using
- [get_fiscal()](#get_fiscal): Fiscal management report
- [get_budget()](#get_budget): Budget execution summary report
- [get_annual_acc()](#get_annual_acc): Annual statement of accounts
- [msc_budget()](#msc_budget): Budget accounts, accounting balances matrix
- [msc_control()](#msc_control): Control accounts, accounting balances matrix
- [msc_equity()](#msc_equity): Equity accounts, accounting balances matrix
- [report_status()](#report_status): Report status
- [get_annex()](#get_annex): Attachments of reports by sphere of government
- [get_info()](#get_info): Basic information of the federation entities
- [find_cod()](#find_cod): Find state or municipality informationDatasets:
- [`br_cods`](#br_cods)
## Examples
```r
library(siconfir)
```### get_fiscal()
Fiscal management report for the state of Sao Paulo (`35`) for the first four months of 2020:
```r
siconfir::get_fiscal(year = 2020, period = 1, cod = 35)
```> `cod` is an id assigned to each city and state. See [IBGE, Cities and States](https://www.ibge.gov.br/en/cities-and-states.html?view=municipio), `find_cod()`, `get_info()` or `br_cods`
### get_budget()
Summary of the budget execution report for the state of Rio de Janeiro (`33`) of 2018 for the first two months:
```r
siconfir::get_budget(year = 2018, period = 1, cod = 33)
```### get_annual_acc()
Declaration of annual accounts of the municipality of Sao Paulo (`3550308`) 2018:
```r
siconfir::get_annual_acc(year = 2018, cod = 3550308)
```### msc_budget()
Budget accounts, accounting balances matrix:
```r
siconfir::msc_budget(year = 2020, month = 1, cod = 1, matrix_type = "MSCC", class = 5, value = "period_change")
```### msc_control()
Control accounts, accounting balances matrix:
```r
siconfir::msc_control(year = 2020, month = 6, cod = 17, matrix_type = "MSCC", class = 7, value = "ending_balance")
```### msc_equity()
Equity accounts, accounting balances matrix:
```r
siconfir::msc_equity(year = 2020, month = 12, cod = 1, matrix_type = "MSCE", class = 1, value = "beginning_balance") # cod = 1 is id of Brazil
```### report_status()
Information on approved and corrected reports as well as matrices delivered to SICONFI:
```r
siconfir::report_status(year = 2020, cod = 43)
```
### get_annex()Attachments of reports by sphere of government:
```r
siconfir::get_annex()
```### get_info()
Acess basic information of the federation entities:
```r
siconfir::get_info()
```### find_cod()
Find state or municipality information:
```r
siconfir::find_cod("distrito federal")
```### br_cods
Basic information of Brazilian municipalities and states. `br_cods` provides results similar to `get_info()`, but with some corrections, see [`utils/build_datasets.R`](utils/build_datasets.R)
```r
siconfir::br_cods
```## Resources
- [SICONFI API](http://apidatalake.tesouro.gov.br/docs/siconfi/)
- [Fiscal Statement Manual 9th Edition, National Treasure (pt-br)](https://conteudo.tesouro.gov.br/manuais/index.php?option=com_content&view=categories&id=560&Itemid=675)## Contributing
Bugs or suggestions: open an [issue](https://github.com/aspeddro/siconfir/issues) detailing the problem/suggestion, be as reproducible as possible.
## License
This project is released under the MIT License.