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)
# A B3 também disponibiliza dados consolidados por ano
df = b3cotahist.get_year(2024)
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.9.tar.gz
(4.8 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.9.tar.gz.
File metadata
- Download URL: b3cotahist-0.1.9.tar.gz
- Upload date:
- Size: 4.8 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 |
e4793484cbfbd5de736ae8fb7e252758668ee549dd7ed87ff763d67729fb1a7c
|
|
| MD5 |
a7392b775a53b914cd7adf59ef830aa2
|
|
| BLAKE2b-256 |
d7047054203c1df53770c9189de4e7f598213f41bc07a48ecd22d443fc1246ef
|
File details
Details for the file b3cotahist-0.1.9-py3-none-any.whl.
File metadata
- Download URL: b3cotahist-0.1.9-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 |
d962dd8a7ab703d03453e8a63b5a863af6b42f509310b4df55e348d9cde9dfb8
|
|
| MD5 |
f1e14cb3bf74bd3970c64dea0b8b5840
|
|
| BLAKE2b-256 |
2a9e0763fb7318a38fd40a3de8ded12433203ce5d3ce0646b15e7978583a9168
|