Um parser para os arquivos de histórico de cotações da B3.
Project description
B3Parser
Um parser para os arquivos de histórico de cotações da B3
Exemplo de utilização (main.py)
from b3parser import B3Parser
if __name__ == '__main__':
cols_sel = [
'data_pregao',
'cod_bdi',
'cod_papel',
'tp_merc',
'nome_resum',
'espec_papel',
'preco_ultimo',
'fator_cotacao',
]
cods_bdi = [
'02', # LOTE PADRÃO
'12', # FUNDOS IMOBILIÁRIOS
'96', # FRACIONÁRIO
]
tps_merc = [
'010', # VISTA
'020', # FRACIONÁRIO
]
filtros = {
'cod_bdi': ( 'in', cods_bdi ),
'tp_merc': ( 'in', tps_merc ),
}
ano = 2015
parser = B3Parser( 'data/COTAHIST_A{0}.TXT'.format( ano ) )
parser.ler_arquivo( cols_sel = cols_sel, filtros = filtros )
parser.exportar_json( 'data/{0}.json'.format( ano ) )
#parser.exportar_sql( 'data/{0}.sql'.format( ano ) )
#parser.exportar_csv( 'data/{0}.csv'.format( ano ) )
Links úteis
Dependências
Cotações históricas
- Cotações Históricas - Busca por cotações históricas
- Layout das cotações históricas
Arquivos de cotações históricas
- Anuais: Formato
COTAHIST_AAAAA.ZIP - Mensais (últimos 12 meses): Formato
COTAHIST_MMMAAAA.ZIP - Diárias (ano corrente): Formato
COTAHIST_DDDMMAAAA.ZIP
Títulos negociáveis
- Títulos Negociáveis: Busca por títulos negociáveis
- Títulos Negociados: Títulos negociados atualmente
- Glossário dos títulos negociáveis
Projetos similares no GitHub
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
b3parser-0.1.7.tar.gz
(10.6 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
b3parser-0.1.7-py3-none-any.whl
(12.3 kB
view details)
File details
Details for the file b3parser-0.1.7.tar.gz.
File metadata
- Download URL: b3parser-0.1.7.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60d583182e21338aa3fbc9a724a7594afa324b0d5659d27b456d5518c93408c7
|
|
| MD5 |
989505eae0e6a43aa08946667211f63d
|
|
| BLAKE2b-256 |
dad5960102145b8f998d9bad3444e601c14ab32ef13b7814b7a4a923ea7a0223
|
File details
Details for the file b3parser-0.1.7-py3-none-any.whl.
File metadata
- Download URL: b3parser-0.1.7-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0de041c801f9748aaf754f3673479ec94a0796c9bbf99fcee49190639c0e803c
|
|
| MD5 |
0833ae69b1e43f6692cc267fe0f18a56
|
|
| BLAKE2b-256 |
575bdb71c08559de9188786d8fbb628e529242fdf6497783a347e08181c4edfe
|