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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PYield
3
- Version: 0.4.0
3
+ Version: 0.4.1
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-Email: Carlos Carvalho <cr.cj@outlook.com>
@@ -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: str | Timestamp | None = None, is_anbima_member: bool = False
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 = normalized_date.strftime("%y%m%d")
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 = normalized_date.strftime("%d-%m-%Y")
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
@@ -31,7 +31,7 @@ dependencies = [
31
31
  "lxml",
32
32
  ]
33
33
  dynamic = []
34
- version = "0.4.0"
34
+ version = "0.4.1"
35
35
 
36
36
  [project.license]
37
37
  file = "LICENSE"
@@ -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