pyield 0.49.2__tar.gz → 0.49.4__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 (64) hide show
  1. {pyield-0.49.2 → pyield-0.49.4}/PKG-INFO +2 -1
  2. {pyield-0.49.2 → pyield-0.49.4}/pyield/_internal/cache.py +6 -5
  3. {pyield-0.49.2 → pyield-0.49.4}/pyield/relogio.py +13 -4
  4. {pyield-0.49.2 → pyield-0.49.4}/pyproject.toml +2 -1
  5. {pyield-0.49.2 → pyield-0.49.4}/LICENSE +0 -0
  6. {pyield-0.49.2 → pyield-0.49.4}/README.md +0 -0
  7. {pyield-0.49.2 → pyield-0.49.4}/pyield/__init__.py +0 -0
  8. {pyield-0.49.2 → pyield-0.49.4}/pyield/_internal/__init__.py +0 -0
  9. {pyield-0.49.2 → pyield-0.49.4}/pyield/_internal/br_numbers.py +0 -0
  10. {pyield-0.49.2 → pyield-0.49.4}/pyield/_internal/converters.py +0 -0
  11. {pyield-0.49.2 → pyield-0.49.4}/pyield/_internal/data_cache.py +0 -0
  12. {pyield-0.49.2 → pyield-0.49.4}/pyield/_internal/retry.py +0 -0
  13. {pyield-0.49.2 → pyield-0.49.4}/pyield/_internal/types.py +0 -0
  14. {pyield-0.49.2 → pyield-0.49.4}/pyield/anbima/__init__.py +0 -0
  15. {pyield-0.49.2 → pyield-0.49.4}/pyield/anbima/imaq.py +0 -0
  16. {pyield-0.49.2 → pyield-0.49.4}/pyield/anbima/mercado_secundario.py +0 -0
  17. {pyield-0.49.2 → pyield-0.49.4}/pyield/b3/__init__.py +0 -0
  18. {pyield-0.49.2 → pyield-0.49.4}/pyield/b3/_contratos.py +0 -0
  19. {pyield-0.49.2 → pyield-0.49.4}/pyield/b3/_validar_pregao.py +0 -0
  20. {pyield-0.49.2 → pyield-0.49.4}/pyield/b3/boletim.py +0 -0
  21. {pyield-0.49.2 → pyield-0.49.4}/pyield/b3/derivativos_intradia.py +0 -0
  22. {pyield-0.49.2 → pyield-0.49.4}/pyield/b3/di_over.py +0 -0
  23. {pyield-0.49.2 → pyield-0.49.4}/pyield/bc/__init__.py +0 -0
  24. {pyield-0.49.2 → pyield-0.49.4}/pyield/bc/_olinda.py +0 -0
  25. {pyield-0.49.2 → pyield-0.49.4}/pyield/bc/leiloes.py +0 -0
  26. {pyield-0.49.2 → pyield-0.49.4}/pyield/bc/sgs.py +0 -0
  27. {pyield-0.49.2 → pyield-0.49.4}/pyield/bc/tpf_intradia.py +0 -0
  28. {pyield-0.49.2 → pyield-0.49.4}/pyield/bc/tpf_mensal.py +0 -0
  29. {pyield-0.49.2 → pyield-0.49.4}/pyield/bc/vna.py +0 -0
  30. {pyield-0.49.2 → pyield-0.49.4}/pyield/di1.py +0 -0
  31. {pyield-0.49.2 → pyield-0.49.4}/pyield/du/__init__.py +0 -0
  32. {pyield-0.49.2 → pyield-0.49.4}/pyield/du/core.py +0 -0
  33. {pyield-0.49.2 → pyield-0.49.4}/pyield/du/feriados/__init__.py +0 -0
  34. {pyield-0.49.2 → pyield-0.49.4}/pyield/du/feriados/feriados_antigos_br.txt +0 -0
  35. {pyield-0.49.2 → pyield-0.49.4}/pyield/du/feriados/feriados_br.py +0 -0
  36. {pyield-0.49.2 → pyield-0.49.4}/pyield/du/feriados/feriados_novos_br.txt +0 -0
  37. {pyield-0.49.2 → pyield-0.49.4}/pyield/futuro/__init__.py +0 -0
  38. {pyield-0.49.2 → pyield-0.49.4}/pyield/futuro/contratos.py +0 -0
  39. {pyield-0.49.2 → pyield-0.49.4}/pyield/futuro/historico.py +0 -0
  40. {pyield-0.49.2 → pyield-0.49.4}/pyield/futuro/intradia.py +0 -0
  41. {pyield-0.49.2 → pyield-0.49.4}/pyield/fwd.py +0 -0
  42. {pyield-0.49.2 → pyield-0.49.4}/pyield/interpolador.py +0 -0
  43. {pyield-0.49.2 → pyield-0.49.4}/pyield/ipca/__init__.py +0 -0
  44. {pyield-0.49.2 → pyield-0.49.4}/pyield/ipca/historico.py +0 -0
  45. {pyield-0.49.2 → pyield-0.49.4}/pyield/ipca/projetado.py +0 -0
  46. {pyield-0.49.2 → pyield-0.49.4}/pyield/lft.py +0 -0
  47. {pyield-0.49.2 → pyield-0.49.4}/pyield/ltn.py +0 -0
  48. {pyield-0.49.2 → pyield-0.49.4}/pyield/ntnb.py +0 -0
  49. {pyield-0.49.2 → pyield-0.49.4}/pyield/ntnb1.py +0 -0
  50. {pyield-0.49.2 → pyield-0.49.4}/pyield/ntnbprinc.py +0 -0
  51. {pyield-0.49.2 → pyield-0.49.4}/pyield/ntnc.py +0 -0
  52. {pyield-0.49.2 → pyield-0.49.4}/pyield/ntnf.py +0 -0
  53. {pyield-0.49.2 → pyield-0.49.4}/pyield/py.typed +0 -0
  54. {pyield-0.49.2 → pyield-0.49.4}/pyield/selic/__init__.py +0 -0
  55. {pyield-0.49.2 → pyield-0.49.4}/pyield/selic/compromissada.py +0 -0
  56. {pyield-0.49.2 → pyield-0.49.4}/pyield/selic/copom.py +0 -0
  57. {pyield-0.49.2 → pyield-0.49.4}/pyield/selic/cpm.py +0 -0
  58. {pyield-0.49.2 → pyield-0.49.4}/pyield/selic/probabilities.py +0 -0
  59. {pyield-0.49.2 → pyield-0.49.4}/pyield/tpf/__init__.py +0 -0
  60. {pyield-0.49.2 → pyield-0.49.4}/pyield/tpf/benchmark.py +0 -0
  61. {pyield-0.49.2 → pyield-0.49.4}/pyield/tpf/leiloes.py +0 -0
  62. {pyield-0.49.2 → pyield-0.49.4}/pyield/tpf/pre.py +0 -0
  63. {pyield-0.49.2 → pyield-0.49.4}/pyield/tpf/rmd.py +0 -0
  64. {pyield-0.49.2 → pyield-0.49.4}/pyield/tpf/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pyield
