PYield 0.4.0__tar.gz → 0.4.1__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.4.0 → pyield-0.4.1}/PKG-INFO +1 -1
- pyield-0.4.1/pyield/__about__.py +1 -0
- {pyield-0.4.0 → pyield-0.4.1}/pyield/anbima.py +4 -6
- {pyield-0.4.0 → pyield-0.4.1}/pyproject.toml +1 -1
- pyield-0.4.0/pyield/__about__.py +0 -1
- {pyield-0.4.0 → pyield-0.4.1}/LICENSE +0 -0
- {pyield-0.4.0 → pyield-0.4.1}/README.md +0 -0
- {pyield-0.4.0 → pyield-0.4.1}/pyield/__init__.py +0 -0
- {pyield-0.4.0 → pyield-0.4.1}/pyield/br_calendar.py +0 -0
- {pyield-0.4.0 → pyield-0.4.1}/pyield/br_holidays.py +0 -0
- {pyield-0.4.0 → pyield-0.4.1}/pyield/br_holidays_new.txt +0 -0
- {pyield-0.4.0 → pyield-0.4.1}/pyield/br_holidays_old.txt +0 -0
- {pyield-0.4.0 → pyield-0.4.1}/pyield/di_futures.py +0 -0
- {pyield-0.4.0 → pyield-0.4.1}/pyield/di_web.py +0 -0
- {pyield-0.4.0 → pyield-0.4.1}/pyield/di_xml.py +0 -0
- {pyield-0.4.0 → pyield-0.4.1}/pyield/py.typed +0 -0
- {pyield-0.4.0 → pyield-0.4.1}/tests/__init__.py +0 -0
- {pyield-0.4.0 → pyield-0.4.1}/tests/test_br_calendar.py +0 -0
- {pyield-0.4.0 → pyield-0.4.1}/tests/test_di.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.4.1"
|
|
@@ -36,7 +36,7 @@ def normalize_date(reference_date: str | Timestamp | None = None) -> Timestamp:
|
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
def get_raw_data(
|
|
39
|
-
reference_date:
|
|
39
|
+
reference_date: Timestamp, is_anbima_member: bool = False
|
|
40
40
|
) -> DataFrame:
|
|
41
41
|
"""
|
|
42
42
|
Fetch indicative rates from ANBIMA for a specific date.
|
|
@@ -48,11 +48,8 @@ def get_raw_data(
|
|
|
48
48
|
Returns:
|
|
49
49
|
- pd.DataFrame: DataFrame with the indicative rates for the given date.
|
|
50
50
|
"""
|
|
51
|
-
# Process the reference date, defaulting to the previous business day if not provided
|
|
52
|
-
normalized_date = normalize_date(reference_date)
|
|
53
|
-
|
|
54
51
|
# Format the date to match the URL format
|
|
55
|
-
url_date =
|
|
52
|
+
url_date = reference_date.strftime("%y%m%d")
|
|
56
53
|
|
|
57
54
|
# Set the base URL according to the member status
|
|
58
55
|
base_url = ANBIMA_MEMBER_URL if is_anbima_member else ANBIMA_NON_MEMBER_URL
|
|
@@ -67,10 +64,11 @@ def get_raw_data(
|
|
|
67
64
|
skiprows=2,
|
|
68
65
|
decimal=",",
|
|
69
66
|
thousands=".",
|
|
67
|
+
na_values=["--"],
|
|
70
68
|
dtype_backend="numpy_nullable",
|
|
71
69
|
)
|
|
72
70
|
except HTTPError:
|
|
73
|
-
error_date =
|
|
71
|
+
error_date = reference_date.strftime("%d-%m-%Y")
|
|
74
72
|
raise ValueError(f"Failed to get ANBIMA rates for {error_date}")
|
|
75
73
|
|
|
76
74
|
return df
|
pyield-0.4.0/pyield/__about__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.4.0"
|
|
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
|