Biblioteca Python para leitura e fetch do arquivo COTAHIST da B3. Suporta tanto pandas quanto polars como engines.
Project description
b3cotahist
Biblioteca Python para leitura e fetch do arquivo COTAHIST da B3.
Instalação
pip install b3cotahist
Uso
Fetch da B3
import datetime
import b3cotahist
# Fetch dos dados do pregão de 01/03/2024
date = datetime.date(2024, 3, 1)
df = b3cotahist.get(date)
# Caso tenha problemas com SSL da b3
df = b3cotahist.get(date, raise_ssl_error=False)
Leitura de arquivos
df = b3cotahist.read_zip(path='COTAHIST_D20240301.ZIP')
df = b3cotahist.read_txt(path='COTAHIST_D20240301.TXT')
Leitura de bytes
# Lendo a partir de bytes
with open('COTAHIST_D20240301.TXT', 'rb') as f:
dados = f.read()
df = b3cotahist.read_bytes(dados)
# Ou a partir de BytesIO
import io
bytes_io = io.BytesIO(dados)
df = b3cotahist.read_bytes(bytes_io)
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
b3cotahist-0.1.8.tar.gz
(4.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file b3cotahist-0.1.8.tar.gz.
File metadata
- Download URL: b3cotahist-0.1.8.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.7 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b9bf9bd021556b3d014618b99a35b8c8c36bc5b4f1245ad4a0ba233f812fdfe
|
|
| MD5 |
759e19dfc1eaa2f9267f1f077de74581
|
|
| BLAKE2b-256 |
6c805663f9b32c714ce5b4278294e8d1bf99777a2ddc611cae733fe5cf59575d
|
File details
Details for the file b3cotahist-0.1.8-py3-none-any.whl.
File metadata
- Download URL: b3cotahist-0.1.8-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.7 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f963989e1bf0a1e205478906ed921de7bceec45acad0f626125c29e6b505031f
|
|
| MD5 |
41ed165be5aab392ec408e2eddaad7c8
|
|
| BLAKE2b-256 |
c41f5eb85b9b82d9288e4050fb16f36e222ebbd919c4a587b61543c626bedc2b
|