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.
Files changed (71) hide show
  1. {pyield-0.48.2 → pyield-0.48.3}/PKG-INFO +1 -1
  2. pyield-0.48.3/pyield/__about__.py +1 -0
  3. pyield-0.48.3/pyield/ipca/__init__.py +10 -0
  4. {pyield-0.48.2 → pyield-0.48.3}/pyield/ipca/historico.py +6 -6
  5. {pyield-0.48.2 → pyield-0.48.3}/pyield/tn/ntnc.py +6 -8
  6. pyield-0.48.2/pyield/__about__.py +0 -1
  7. pyield-0.48.2/pyield/ipca/__init__.py +0 -10
  8. {pyield-0.48.2 → pyield-0.48.3}/.gitignore +0 -0
  9. {pyield-0.48.2 → pyield-0.48.3}/LICENSE +0 -0
  10. {pyield-0.48.2 → pyield-0.48.3}/README.md +0 -0
  11. {pyield-0.48.2 → pyield-0.48.3}/pyield/__init__.py +0 -0
  12. {pyield-0.48.2 → pyield-0.48.3}/pyield/_internal/__init__.py +0 -0
  13. {pyield-0.48.2 → pyield-0.48.3}/pyield/_internal/br_numbers.py +0 -0
  14. {pyield-0.48.2 → pyield-0.48.3}/pyield/_internal/cache.py +0 -0
  15. {pyield-0.48.2 → pyield-0.48.3}/pyield/_internal/converters.py +0 -0
  16. {pyield-0.48.2 → pyield-0.48.3}/pyield/_internal/data_cache.py +0 -0
  17. {pyield-0.48.2 → pyield-0.48.3}/pyield/_internal/retry.py +0 -0
  18. {pyield-0.48.2 → pyield-0.48.3}/pyield/_internal/types.py +0 -0
  19. {pyield-0.48.2 → pyield-0.48.3}/pyield/anbima/__init__.py +0 -0
  20. {pyield-0.48.2 → pyield-0.48.3}/pyield/anbima/ettj_intradia.py +0 -0
  21. {pyield-0.48.2 → pyield-0.48.3}/pyield/anbima/ettj_ultima.py +0 -0
  22. {pyield-0.48.2 → pyield-0.48.3}/pyield/anbima/ima_ultimo.py +0 -0
  23. {pyield-0.48.2 → pyield-0.48.3}/pyield/anbima/imaq.py +0 -0
  24. {pyield-0.48.2 → pyield-0.48.3}/pyield/anbima/tpf.py +0 -0
  25. {pyield-0.48.2 → pyield-0.48.3}/pyield/b3/__init__.py +0 -0
  26. {pyield-0.48.2 → pyield-0.48.3}/pyield/b3/_contratos.py +0 -0
  27. {pyield-0.48.2 → pyield-0.48.3}/pyield/b3/_validar_pregao.py +0 -0
  28. {pyield-0.48.2 → pyield-0.48.3}/pyield/b3/boletim.py +0 -0
  29. {pyield-0.48.2 → pyield-0.48.3}/pyield/b3/derivativos_intradia.py +0 -0
  30. {pyield-0.48.2 → pyield-0.48.3}/pyield/b3/di1.py +0 -0
  31. {pyield-0.48.2 → pyield-0.48.3}/pyield/b3/di_over.py +0 -0
  32. {pyield-0.48.2 → pyield-0.48.3}/pyield/b3/futuro/__init__.py +0 -0
  33. {pyield-0.48.2 → pyield-0.48.3}/pyield/b3/futuro/contratos.py +0 -0
  34. {pyield-0.48.2 → pyield-0.48.3}/pyield/b3/futuro/historico.py +0 -0
  35. {pyield-0.48.2 → pyield-0.48.3}/pyield/b3/futuro/intradia.py +0 -0
  36. {pyield-0.48.2 → pyield-0.48.3}/pyield/bc/__init__.py +0 -0
  37. {pyield-0.48.2 → pyield-0.48.3}/pyield/bc/compromissada.py +0 -0
  38. {pyield-0.48.2 → pyield-0.48.3}/pyield/bc/copom.py +0 -0
  39. {pyield-0.48.2 → pyield-0.48.3}/pyield/bc/leiloes.py +0 -0
  40. {pyield-0.48.2 → pyield-0.48.3}/pyield/bc/ptax.py +0 -0
  41. {pyield-0.48.2 → pyield-0.48.3}/pyield/bc/taxas.py +0 -0
  42. {pyield-0.48.2 → pyield-0.48.3}/pyield/bc/tpf_intradia.py +0 -0
  43. {pyield-0.48.2 → pyield-0.48.3}/pyield/bc/tpf_mensal.py +0 -0
  44. {pyield-0.48.2 → pyield-0.48.3}/pyield/bc/vna.py +0 -0
  45. {pyield-0.48.2 → pyield-0.48.3}/pyield/dus/__init__.py +0 -0
  46. {pyield-0.48.2 → pyield-0.48.3}/pyield/dus/core.py +0 -0
  47. {pyield-0.48.2 → pyield-0.48.3}/pyield/dus/feriados/__init__.py +0 -0
  48. {pyield-0.48.2 → pyield-0.48.3}/pyield/dus/feriados/feriados_antigos_br.txt +0 -0
  49. {pyield-0.48.2 → pyield-0.48.3}/pyield/dus/feriados/feriados_br.py +0 -0
  50. {pyield-0.48.2 → pyield-0.48.3}/pyield/dus/feriados/feriados_novos_br.txt +0 -0
  51. {pyield-0.48.2 → pyield-0.48.3}/pyield/fwd.py +0 -0
  52. {pyield-0.48.2 → pyield-0.48.3}/pyield/interpolador.py +0 -0
  53. {pyield-0.48.2 → pyield-0.48.3}/pyield/ipca/projetado.py +0 -0
  54. {pyield-0.48.2 → pyield-0.48.3}/pyield/py.typed +0 -0
  55. {pyield-0.48.2 → pyield-0.48.3}/pyield/relogio.py +0 -0
  56. {pyield-0.48.2 → pyield-0.48.3}/pyield/selic/__init__.py +0 -0
  57. {pyield-0.48.2 → pyield-0.48.3}/pyield/selic/cpm.py +0 -0
  58. {pyield-0.48.2 → pyield-0.48.3}/pyield/selic/probabilities.py +0 -0
  59. {pyield-0.48.2 → pyield-0.48.3}/pyield/tn/__init__.py +0 -0
  60. {pyield-0.48.2 → pyield-0.48.3}/pyield/tn/benchmark.py +0 -0
  61. {pyield-0.48.2 → pyield-0.48.3}/pyield/tn/leiloes.py +0 -0
  62. {pyield-0.48.2 → pyield-0.48.3}/pyield/tn/lft.py +0 -0
  63. {pyield-0.48.2 → pyield-0.48.3}/pyield/tn/ltn.py +0 -0
  64. {pyield-0.48.2 → pyield-0.48.3}/pyield/tn/ntnb.py +0 -0
  65. {pyield-0.48.2 → pyield-0.48.3}/pyield/tn/ntnb1.py +0 -0
  66. {pyield-0.48.2 → pyield-0.48.3}/pyield/tn/ntnbprinc.py +0 -0
  67. {pyield-0.48.2 → pyield-0.48.3}/pyield/tn/ntnf.py +0 -0
  68. {pyield-0.48.2 → pyield-0.48.3}/pyield/tn/pre.py +0 -0
  69. {pyield-0.48.2 → pyield-0.48.3}/pyield/tn/rmd.py +0 -0
  70. {pyield-0.48.2 → pyield-0.48.3}/pyield/tn/utils.py +0 -0
  71. {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.2
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"
@@ -0,0 +1,10 @@
1
+ from pyield.ipca.historico import indices, indices_ultimos, taxas, taxas_ultimas
2
+ from pyield.ipca.projetado import taxa_projetada
3
+
4
+ __all__ = [
5
+ "indices",
6
+ "indices_ultimos",
7
+ "taxa_projetada",
8
+ "taxas",
9
+ "taxas_ultimas",
10
+ ]
@@ -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 ultimas_taxas(qtd_meses: int = 1) -> pl.DataFrame:
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.ultimas_taxas(1)
146
+ >>> df = ipca.taxas_ultimas(1)
147
147
  >>> # Obter as taxas do IPCA dos últimos 3 meses
148
- >>> df = ipca.ultimas_taxas(3)
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 ultimos_indices(qtd_meses: int = 1) -> pl.DataFrame:
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.ultimos_indices(1)
175
+ >>> df = ipca.indices_ultimos(1)
176
176
  >>> # Obter os números-índice do IPCA dos últimos 3 meses
177
- >>> df = ipca.ultimos_indices(3)
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, duracao)
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
- # Check if maturity date is after the start date
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
- # Initialize loop variables
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
- # Build dataframe and assign cash flows using Polars expressions
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 duracao(
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.duracao("21-03-2025", "01-01-2031", 0.067626)
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"
@@ -1,10 +0,0 @@
1
- from pyield.ipca.historico import indices, taxas, ultimas_taxas, ultimos_indices
2
- from pyield.ipca.projetado import taxa_projetada
3
-
4
- __all__ = [
5
- "indices",
6
- "taxas",
7
- "ultimas_taxas",
8
- "ultimos_indices",
9
- "taxa_projetada",
10
- ]
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