diff options
author | cyfraeviolae <cyfraeviolae> | 2024-04-03 03:17:55 -0400 |
---|---|---|
committer | cyfraeviolae <cyfraeviolae> | 2024-04-03 03:17:55 -0400 |
commit | 12cf076118570eebbff08c6b3090e0d4798447a1 (patch) | |
tree | 3ba25e17e3c3a5e82316558ba3864b955919ff72 /venv/lib/python3.11/site-packages/faker/providers/ssn/es_CO | |
parent | c45662ff3923b34614ddcc8feb9195541166dcc5 (diff) |
no venv
Diffstat (limited to 'venv/lib/python3.11/site-packages/faker/providers/ssn/es_CO')
2 files changed, 0 insertions, 72 deletions
diff --git a/venv/lib/python3.11/site-packages/faker/providers/ssn/es_CO/__init__.py b/venv/lib/python3.11/site-packages/faker/providers/ssn/es_CO/__init__.py deleted file mode 100644 index c33e628..0000000 --- a/venv/lib/python3.11/site-packages/faker/providers/ssn/es_CO/__init__.py +++ /dev/null @@ -1,72 +0,0 @@ -import operator - -from collections import OrderedDict - -from .. import Provider as BaseProvider - - -def nit_check_digit(nit: str) -> str: - """ - Calculate the check digit of a NIT. - - The check digit is calculated by multiplying the reversed digits of a NIT - by (3, 7, 13, 17, 19, 23, 29, 37, 41, 43, 47, 53, 59, 67, 71), respectively, - adding the results and applying MOD 11. If the result is greater than or equal - to 2, the check digit is 11 minus the result. Otherwise, the check digit is the - result. - """ - reversed_nit = nit[::-1] - digits = (int(digit) for digit in reversed_nit) - multipliers = (3, 7, 13, 17, 19, 23, 29, 37, 41, 43, 47, 53, 59, 67, 71) - value = sum(map(operator.mul, digits, multipliers)) % 11 - if value >= 2: - value = 11 - value - return str(value) - - -class Provider(BaseProvider): - nuip_formats = OrderedDict( - [ - ("10########", 0.25), - ("11########", 0.25), - ("12########", 0.1), - ("%!######", 0.4), - ] - ) - - legal_person_nit_formats = [ - "8########", - "9########", - ] - - def nuip(self) -> str: - """ - https://es.wikipedia.org/wiki/C%C3%A9dula_de_Ciudadan%C3%ADa_(Colombia) - :example: '1095312769' - """ - return self.numerify(self.random_element(self.nuip_formats)) - - natural_person_nit = nuip - - def natural_person_nit_with_check_digit(self) -> str: - """ - :example: '1095312769-0' - """ - nit = self.natural_person_nit() - check_digit = nit_check_digit(nit) - return f"{nit}-{check_digit}" - - def legal_person_nit(self) -> str: - """ - https://es.wikipedia.org/wiki/N%C3%BAmero_de_Identificaci%C3%B3n_Tributaria - :example: '967807269' - """ - return self.numerify(self.random_element(self.legal_person_nit_formats)) - - def legal_person_nit_with_check_digit(self) -> str: - """ - :example: '967807269-7' - """ - nit = self.legal_person_nit() - check_digit = nit_check_digit(nit) - return f"{nit}-{check_digit}" diff --git a/venv/lib/python3.11/site-packages/faker/providers/ssn/es_CO/__pycache__/__init__.cpython-311.pyc b/venv/lib/python3.11/site-packages/faker/providers/ssn/es_CO/__pycache__/__init__.cpython-311.pyc Binary files differdeleted file mode 100644 index 47dcce9..0000000 --- a/venv/lib/python3.11/site-packages/faker/providers/ssn/es_CO/__pycache__/__init__.cpython-311.pyc +++ /dev/null |