Skip to main content

('Fundamentus: API to load data from Fundamentus website: https://www.fundamentus.com.br/',)

Project description

Python Fundamentus

version   pyversions license   TravisCI  Actions   Coverage  Dependabot

Python API to load data from Fundamentus website.

API usage

Main functions are named after each website functionality:

A specific list function is built from the following setor parameter:

Examples

get_resultado

Return: -> DataFrame

>>> import fundamentus
>>> df = fundamentus.get_resultado()
>>> print(df.columns)

  Index(['cotacao', 'pl', 'pvp', 'psr', 'dy', 'pa', 'pcg', 'pebit', 'pacl',
         'evebit', 'evebitda', 'mrgebit', 'mrgliq', 'roic', 'roe', 'liqc',
         'liq2m', 'patrliq', 'divbpatr', 'c5y'],
        dtype='object', name='Multiples')

>>> print( df[ df.pl > 0] )

    papel   cotacao     pl   pvp  ...  divbpatr     c5y
    ABCB4     15.81   9.66  0.83  ...      0.00 -0.5287
    ABEV3     15.95  28.87  3.22  ...      0.09  0.0455
    AEDU11    37.35  20.13  1.13  ...      0.30  0.2090
    ...         ...    ...   ...  ...       ...     ...
    WIZS3      7.95   5.96  3.61  ...      0.00  0.1737
    WSON33    45.45  34.29  1.34  ...      1.11  0.0131
    YDUQ3     33.26  39.71  3.10  ...      1.45  0.0449

Columns names were simplified from the original web page to allow DataFrame filtering in a simplified way:

# filter on DataFrame
df = df[ df.pl  > 0   ]
df = df[ df.pl  < 100 ]
df = df[ df.pvp > 0   ]

get_resultado_raw

Return: -> DataFrame

>>> import fundamentus
>>> df = fundamentus.get_resultado_raw()
>>> print(df.columns)

Index(['Cotação', 'P/L', 'P/VP', 'PSR', 'Div.Yield', 'P/Ativo', 'P/Cap.Giro',
       'P/EBIT', 'P/Ativ Circ.Liq', 'EV/EBIT', 'EV/EBITDA', 'Mrg Ebit',
       'Mrg. Líq.', 'Liq. Corr.', 'ROIC', 'ROE', 'Liq.2meses', 'Patrim. Líq',
       'Dív.Brut/ Patrim.', 'Cresc. Rec.5a'],
      dtype='object', name='Multiples')

>>> print( df[ df['P/L'] > 0] )

    papel   Cotação    P/L  P/VP  ...  Dív.Brut/ Patrim.  Cresc. Rec.5a
    ABCB4     15.81   9.66  0.83  ...               0.00        -0.5287
    ABEV3     15.95  28.87  3.22  ...               0.09         0.0455
    AEDU11    37.35  20.13  1.13  ...               0.30         0.2090
    ...         ...    ...   ...  ...                ...            ...
    WIZS3      7.95   5.96  3.61  ...               0.00         0.1737
    WSON33    45.45  34.29  1.34  ...               1.11         0.0131
    YDUQ3     33.26  39.71  3.10  ...               1.45         0.0449

In the _raw function, columns names are preserved as captured from the web page. Be aware that names are in pt-br and contain spaces and accents. Filtering must be made explicitly:

# filter on DataFrame
df = df[ df['P/L'] > 0   ]
df = df[ df['P/L'] < 100 ]
df = df[ df['P/VP'] > 0  ]

The renaming list can be found here.

get_papel

Return: -> DataFrame

>>> import fundamentus

>>> df = fundamentus.get_papel('WEGE3')  ## or...
>>> df = fundamentus.get_papel(['ITSA4','WEGE3'])

>>> print(df)

        Tipo       Empresa        Setor ... Receita_Liquida_3m    EBIT_3m Lucro_Liquido_3m
ITSA4  PN N1  ITAÚSA PN N1  Financeiros ...         1778000000  257000000       1784000000
WEGE3  ON N1  WEG SA ON N1  Máquinas e  ...         4801260000  946670000        644246000

list_papel_setor

Return: -> list

>>> import fundamentus

>>> fin = fundamentus.list_papel_setor(35)  # finance
>>> seg = fundamentus.list_papel_setor(38)  # seguradoras

>>> print(fin)
   ['ABCB4', 'BBAS3', 'BBDC3', 'BBDC4', ... ]

>>> print(seg)
   ['BBSE3', 'IRBR3', 'SULA4', 'WIZS3', ... ]

The full list of companies by setor can be found here

License

The MIT License (MIT)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fundamentus-0.2.0.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

fundamentus-0.2.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file fundamentus-0.2.0.tar.gz.

File metadata

  • Download URL: fundamentus-0.2.0.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.6

File hashes

Hashes for fundamentus-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fbc792a02eefa2835679e652af458993ea2ebad3df61838b5d11d5657bb6d1bc
MD5 d9c7d0deb80e6b3ef86ad1f181b17cbf
BLAKE2b-256 6a1f7f516e6779e16bfb2014d48743ecd25d3093282485279fe8623d45aab4e9

See more details on using hashes here.

File details

Details for the file fundamentus-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: fundamentus-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.6

File hashes

Hashes for fundamentus-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a34770b20b1d3789a1650b0c5fd212af7da4c86875641575453e16cb8722563f
MD5 a3b229501ef82848beb1ffad55e605fb
BLAKE2b-256 0a36cbc66c7738c7ee684a5f7c5603986a2e56ab36cef39d4901ddd8a28b686f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page