Skip to content

Commit

Permalink
fixed readme
Browse files Browse the repository at this point in the history
  • Loading branch information
msperlin committed Mar 19, 2021
1 parent c3dd93d commit 202bf19
Showing 1 changed file with 34 additions and 31 deletions.
65 changes: 34 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,50 @@
# Package GetDFPData2

Improved and backwards incompatible version of package GetDFPData.
`GetDFPData2` is the second and backwards incompatible version of `GetDPFData`, a R package for downloading annual financial reports from B3, the Brazilian financial exchange. Unlike its first iteration, `GetDFPData2` imports data using a database of csv files from [CVM](http://dados.cvm.gov.br/dados/CIA_ABERTA/), which makes it execute much faster than its predecessor. However, the output is slightly different.

In development, soon to be released.
A shiny app -- web interface -- is also available at [https://www.msperlin.com/shiny/GetDFPData2/](https://www.msperlin.com/shiny/GetDFPData2/).

## Installation

```
if (!require(devtools)) install.packages('devtools')
if (!require(GetDFPData2)) devtools::install_github('msperlin/GetDFPData2') # not in CRAN yet
# Installation

```r
# only in github, soon in CRAN
devtools::install_github('msperlin/GetDFPData2')
```

## Example of usage
# Examples of Usage

```
## Information about available companies

```r
library(GetDFPData2)
library(tidyverse)

# fetch information about companies
df_info <- get_info_companies()
# information about companies
df_info <- get_info_companies(tempdir())
print(df_info )
```

## Searching for companies

# search for companies
df_search <- search_company('odontoprev')
```{r}
search_company('grendene', cache_folder = tempdir())
```

## Downloading Financial Reports

# DFP annual data
id_cvm <- df_search$CD_CVM[1] # use NULL for all companies
l_dfp <- get_dfp_data(companies_cvm_codes = id_cvm,
first_year = 2018,
last_year = 2019,
type_docs = c('DRE', 'BPA', 'BPP'), # income, assets, liabilities
type_format = 'con' # consolidated statements
)
```r
library(GetDFPData2)

glimpse(l_dfp)
# downloading DFP data
l_dfp <- get_dfp_data(companies_cvm_codes = 19615,
use_memoise = FALSE,
clean_data = TRUE,
cache_folder = tempdir(), # use local folder in live code
type_docs = c('DRE'),
type_format = 'con',
first_year = 2019,
last_year = 2020)

# ITR quarterly data
l_itr <- get_itr_data(companies_cvm_codes = id_cvm,
first_year = 2018,
last_year = 2020,
type_docs = 'DRE', # income statement
type_format = 'con' # consolidated statements
)
str(l_dfp)

glimpse(l_itr)
```

0 comments on commit 202bf19

Please sign in to comment.