pyield 0.47.1__tar.gz → 0.47.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyield-0.47.1 → pyield-0.47.2}/PKG-INFO +1 -1
- pyield-0.47.2/pyield/__about__.py +1 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/b3/derivatives_intraday.py +8 -10
- {pyield-0.47.1 → pyield-0.47.2}/pyield/b3/futures/intraday.py +6 -2
- pyield-0.47.1/pyield/__about__.py +0 -1
- {pyield-0.47.1 → pyield-0.47.2}/.gitignore +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/LICENSE +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/README.md +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/__init__.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/_internal/__init__.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/_internal/br_numbers.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/_internal/cache.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/_internal/converters.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/_internal/data_cache.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/_internal/retry.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/_internal/types.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/anbima/__init__.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/anbima/ettj_intraday.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/anbima/ettj_last.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/anbima/ima.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/anbima/imaq.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/anbima/tpf.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/b3/__init__.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/b3/_contracts.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/b3/_validar_pregao.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/b3/di1.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/b3/di_over.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/b3/futures/__init__.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/b3/futures/common.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/b3/futures/historical.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/b3/price_report.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/bc/__init__.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/bc/auction.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/bc/copom.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/bc/ptax_api.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/bc/rates.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/bc/repo.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/bc/trades_intraday.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/bc/trades_monthly.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/bc/vna.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/bday/__init__.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/bday/core.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/bday/holidays/br_holidays_new.txt +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/bday/holidays/br_holidays_old.txt +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/bday/holidays/brholidays.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/clock.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/fwd.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/interpolator.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/ipca/__init__.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/ipca/historical.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/ipca/projected.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/py.typed +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/rmd.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/selic/__init__.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/selic/cpm.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/selic/probabilities.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/tn/__init__.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/tn/auctions.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/tn/benchmark.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/tn/lft.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/tn/ltn.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/tn/ntnb.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/tn/ntnb1.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/tn/ntnbprinc.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/tn/ntnc.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/tn/ntnf.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/tn/pre.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyield/tn/utils.py +0 -0
- {pyield-0.47.1 → pyield-0.47.2}/pyproject.toml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyield
|
|
3
|
-
Version: 0.47.
|
|
3
|
+
Version: 0.47.2
|
|
4
4
|
Summary: A Python library for analysis of fixed income instruments in Brazil
|
|
5
5
|
Project-URL: Homepage, https://github.com/crdcj/PYield
|
|
6
6
|
Project-URL: Documentation, https://crdcj.github.io/PYield
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.47.2"
|
|
@@ -35,7 +35,6 @@ import requests
|
|
|
35
35
|
from pyield import clock
|
|
36
36
|
from pyield._internal.cache import ttl_cache
|
|
37
37
|
from pyield._internal.retry import retry_padrao
|
|
38
|
-
from pyield.b3._validar_pregao import intraday_disponivel
|
|
39
38
|
|
|
40
39
|
URL_BASE_INTRADAY = "https://cotacao.b3.com.br/mds/api/v1/DerivativeQuotation"
|
|
41
40
|
|
|
@@ -123,7 +122,8 @@ def derivatives_intraday_fetch(contract_code: str) -> pl.DataFrame:
|
|
|
123
122
|
derivados devem ser feitos no módulo consumidor.
|
|
124
123
|
|
|
125
124
|
Args:
|
|
126
|
-
contract_code: Código base do derivativo na B3
|
|
125
|
+
contract_code: Código base do derivativo na B3
|
|
126
|
+
(ex.: ``DI1``, ``DOL``, ``DAP``, ``DDI``, ``FRC``, ``FRO``, ``IND``).
|
|
127
127
|
|
|
128
128
|
Returns:
|
|
129
129
|
DataFrame Polars com o payload normalizado da API.
|
|
@@ -150,19 +150,17 @@ def derivatives_intraday_fetch(contract_code: str) -> pl.DataFrame:
|
|
|
150
150
|
* preco_oferta_compra (Float64): melhor oferta de compra (opcional).
|
|
151
151
|
* preco_oferta_venda (Float64): melhor oferta de venda (opcional).
|
|
152
152
|
* tipo_lado (String): tipo de lado (opcional).
|
|
153
|
-
*
|
|
154
|
-
|
|
153
|
+
* horario_referencia (Time): horário aproximado a que os
|
|
154
|
+
dados se referem. A fonte intraday da B3 possui atraso de
|
|
155
|
+
~15 min; este valor é calculado subtraindo esse atraso do
|
|
156
|
+
horário da consulta.
|
|
155
157
|
"""
|
|
156
|
-
if not intraday_disponivel():
|
|
157
|
-
return pl.DataFrame()
|
|
158
|
-
|
|
159
158
|
dados_json = _buscar_json_intraday(contract_code)
|
|
160
159
|
if not dados_json:
|
|
161
160
|
return pl.DataFrame()
|
|
162
161
|
|
|
163
162
|
df = _converter_json_intraday(dados_json)
|
|
164
163
|
df = _processar_colunas_intraday(df)
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
)
|
|
164
|
+
horario = (clock.now() - dt.timedelta(minutes=15)).time()
|
|
165
|
+
df = df.with_columns(horario_referencia=horario)
|
|
168
166
|
return df.sort("codigo_negociacao")
|
|
@@ -2,6 +2,7 @@ import polars as pl
|
|
|
2
2
|
import polars.selectors as cs
|
|
3
3
|
|
|
4
4
|
from pyield import bday
|
|
5
|
+
from pyield.b3._validar_pregao import intraday_disponivel
|
|
5
6
|
from pyield.b3.derivatives_intraday import derivatives_intraday_fetch
|
|
6
7
|
from pyield.b3.futures.common import CONTRATOS_TAXA, expr_dv01
|
|
7
8
|
from pyield.fwd import forwards
|
|
@@ -24,7 +25,7 @@ _PRECO_PARA_TAXA_INTRADAY = {
|
|
|
24
25
|
# mutuamente exclusivas — o rename no preprocessamento garante isso.
|
|
25
26
|
_ORDEM_COLUNAS = (
|
|
26
27
|
"data_referencia",
|
|
27
|
-
"
|
|
28
|
+
"horario_referencia",
|
|
28
29
|
"codigo_negociacao",
|
|
29
30
|
"data_vencimento",
|
|
30
31
|
"dias_uteis",
|
|
@@ -62,7 +63,7 @@ def intraday(codigo_contrato: str) -> pl.DataFrame:
|
|
|
62
63
|
"""Busca os dados intraday mais recentes da B3.
|
|
63
64
|
|
|
64
65
|
Os dados intraday da fonte possuem atraso aproximado de 15 minutos.
|
|
65
|
-
A coluna ``
|
|
66
|
+
A coluna ``horario_referencia`` reflete essa defasagem.
|
|
66
67
|
|
|
67
68
|
Args:
|
|
68
69
|
codigo_contrato: Código base do contrato futuro na B3.
|
|
@@ -75,6 +76,9 @@ def intraday(codigo_contrato: str) -> pl.DataFrame:
|
|
|
75
76
|
por preço (ex.: DOL, IND). As com prefixo ``taxa_`` aparecem para
|
|
76
77
|
contratos cotados por taxa (ex.: DI1, DAP, DDI, FRC, FRO).
|
|
77
78
|
"""
|
|
79
|
+
if not intraday_disponivel():
|
|
80
|
+
return pl.DataFrame()
|
|
81
|
+
|
|
78
82
|
df = derivatives_intraday_fetch(codigo_contrato)
|
|
79
83
|
if df.is_empty():
|
|
80
84
|
return pl.DataFrame()
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.47.1"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|