pyield 0.48.2__tar.gz → 0.48.3__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.48.2 → pyield-0.48.3}/PKG-INFO +1 -1
- pyield-0.48.3/pyield/__about__.py +1 -0
- pyield-0.48.3/pyield/ipca/__init__.py +10 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/ipca/historico.py +6 -6
- {pyield-0.48.2 → pyield-0.48.3}/pyield/tn/ntnc.py +6 -8
- pyield-0.48.2/pyield/__about__.py +0 -1
- pyield-0.48.2/pyield/ipca/__init__.py +0 -10
- {pyield-0.48.2 → pyield-0.48.3}/.gitignore +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/LICENSE +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/README.md +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/__init__.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/_internal/__init__.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/_internal/br_numbers.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/_internal/cache.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/_internal/converters.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/_internal/data_cache.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/_internal/retry.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/_internal/types.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/anbima/__init__.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/anbima/ettj_intradia.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/anbima/ettj_ultima.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/anbima/ima_ultimo.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/anbima/imaq.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/anbima/tpf.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/b3/__init__.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/b3/_contratos.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/b3/_validar_pregao.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/b3/boletim.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/b3/derivativos_intradia.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/b3/di1.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/b3/di_over.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/b3/futuro/__init__.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/b3/futuro/contratos.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/b3/futuro/historico.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/b3/futuro/intradia.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/bc/__init__.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/bc/compromissada.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/bc/copom.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/bc/leiloes.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/bc/ptax.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/bc/taxas.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/bc/tpf_intradia.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/bc/tpf_mensal.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/bc/vna.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/dus/__init__.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/dus/core.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/dus/feriados/__init__.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/dus/feriados/feriados_antigos_br.txt +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/dus/feriados/feriados_br.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/dus/feriados/feriados_novos_br.txt +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/fwd.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/interpolador.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/ipca/projetado.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/py.typed +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/relogio.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/selic/__init__.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/selic/cpm.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/selic/probabilities.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/tn/__init__.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/tn/benchmark.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/tn/leiloes.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/tn/lft.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/tn/ltn.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/tn/ntnb.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/tn/ntnb1.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/tn/ntnbprinc.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/tn/ntnf.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/tn/pre.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/tn/rmd.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyield/tn/utils.py +0 -0
- {pyield-0.48.2 → pyield-0.48.3}/pyproject.toml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyield
|
|
3
|
-
Version: 0.48.
|
|
3
|
+
Version: 0.48.3
|
|
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.48.3"
|
|
@@ -121,7 +121,7 @@ def taxas(data_inicial: DateLike, data_final: DateLike) -> pl.DataFrame:
|
|
|
121
121
|
return _buscar_periodo(data_inicial, data_final, _VAR_TAXA, em_percentual=True)
|
|
122
122
|
|
|
123
123
|
|
|
124
|
-
def
|
|
124
|
+
def taxas_ultimas(qtd_meses: int = 1) -> pl.DataFrame:
|
|
125
125
|
"""Obtém as últimas taxas mensais do IPCA.
|
|
126
126
|
|
|
127
127
|
Realiza chamada à API do portal de dados do IBGE no formato:
|
|
@@ -143,14 +143,14 @@ def ultimas_taxas(qtd_meses: int = 1) -> pl.DataFrame:
|
|
|
143
143
|
Examples:
|
|
144
144
|
>>> from pyield import ipca
|
|
145
145
|
>>> # Obter a taxa do IPCA do último mês
|
|
146
|
-
>>> df = ipca.
|
|
146
|
+
>>> df = ipca.taxas_ultimas(1)
|
|
147
147
|
>>> # Obter as taxas do IPCA dos últimos 3 meses
|
|
148
|
-
>>> df = ipca.
|
|
148
|
+
>>> df = ipca.taxas_ultimas(3)
|
|
149
149
|
"""
|
|
150
150
|
return _buscar_ultimos(qtd_meses, _VAR_TAXA, em_percentual=True)
|
|
151
151
|
|
|
152
152
|
|
|
153
|
-
def
|
|
153
|
+
def indices_ultimos(qtd_meses: int = 1) -> pl.DataFrame:
|
|
154
154
|
"""Obtém os últimos valores do número-índice do IPCA.
|
|
155
155
|
|
|
156
156
|
Realiza chamada à API do portal de dados do IBGE no formato:
|
|
@@ -172,9 +172,9 @@ def ultimos_indices(qtd_meses: int = 1) -> pl.DataFrame:
|
|
|
172
172
|
Examples:
|
|
173
173
|
>>> from pyield import ipca
|
|
174
174
|
>>> # Obter o número-índice do IPCA do último mês
|
|
175
|
-
>>> df = ipca.
|
|
175
|
+
>>> df = ipca.indices_ultimos(1)
|
|
176
176
|
>>> # Obter os números-índice do IPCA dos últimos 3 meses
|
|
177
|
-
>>> df = ipca.
|
|
177
|
+
>>> df = ipca.indices_ultimos(3)
|
|
178
178
|
"""
|
|
179
179
|
return _buscar_ultimos(qtd_meses, _VAR_INDICE)
|
|
180
180
|
|
|
@@ -83,7 +83,7 @@ def dados(data: DateLike) -> pl.DataFrame:
|
|
|
83
83
|
)
|
|
84
84
|
|
|
85
85
|
# Adiciona duration, prazo_medio, dv01, dv01_usd e taxa_di
|
|
86
|
-
df = utils.adicionar_duration(df,
|
|
86
|
+
df = utils.adicionar_duration(df, duration)
|
|
87
87
|
df = utils.adicionar_dv01(df, data_ref)
|
|
88
88
|
df = utils.adicionar_taxa_di(df, data_ref)
|
|
89
89
|
|
|
@@ -148,15 +148,13 @@ def datas_pagamento(
|
|
|
148
148
|
liquidacao = conversores.converter_datas(data_liquidacao)
|
|
149
149
|
vencimento = conversores.converter_datas(data_vencimento)
|
|
150
150
|
|
|
151
|
-
#
|
|
151
|
+
# Retorna vazio se vencimento for anterior à liquidação
|
|
152
152
|
if vencimento < liquidacao:
|
|
153
153
|
return pl.Series(name="datas_pagamento", dtype=pl.Date)
|
|
154
154
|
|
|
155
|
-
#
|
|
155
|
+
# Itera de trás para frente, do vencimento até a liquidação
|
|
156
156
|
data_cupom = vencimento
|
|
157
157
|
datas_cupons = []
|
|
158
|
-
|
|
159
|
-
# Iterate backwards from the maturity date to the settlement date
|
|
160
158
|
while data_cupom > liquidacao:
|
|
161
159
|
datas_cupons.append(data_cupom)
|
|
162
160
|
# Retrocede 6 meses
|
|
@@ -227,7 +225,7 @@ def fluxos_caixa(
|
|
|
227
225
|
valor_cupom = _obter_valor_cupom(vencimento)
|
|
228
226
|
valor_final = _obter_valor_final(vencimento)
|
|
229
227
|
|
|
230
|
-
#
|
|
228
|
+
# Monta DataFrame com fluxos de caixa
|
|
231
229
|
df = pl.DataFrame({"data_pagamento": serie_datas_pagamento}).with_columns(
|
|
232
230
|
pl.when(pl.col("data_pagamento") == vencimento)
|
|
233
231
|
.then(valor_final)
|
|
@@ -359,7 +357,7 @@ def taxa(
|
|
|
359
357
|
return round(taxa_encontrada, 6)
|
|
360
358
|
|
|
361
359
|
|
|
362
|
-
def
|
|
360
|
+
def duration(
|
|
363
361
|
data_liquidacao: DateLike,
|
|
364
362
|
data_vencimento: DateLike,
|
|
365
363
|
taxa: float,
|
|
@@ -377,7 +375,7 @@ def duracao(
|
|
|
377
375
|
|
|
378
376
|
Examples:
|
|
379
377
|
>>> from pyield import ntnc
|
|
380
|
-
>>> ntnc.
|
|
378
|
+
>>> ntnc.duration("21-03-2025", "01-01-2031", 0.067626)
|
|
381
379
|
4.405363320448
|
|
382
380
|
"""
|
|
383
381
|
if any_is_empty(data_liquidacao, data_vencimento, taxa):
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.48.2"
|
|
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
|