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.
- {pyield-0.49.2 → pyield-0.49.4}/PKG-INFO +2 -1
- {pyield-0.49.2 → pyield-0.49.4}/pyield/_internal/cache.py +6 -5
- {pyield-0.49.2 → pyield-0.49.4}/pyield/relogio.py +13 -4
- {pyield-0.49.2 → pyield-0.49.4}/pyproject.toml +2 -1
- {pyield-0.49.2 → pyield-0.49.4}/LICENSE +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/README.md +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/__init__.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/_internal/__init__.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/_internal/br_numbers.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/_internal/converters.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/_internal/data_cache.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/_internal/retry.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/_internal/types.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/anbima/__init__.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/anbima/imaq.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/anbima/mercado_secundario.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/b3/__init__.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/b3/_contratos.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/b3/_validar_pregao.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/b3/boletim.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/b3/derivativos_intradia.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/b3/di_over.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/bc/__init__.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/bc/_olinda.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/bc/leiloes.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/bc/sgs.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/bc/tpf_intradia.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/bc/tpf_mensal.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/bc/vna.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/di1.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/du/__init__.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/du/core.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/du/feriados/__init__.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/du/feriados/feriados_antigos_br.txt +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/du/feriados/feriados_br.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/du/feriados/feriados_novos_br.txt +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/futuro/__init__.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/futuro/contratos.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/futuro/historico.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/futuro/intradia.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/fwd.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/interpolador.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/ipca/__init__.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/ipca/historico.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/ipca/projetado.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/lft.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/ltn.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/ntnb.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/ntnb1.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/ntnbprinc.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/ntnc.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/ntnf.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/py.typed +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/selic/__init__.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/selic/compromissada.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/selic/copom.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/selic/cpm.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/selic/probabilities.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/tpf/__init__.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/tpf/benchmark.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/tpf/leiloes.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/tpf/pre.py +0 -0
- {pyield-0.49.2 → pyield-0.49.4}/pyield/tpf/rmd.py +0 -0
- {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.
|
|
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
|
|
27
|
-
resultado, expira_em = _cache[
|
|
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[
|
|
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
|
-
|
|
5
|
-
|
|
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:
|
|
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
|