Name | b3cotahist JSON |
Version |
0.1.9
JSON |
| download |
home_page | None |
Summary | Biblioteca Python para leitura e fetch do arquivo COTAHIST da B3. Suporta tanto pandas quanto polars como engines. |
upload_time | 2024-11-26 15:28:40 |
maintainer | None |
docs_url | None |
author | renanmoretto |
requires_python | <4.0,>=3.10 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# b3cotahist
Biblioteca Python para leitura e fetch do arquivo COTAHIST da B3.
## Instalação
```bash
pip install b3cotahist
```
## Uso
### Fetch da B3
```python
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
```python
df = b3cotahist.read_zip(path='COTAHIST_D20240301.ZIP')
df = b3cotahist.read_txt(path='COTAHIST_D20240301.TXT')
```
### Leitura de bytes
```python
# 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)
```
Raw data
{
"_id": null,
"home_page": null,
"name": "b3cotahist",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": null,
"author": "renanmoretto",
"author_email": "himynameisrenan@outlook.com",
"download_url": "https://files.pythonhosted.org/packages/d7/04/7054203c1df53770c9189de4e7f598213f41bc07a48ecd22d443fc1246ef/b3cotahist-0.1.9.tar.gz",
"platform": null,
"description": "# b3cotahist\n\nBiblioteca Python para leitura e fetch do arquivo COTAHIST da B3.\n\n## Instala\u00e7\u00e3o\n\n```bash\npip install b3cotahist\n```\n\n## Uso\n\n### Fetch da B3\n\n```python\nimport datetime\nimport b3cotahist\n\n# Fetch dos dados do preg\u00e3o de 01/03/2024\n\ndate = datetime.date(2024, 3, 1)\n\ndf = b3cotahist.get(date)\n\n# Caso tenha problemas com SSL da b3\ndf = b3cotahist.get(date, raise_ssl_error=False)\n\n# A B3 tamb\u00e9m disponibiliza dados consolidados por ano\ndf = b3cotahist.get_year(2024)\n```\n\n### Leitura de arquivos\n\n```python\ndf = b3cotahist.read_zip(path='COTAHIST_D20240301.ZIP')\n\ndf = b3cotahist.read_txt(path='COTAHIST_D20240301.TXT')\n```\n\n### Leitura de bytes\n\n```python\n# Lendo a partir de bytes\nwith open('COTAHIST_D20240301.TXT', 'rb') as f:\n dados = f.read()\ndf = b3cotahist.read_bytes(dados)\n\n# Ou a partir de BytesIO\nimport io\nbytes_io = io.BytesIO(dados)\ndf = b3cotahist.read_bytes(bytes_io)\n```",
"bugtrack_url": null,
"license": null,
"summary": "Biblioteca Python para leitura e fetch do arquivo COTAHIST da B3. Suporta tanto pandas quanto polars como engines.",
"version": "0.1.9",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2a9e0763fb7318a38fd40a3de8ded12433203ce5d3ce0646b15e7978583a9168",
"md5": "f1e14cb3bf74bd3970c64dea0b8b5840",
"sha256": "d962dd8a7ab703d03453e8a63b5a863af6b42f509310b4df55e348d9cde9dfb8"
},
"downloads": -1,
"filename": "b3cotahist-0.1.9-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f1e14cb3bf74bd3970c64dea0b8b5840",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 5145,
"upload_time": "2024-11-26T15:28:38",
"upload_time_iso_8601": "2024-11-26T15:28:38.772184Z",
"url": "https://files.pythonhosted.org/packages/2a/9e/0763fb7318a38fd40a3de8ded12433203ce5d3ce0646b15e7978583a9168/b3cotahist-0.1.9-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d7047054203c1df53770c9189de4e7f598213f41bc07a48ecd22d443fc1246ef",
"md5": "a7392b775a53b914cd7adf59ef830aa2",
"sha256": "e4793484cbfbd5de736ae8fb7e252758668ee549dd7ed87ff763d67729fb1a7c"
},
"downloads": -1,
"filename": "b3cotahist-0.1.9.tar.gz",
"has_sig": false,
"md5_digest": "a7392b775a53b914cd7adf59ef830aa2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 4755,
"upload_time": "2024-11-26T15:28:40",
"upload_time_iso_8601": "2024-11-26T15:28:40.777700Z",
"url": "https://files.pythonhosted.org/packages/d7/04/7054203c1df53770c9189de4e7f598213f41bc07a48ecd22d443fc1246ef/b3cotahist-0.1.9.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-26 15:28:40",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "b3cotahist"
}