Skip to main content

fundamentos

License: MIT PyPI version PyPI pyversions Downloads GitHub stars

fundamentos is a tiny, threaded, package that allows you to quickly download historical data from the Brazilian Stock Market, both annualy and quarterly.

The sources from where it downloads data are

Instalation

Install fundamentos using pip:

$ pip install fundamentos

Quick Start

The get_fundamentos function

Get some fundamentals!

From default, the results are grouped by year, but if you want to, you can specify a quarter to download data from. Additionally, if you want to be even more specific, you can specify the year and the quarter from which you want to download.

import fundamentos as ftos

# Downloading data from Itaú Unibanco SA

# Downloads all historical fundamentals, annually
df = ftos.get_fundamentos('ITUB4')

# Downloads all historical fundamentals on third quarters
df = ftos.get_fundamentos('ITUB4', quarter=3)

# Downloads fundamentals from first quarter of 2013
df = ftos.get_fundamentos('ITUB4', year=2013, quarter=1)

The output is a pandas.DataFrame and its columns are hierarchically ordered by topics, which makes it easier to filter the data. However, if you need a regular index of columns you can specify that by passing separated=False as a parameter.

Topics are

  • Mercado - Market
  • Resultados - Income
  • Patrimônio - Net Worth
  • Caixa - Cash
  • Dívida - Debt
  • Liquidez e Solvência - Solvency and Liquidity
  • Fluxo de Caixa - Cash Flow
  • Investimentos - Investments
  • Dividendos - Dividends

So, for example, cash indicators could be accessed separately with

df['Caixa']

quick tip: if you can't understand the acronyms of the indicators you can use ftos.get_schema(), which is a function that returns a pandas.DataFrame with the full name versions of each indicator

The get_tickers function

This function returns a pandas.DataFrame with every company listed on the Brazilian Stock Market, their respective corporate names and codes

import fundamentos as ftos

tickers = ftos.get_tickers()

The get_balanco function

Get some balance sheets!

From default, the results are grouped by year, but if you want to, you can download them quarterly by using quarterly=True

import fundamentos as ftos

# Downloads all historical balance sheets, annually
df = ftos.get_balanco('ITUB4')

# Downloads all historical balance sheets, quarterly
df = ftos.get_balanco('ITUB4', quarterly=True)

As with get_fundamentos, the output is also a pandas.DataFrame with columns hierarchically ordered by topics. You can also deactivate that by passing separated=False as an argument.

Topics are

  • Ativo Total - Total Assets
  • Ativo Circulante - Current Assets
  • Ativo Não Circulante - Non-current Assets
  • Passivo Total - Total Liabilities
  • Passivo Circulante - Current Liabilities
  • Passivo Não Circulante - Non-current Liabilities
  • Patrimônio Líquido - Net Worth

The get_dre function

Get some income statements!

The parameters are pretty similar to thoses in get_balanco

import fundamentos as ftos

# Downloads all historical income statements, annually
df = ftos.get_dre('ITUB4')

# Downloads all historical income statements, quarterly
df = ftos.get_dre('ITUB4', quarterly=True)

The python help function

I tried to be as descriptive as I could on the docstrings, so if you need more information about what each function does you can use

help(function)

License

fundamentos is distributed under the MIT License. See the LICENSE.txt file in the release for details.

Metadata

Release files for fundamentos 1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fundamentos 1.5
File Size Uploaded
fundamentos-1.5.tar.gz 7.8 kB Details

Release files / fundamentos-1.5.tar.gz

Download URL fundamentos-1.5.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
24da5d8098abe9594de2aafab1793baaaa2cbc1ddd600551611a3d04f754a4ea
BLAKE2b-256 checksum
How to use checksums
b627dd5bbf2cad692aaa60bd6065b866a1bf555e2589f5151aea4c0bcb15ac20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.7

Release history Release notifications | RSS feed

This release

1.5 This release

1 release file

1.4

1 release file

1.3

1 release file

1.2

1 release file

1.1

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page