3
- Version: 0.49.2
3
+ Version: 0.49.4
4
4
  Summary: A Python library for analysis of fixed income instruments in Brazil
5
5
  Keywords: fixed-income,brazil,finance,analysis,bonds
6
6
  Author: Carlos Carvalho
@@ -34,6 +34,7 @@ Requires-Dist: polars>=1.39.0
34
34
  Requires-Dist: lxml>=6.0.0
35
35
  Requires-Dist: requests>=2.31.0
36
36
  Requires-Dist: fastexcel>=0.19.0
37
+ Requires-Dist: tzdata>=2024.1 ; sys_platform == 'win32'
37
38
  Requires-Python: >=3.12
38
39
  Project-URL: Homepage, https://github.com/crdcj/PYield
39
40
  Project-URL: Documentation, https://crdcj.github.io/PYield
@@ -21,14 +21,15 @@ def ttl_cache(ttl: int = _TTL_PADRAO, maxsize: int = _TAMANHO_MAXIMO):
21
21
  _cache: dict = {}
22
22
 
23
23
  @wraps(func)
24
- def wrapper(*args):
24
+ def wrapper(*args, **kwargs):
25
+ chave = (args, tuple(sorted(kwargs.items())))
25
26
  agora = time.monotonic()
26
- if args in _cache:
27
- resultado, expira_em = _cache[args]
27
+ if chave in _cache:
28
+ resultado, expira_em = _cache[chave]
28
29
  if agora < expira_em:
29
30
  return resultado
30
- resultado = func(*args)
31
- _cache[args] = (resultado, agora + ttl)
31
+ resultado = func(*args, **kwargs)
32
+ _cache[chave] = (resultado, agora + ttl)
32
33
  # Remove entrada mais antiga quando excede o tamanho máximo
33
34
  if len(_cache) > maxsize:
34
35
  _cache.pop(next(iter(_cache)))
@@ -1,8 +1,17 @@
1
1
  import datetime as dt
2
- from zoneinfo import ZoneInfo
3
-
4
- # Fuso horário do Brasil (São Paulo), usado para mercados e B3
5
- BR_TZ = ZoneInfo("America/Sao_Paulo")
2
+ from zoneinfo import ZoneInfo, ZoneInfoNotFoundError
3
+
4
+ try:
5
+ # Fuso horário do Brasil (São Paulo), usado para mercados e B3.
6
+ BR_TZ = ZoneInfo("America/Sao_Paulo")
7
+ except ZoneInfoNotFoundError as e:
8
+ msg = (
9
+ "Não foi possível carregar o fuso horário 'America/Sao_Paulo'. "
10
+ "O Python requer dados IANA de timezone para usar zoneinfo. "
11
+ "Em Windows, instale a dependência 'tzdata' ou use uma distribuição "
12
+ "Python que já forneça esses dados."
13
+ )
14
+ raise ZoneInfoNotFoundError(msg) from e
6
15
 
7
16
 
8
17
  def agora() -> dt.datetime:
@@ -17,8 +17,9 @@ dependencies = [
17
17
  "lxml>=6.0.0",
18
18
  "requests>=2.31.0",
19
19
  "fastexcel>=0.19.0",
20
+ "tzdata>=2024.1; platform_system == 'Windows'",
20
21
  ]
21
- version = "0.49.2"
22
+ version = "0.49.4"
22
23
 
23
24
  [project.urls]
24
25
  Homepage = "https://github.com/crdcj/PYield"
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