PYield 0.2.6__tar.gz → 0.2.7__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.2.6 → pyield-0.2.7}/PKG-INFO +12 -9
- {pyield-0.2.6 → pyield-0.2.7}/README.md +11 -8
- {pyield-0.2.6 → pyield-0.2.7}/pyield/__about__.py +1 -1
- {pyield-0.2.6 → pyield-0.2.7}/pyield/di_futures.py +2 -1
- {pyield-0.2.6 → pyield-0.2.7}/pyproject.toml +1 -1
- {pyield-0.2.6 → pyield-0.2.7}/LICENSE +0 -0
- {pyield-0.2.6 → pyield-0.2.7}/pyield/__init__.py +0 -0
- {pyield-0.2.6 → pyield-0.2.7}/pyield/br_calendar.py +0 -0
- {pyield-0.2.6 → pyield-0.2.7}/pyield/new_br_holidays.txt +0 -0
- {pyield-0.2.6 → pyield-0.2.7}/pyield/old_br_holidays.txt +0 -0
- {pyield-0.2.6 → pyield-0.2.7}/tests/__init__.py +0 -0
- {pyield-0.2.6 → pyield-0.2.7}/tests/test_br_calendar.py +0 -0
- {pyield-0.2.6 → pyield-0.2.7}/tests/test_di.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PYield
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.7
|
|
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>
|
|
@@ -84,25 +84,28 @@ contract_code expiration bdays ... last_offer settlement_rate
|
|
|
84
84
|
### Business Days Tools (Brazilian holidays are automatically considered)
|
|
85
85
|
```python
|
|
86
86
|
# Generate a pandas series with the business days between two dates
|
|
87
|
-
>>> pyd.generate_bdays('2023-12-29', '2024-01-03')
|
|
87
|
+
>>> pyd.generate_bdays(start='2023-12-29', end='2024-01-03')
|
|
88
88
|
0 2023-12-29
|
|
89
89
|
1 2024-01-02
|
|
90
90
|
2 2024-01-03
|
|
91
91
|
dtype: datetime64[ns]
|
|
92
92
|
|
|
93
|
-
# Get the next business day after a given date
|
|
94
|
-
>>> pyd.offset_bdays("2023-12-29", 1)
|
|
93
|
+
# Get the next business day after a given date (offset=1)
|
|
94
|
+
>>> pyd.offset_bdays(dates="2023-12-29", offset=1)
|
|
95
95
|
Timestamp('2024-01-02 00:00:00')
|
|
96
96
|
|
|
97
|
-
# Get the next business day if it is not a business day
|
|
98
|
-
>>> pyd.offset_bdays("2023-12-
|
|
99
|
-
Timestamp('2023-12-29 00:00:00')
|
|
100
|
-
>>> pyd.offset_bdays("2023-12-30", 0)
|
|
97
|
+
# Get the next business day if it is not a business day (offset=0)
|
|
98
|
+
>>> pyd.offset_bdays(dates="2023-12-30", offset=0)
|
|
101
99
|
Timestamp('2024-01-02 00:00:00')
|
|
102
100
|
|
|
101
|
+
# Since 2023-12-29 is a business day, it returns the same date (offset=0)
|
|
102
|
+
>>> pyd.offset_bdays(dates="2023-12-29", offset=0)
|
|
103
|
+
Timestamp('2023-12-29 00:00:00')
|
|
104
|
+
|
|
105
|
+
|
|
103
106
|
# Count the number of business days between two dates
|
|
104
107
|
# Start date is included, end date is excluded
|
|
105
|
-
>>> pyd.count_bdays('2023-12-29', '2024-01-02')
|
|
108
|
+
>>> pyd.count_bdays(start='2023-12-29', end='2024-01-02')
|
|
106
109
|
1
|
|
107
110
|
|
|
108
111
|
```
|
|
@@ -42,25 +42,28 @@ contract_code expiration bdays ... last_offer settlement_rate
|
|
|
42
42
|
### Business Days Tools (Brazilian holidays are automatically considered)
|
|
43
43
|
```python
|
|
44
44
|
# Generate a pandas series with the business days between two dates
|
|
45
|
-
>>> pyd.generate_bdays('2023-12-29', '2024-01-03')
|
|
45
|
+
>>> pyd.generate_bdays(start='2023-12-29', end='2024-01-03')
|
|
46
46
|
0 2023-12-29
|
|
47
47
|
1 2024-01-02
|
|
48
48
|
2 2024-01-03
|
|
49
49
|
dtype: datetime64[ns]
|
|
50
50
|
|
|
51
|
-
# Get the next business day after a given date
|
|
52
|
-
>>> pyd.offset_bdays("2023-12-29", 1)
|
|
51
|
+
# Get the next business day after a given date (offset=1)
|
|
52
|
+
>>> pyd.offset_bdays(dates="2023-12-29", offset=1)
|
|
53
53
|
Timestamp('2024-01-02 00:00:00')
|
|
54
54
|
|
|
55
|
-
# Get the next business day if it is not a business day
|
|
56
|
-
>>> pyd.offset_bdays("2023-12-
|
|
57
|
-
Timestamp('2023-12-29 00:00:00')
|
|
58
|
-
>>> pyd.offset_bdays("2023-12-30", 0)
|
|
55
|
+
# Get the next business day if it is not a business day (offset=0)
|
|
56
|
+
>>> pyd.offset_bdays(dates="2023-12-30", offset=0)
|
|
59
57
|
Timestamp('2024-01-02 00:00:00')
|
|
60
58
|
|
|
59
|
+
# Since 2023-12-29 is a business day, it returns the same date (offset=0)
|
|
60
|
+
>>> pyd.offset_bdays(dates="2023-12-29", offset=0)
|
|
61
|
+
Timestamp('2023-12-29 00:00:00')
|
|
62
|
+
|
|
63
|
+
|
|
61
64
|
# Count the number of business days between two dates
|
|
62
65
|
# Start date is included, end date is excluded
|
|
63
|
-
>>> pyd.count_bdays('2023-12-29', '2024-01-02')
|
|
66
|
+
>>> pyd.count_bdays(start='2023-12-29', end='2024-01-02')
|
|
64
67
|
1
|
|
65
68
|
|
|
66
69
|
```
|
|
@@ -300,6 +300,8 @@ def process_di_data(df: pd.DataFrame, reference_date: pd.Timestamp) -> pd.DataFr
|
|
|
300
300
|
"number_of_trades",
|
|
301
301
|
"trading_volume",
|
|
302
302
|
"financial_volume",
|
|
303
|
+
"settlement_price",
|
|
304
|
+
"settlement_rate",
|
|
303
305
|
"opening_rate",
|
|
304
306
|
"min_rate",
|
|
305
307
|
"max_rate",
|
|
@@ -307,7 +309,6 @@ def process_di_data(df: pd.DataFrame, reference_date: pd.Timestamp) -> pd.DataFr
|
|
|
307
309
|
"closing_rate",
|
|
308
310
|
"last_bid",
|
|
309
311
|
"last_offer",
|
|
310
|
-
"settlement_rate",
|
|
311
312
|
]
|
|
312
313
|
]
|
|
313
314
|
return df
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|