/nefindata

Functions to download data from NEFIN, the Brazilian Center for Research in Financial Economics of the University of São Paulo (http://www.nefin.com.br/)

Primary LanguageRMIT LicenseMIT

nefindata

GitHub license Documentation Status

Python and R packages to download data from NEFIN, the Brazilian Center for Research in Financial Economics of the University of São Paulo (http://www.nefin.com.br/).

Please check our documentation for more examples and detailed API reference.

Installation

The python package can be installed via pip. Run the following command:

pip install nefindata

The R package can be installed via devtools package. Make sure you have it installed and then run the following command:

# install.packages('devtools') # uncomment if devtools needs to be installed
devtools::install_github('fernandoramacciotti/nefindata/R-package')

Risk Factors

Collect data of risk factors such as Market Factor, SMB, WML, HML, IML and Risk Free, from NEFIN's website.

Python package example:

from nefindata.risk_factors import get_risk_factors

factors = ['Mkt', 'SMB'] # for all factors, set it to 'all' or None
df = get_risk_factors(factors)
df_agg = get_risk_factors(factors, agg='month', agg_func='last')

R package example:

library(nefindata)

factors <- c('Mkt', 'SMB') # for all factors, set it to 'all'
df <- get_risk_factors(factors)
df.agg <- get_risk_factors(factors, agg = 'month', agg.func = 'last')

Cost of Capital

Collect data of cost of capital for industrial sectors such as Basic Products, Construction, Consumer, Energy, Finance, Manufacturing and Other, from NEFIN's website. Data is available for 1, 5, 10 and 20-year projects.

Python package example:

from nefindata.cost_capital import get_sector_cost_of_capital

sector = 'Basic'
df = get_sector_cost_of_capital(sector)
df_agg = get_sector_cost_of_capital(sector, agg='year', agg_func='last')

R package example:

library(nefindata)

sector <- 'Basic'
df <- get_sector_cost_of_capital(sector)
df.agg <- get_sector_cost_of_capital(sector, agg = 'year', agg.func = 'last')

Other data

Similar functions get other data such as. The syntax is similar as above and are provided for both R and Python packages.

Next Steps

Include data downloaders from