pybovespa
The BM&FBOVESPA (in full, Bolsa de Valores, Mercadorias & Futuros de São Paulo) is a stock exchange located at São Paulo, Brazil.
pybovespa is a basic and simple library to get official BM&FBOVESPA stock values.
Installing or updating
Just run:
# pip install -U pybovespa
Show-me an example, I need code!
15-minute delayed info
When you make a request, 15-minute-old information is retrieved. You can check the date and time with stock.time. Example:
#!/usr/bin/env python3
from pybovespa.bovespa import *
from pybovespa.stock import *
bovespa = Bovespa()
stock = bovespa.query("PETR3")
print(stock.cod, stock.name, stock.last)
The output should be something like this:
PETR3 PETROBRAS ON 24,24
It is possible to make only one request for many stocks:
stocks = bovespa.query("PETR4", "VALE5", "OGXP3")
for stock in stocks.values():
print(stock.cod, stock.last)
stock_vale = stocks["VALE5"]
Historical stock data
Unfortunately, BM&FBovespa does not allow the distribution of their data. However, it is very simple to download them using this library:
bovespa = Bovespa() bovespa.download(dst="/tmp/hist", year="2012", overwrite=True)
To download data of all available years:
bovespa.download_all(dst="/tmp/hist", overwrite=True)
Metadata
Release files for pybovespa 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pybovespa-0.1.2.tar.gz | 4.9 kB | Without provenance | Details for pybovespa-0.1.2.tar.gz |
Release files / pybovespa-0.1.2.tar.gz
| Download URL | pybovespa-0.1.2.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7fbfebd5f82462c1b37cebe33eaf48e671fc7254dfb4f463064470bcd54f951d
|
|
BLAKE2b-256 checksum How to use checksums |
5b1411ba32e1b3591467c41f21bfcc662401085e467eabfa1d372214263657cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pybovespa 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.