cardo-python-utils 0.2.2__tar.gz → 0.2.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.
- {cardo-python-utils-0.2.2/cardo_python_utils.egg-info → cardo-python-utils-0.2.4}/PKG-INFO +1 -1
- {cardo-python-utils-0.2.2 → cardo-python-utils-0.2.4/cardo_python_utils.egg-info}/PKG-INFO +1 -1
- {cardo-python-utils-0.2.2 → cardo-python-utils-0.2.4}/python_utils/choices.py +17 -0
- {cardo-python-utils-0.2.2 → cardo-python-utils-0.2.4}/python_utils/esma_choices.py +62 -9
- {cardo-python-utils-0.2.2 → cardo-python-utils-0.2.4}/setup.cfg +1 -1
- {cardo-python-utils-0.2.2 → cardo-python-utils-0.2.4}/LICENSE +0 -0
- {cardo-python-utils-0.2.2 → cardo-python-utils-0.2.4}/MANIFEST.in +0 -0
- {cardo-python-utils-0.2.2 → cardo-python-utils-0.2.4}/README.rst +0 -0
- {cardo-python-utils-0.2.2 → cardo-python-utils-0.2.4}/cardo_python_utils.egg-info/SOURCES.txt +0 -0
- {cardo-python-utils-0.2.2 → cardo-python-utils-0.2.4}/cardo_python_utils.egg-info/dependency_links.txt +0 -0
- {cardo-python-utils-0.2.2 → cardo-python-utils-0.2.4}/cardo_python_utils.egg-info/requires.txt +0 -0
- {cardo-python-utils-0.2.2 → cardo-python-utils-0.2.4}/cardo_python_utils.egg-info/top_level.txt +0 -0
- {cardo-python-utils-0.2.2 → cardo-python-utils-0.2.4}/python_utils/__init__.py +0 -0
- {cardo-python-utils-0.2.2 → cardo-python-utils-0.2.4}/python_utils/data_structures.py +0 -0
- {cardo-python-utils-0.2.2 → cardo-python-utils-0.2.4}/python_utils/db.py +0 -0
- {cardo-python-utils-0.2.2 → cardo-python-utils-0.2.4}/python_utils/django_utils.py +0 -0
- {cardo-python-utils-0.2.2 → cardo-python-utils-0.2.4}/python_utils/exceptions.py +0 -0
- {cardo-python-utils-0.2.2 → cardo-python-utils-0.2.4}/python_utils/imports.py +0 -0
- {cardo-python-utils-0.2.2 → cardo-python-utils-0.2.4}/python_utils/math.py +0 -0
- {cardo-python-utils-0.2.2 → cardo-python-utils-0.2.4}/python_utils/pandas_utils.py +0 -0
- {cardo-python-utils-0.2.2 → cardo-python-utils-0.2.4}/python_utils/rest.py +0 -0
- {cardo-python-utils-0.2.2 → cardo-python-utils-0.2.4}/python_utils/text.py +0 -0
- {cardo-python-utils-0.2.2 → cardo-python-utils-0.2.4}/python_utils/time.py +0 -0
- {cardo-python-utils-0.2.2 → cardo-python-utils-0.2.4}/python_utils/types_hinting.py +0 -0
- {cardo-python-utils-0.2.2 → cardo-python-utils-0.2.4}/setup.py +0 -0
|
@@ -24,6 +24,23 @@ class IChoice(ABC):
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
class ChoiceEnumMeta(EnumMeta, IChoice, ABC):
|
|
27
|
+
def __new__(mcls, *args, **kwargs):
|
|
28
|
+
new_cls = super().__new__(mcls, *args, **kwargs)
|
|
29
|
+
|
|
30
|
+
# Make sure that the int values are unique
|
|
31
|
+
unique_values = set()
|
|
32
|
+
duplicate_values = set()
|
|
33
|
+
for el in new_cls.list_as(int):
|
|
34
|
+
if el in unique_values:
|
|
35
|
+
duplicate_values.add(str(el))
|
|
36
|
+
else:
|
|
37
|
+
unique_values.add(el)
|
|
38
|
+
|
|
39
|
+
if duplicate_values:
|
|
40
|
+
raise ValueError(f"Duplicate int values in {new_cls.__name__}: {', '.join(duplicate_values)}")
|
|
41
|
+
|
|
42
|
+
return new_cls
|
|
43
|
+
|
|
27
44
|
def __contains__(cls, item: int | str) -> bool:
|
|
28
45
|
if isinstance(item, int):
|
|
29
46
|
member_values = [v.value[0] for v in cls.__members__.values()]
|
|
@@ -2,10 +2,18 @@
|
|
|
2
2
|
This module contains choices used also in ESMA reports.
|
|
3
3
|
|
|
4
4
|
Choices structure:
|
|
5
|
-
Example:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"
|
|
5
|
+
Example: OVRD = 1, "Overdraft or Working Capital"
|
|
6
|
+
OVRD -> ESMA code for the choice, to be used in reports
|
|
7
|
+
1 -> value stored in database
|
|
8
|
+
"Overdraft or Working Capital" -> human-readable name, used for display purposes
|
|
9
|
+
|
|
10
|
+
Exceptions:
|
|
11
|
+
There might be cases in which multiple choices are mapped to the same ESMA code.
|
|
12
|
+
In this case, some characters are added at the end of the ESMA code to differentiate it.
|
|
13
|
+
Example:
|
|
14
|
+
GUAR_G1 = 40, "Guarantee"
|
|
15
|
+
GUAR_G2 = 41, "Government Guarantee"
|
|
16
|
+
In such cases, only the part before the underscore (GUAR) (or the first 4 letters) is used in reports.
|
|
9
17
|
"""
|
|
10
18
|
|
|
11
19
|
|
|
@@ -112,9 +120,28 @@ class RecoverySourceChoices(ChoiceEnum):
|
|
|
112
120
|
OTHR = 10, "Other"
|
|
113
121
|
|
|
114
122
|
|
|
123
|
+
class RealEstateAssetClassChoices(ChoiceEnum):
|
|
124
|
+
OTRE_R1 = 30, "Other Real Estate"
|
|
125
|
+
OTRE_R2 = 31, "Hospitality"
|
|
126
|
+
OTHR_R1 = 32, "Plot of land"
|
|
127
|
+
OTHR_R2 = 33, "Agricultural"
|
|
128
|
+
OTHR_R3 = 34, "Ancillary units"
|
|
129
|
+
CBLD_R1 = 35, "Retail"
|
|
130
|
+
CBLD_R2 = 36, "Office"
|
|
131
|
+
IBLD = 37, "Industrial"
|
|
132
|
+
RBLD = 38, "Residential"
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
115
136
|
class GuaranteeAssetClassChoices(ChoiceEnum):
|
|
116
|
-
|
|
117
|
-
|
|
137
|
+
GUAR_G1 = 40, "Personal Guarantee"
|
|
138
|
+
GUAR_G2 = 41, "Government Guarantee"
|
|
139
|
+
GUAR_G3 = 42, "Bank Guarantee"
|
|
140
|
+
GUAR_G4 = 43, "Corporate Guarantee"
|
|
141
|
+
OTHR_G1 = 44, "Pledge on titles"
|
|
142
|
+
OTHR_G2 = 45, "Pledge on goods or inventory"
|
|
143
|
+
OTHR_G3 = 46, "Pledge on others"
|
|
144
|
+
OTHR_G4 = 47, "Patronage letter"
|
|
118
145
|
|
|
119
146
|
|
|
120
147
|
class ESMAAccountStatusChoices(ChoiceEnum):
|
|
@@ -149,11 +176,11 @@ class ESMACustomerTypeChoices(ChoiceEnum):
|
|
|
149
176
|
|
|
150
177
|
class ESMAAmortisationTypeChoices(ChoiceEnum):
|
|
151
178
|
FRXX = 1, "French - i.e. Amortisation in which the total amount — principal plus interest — repaid in each " \
|
|
152
|
-
|
|
179
|
+
"instalment is the same."
|
|
153
180
|
DEXX = 2, "German - i.e. Amortisation in which the first instalment is interest-only and the remaining " \
|
|
154
|
-
|
|
181
|
+
"instalments are constant, including capital amortisation and interest."
|
|
155
182
|
FIXE = 3, "Fixed amortisation schedule - i.e. Amortisation in which the principal amount repaid in each " \
|
|
156
|
-
|
|
183
|
+
"instalment is the same."
|
|
157
184
|
BLLT = 4, "Bullet - i.e. Amortisation in which the full principal amount is repaid in the last instalment."
|
|
158
185
|
OTHR = 10, "Other"
|
|
159
186
|
|
|
@@ -401,3 +428,29 @@ class PaymentFrequencyChoices(ChoiceEnum):
|
|
|
401
428
|
SEMI = 5, "Semi Annual"
|
|
402
429
|
YEAR = 6, "Annual"
|
|
403
430
|
OTHR = 10, "Other"
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
class SPVExtensionClauseChoices(ChoiceEnum):
|
|
434
|
+
ISUR = 1, "SSPE only"
|
|
435
|
+
NHLD = 2, "Noteholder"
|
|
436
|
+
ISNH = 3, "Either SSPE or noteholder"
|
|
437
|
+
NOPT = 4, "No option"
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
class SPVLiabilitySettlementConventionChoice(ChoiceEnum):
|
|
441
|
+
TONE = 1, "T Plus One"
|
|
442
|
+
TTWO = 2, "T Plus Two"
|
|
443
|
+
TTRE = 3, "T Plus Three"
|
|
444
|
+
ASAP = 4, "As soon as possible"
|
|
445
|
+
ENDC = 5, "At the end of Contract"
|
|
446
|
+
MONT = 6, "End of Month"
|
|
447
|
+
FUTU = 7, "Future"
|
|
448
|
+
NXTD = 8, "Next Day"
|
|
449
|
+
REGU = 9, "Regular"
|
|
450
|
+
TFIV = 10, "T Plus Five"
|
|
451
|
+
TFOR = 11, "T Plus Four"
|
|
452
|
+
WHIF = 12, "When and if issued"
|
|
453
|
+
WDIS = 13, "When Distributed"
|
|
454
|
+
WISS = 14, "When Issued"
|
|
455
|
+
WHID = 15, "When Issued or Distributed"
|
|
456
|
+
OTHR = 16, "Other"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cardo-python-utils-0.2.2 → cardo-python-utils-0.2.4}/cardo_python_utils.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{cardo-python-utils-0.2.2 → cardo-python-utils-0.2.4}/cardo_python_utils.egg-info/requires.txt
RENAMED
|
File without changes
|
{cardo-python-utils-0.2.2 → cardo-python-utils-0.2.4}/cardo_python_utils.egg-info/top_level.txt
RENAMED
|
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
|