summaryrefslogtreecommitdiff
path: root/venv/lib/python3.11/site-packages/faker/providers/company/pl_PL
diff options
context:
space:
mode:
authorcyfraeviolae <cyfraeviolae>2024-04-03 03:17:55 -0400
committercyfraeviolae <cyfraeviolae>2024-04-03 03:17:55 -0400
commit12cf076118570eebbff08c6b3090e0d4798447a1 (patch)
tree3ba25e17e3c3a5e82316558ba3864b955919ff72 /venv/lib/python3.11/site-packages/faker/providers/company/pl_PL
parentc45662ff3923b34614ddcc8feb9195541166dcc5 (diff)
no venv
Diffstat (limited to 'venv/lib/python3.11/site-packages/faker/providers/company/pl_PL')
-rw-r--r--venv/lib/python3.11/site-packages/faker/providers/company/pl_PL/__init__.py149
-rw-r--r--venv/lib/python3.11/site-packages/faker/providers/company/pl_PL/__pycache__/__init__.cpython-311.pycbin6671 -> 0 bytes
2 files changed, 0 insertions, 149 deletions
diff --git a/venv/lib/python3.11/site-packages/faker/providers/company/pl_PL/__init__.py b/venv/lib/python3.11/site-packages/faker/providers/company/pl_PL/__init__.py
deleted file mode 100644
index df15282..0000000
--- a/venv/lib/python3.11/site-packages/faker/providers/company/pl_PL/__init__.py
+++ /dev/null
@@ -1,149 +0,0 @@
-from typing import List
-
-from .. import Provider as CompanyProvider
-
-
-def regon_checksum(digits: List[int]) -> int:
- """
- Calculates and returns a control digit for given list of digits basing on REGON standard.
- """
- weights_for_check_digit = [8, 9, 2, 3, 4, 5, 6, 7]
- check_digit = 0
-
- for i in range(0, 8):
- check_digit += weights_for_check_digit[i] * digits[i]
-
- check_digit %= 11
-
- if check_digit == 10:
- check_digit = 0
-
- return check_digit
-
-
-def local_regon_checksum(digits: List[int]) -> int:
- """
- Calculates and returns a control digit for given list of digits basing on local REGON standard.
- """
- weights_for_check_digit = [2, 4, 8, 5, 0, 9, 7, 3, 6, 1, 2, 4, 8]
- check_digit = 0
-
- for i in range(0, 13):
- check_digit += weights_for_check_digit[i] * digits[i]
-
- check_digit %= 11
-
- if check_digit == 10:
- check_digit = 0
-
- return check_digit
-
-
-def company_vat_checksum(digits: List[int]) -> int:
- """
- Calculates and returns a control digit for given list of digits basing on NIP standard.
- """
- weights_for_check_digit = [6, 5, 7, 2, 3, 4, 5, 6, 7]
- check_digit = 0
-
- for i in range(0, 9):
- check_digit += weights_for_check_digit[i] * digits[i]
-
- check_digit %= 11
-
- return check_digit
-
-
-class Provider(CompanyProvider):
- formats = (
- "{{last_name}} {{company_suffix}}",
- "{{last_name}}-{{last_name}} {{company_suffix}}",
- "{{company_prefix}} {{last_name}}",
- "{{company_prefix}} {{last_name}} {{company_suffix}}",
- "{{company_prefix}} {{last_name}}-{{last_name}} {{company_suffix}}",
- )
-
- company_prefixes = (
- "Grupa",
- "Spółdzielnia",
- "Stowarzyszenie",
- "Fundacja",
- "PPUH",
- "FPUH",
- "Gabinety",
- )
-
- company_suffixes = (
- "Sp. z o.o.",
- "S.A.",
- "Sp. z o.o. Sp.k.",
- "Sp.j.",
- "s.c.",
- "Sp.k.",
- "i syn s.c.",
- )
-
- def company_prefix(self) -> str:
- """
- :example 'Grupa'
- """
- return self.random_element(self.company_prefixes)
-
- def regon(self) -> str:
- """
- Returns 9 character Polish National Business Registry Number,
- Polish: Rejestr Gospodarki Narodowej - REGON.
-
- https://pl.wikipedia.org/wiki/REGON
- """
- voivodeship_number = self.random_int(0, 49) * 2 + 1
- regon_digits = [int(voivodeship_number / 10), voivodeship_number % 10]
-
- for _ in range(6):
- regon_digits.append(self.random_digit())
-
- regon_digits.append(regon_checksum(regon_digits))
-
- return "".join(str(digit) for digit in regon_digits)
-
- def local_regon(self) -> str:
- """
- Returns 14 character Polish National Business Registry Number,
- local entity number.
-
- https://pl.wikipedia.org/wiki/REGON
- """
- regon_digits = [int(digit) for digit in list(self.regon())]
-
- for _ in range(4):
- regon_digits.append(self.random_digit())
-
- regon_digits.append(local_regon_checksum(regon_digits))
-
- return "".join(str(digit) for digit in regon_digits)
-
- def company_vat(self) -> str:
- """
- Returns 10 character tax identification number,
- Polish: Numer identyfikacji podatkowej.
-
- https://pl.wikipedia.org/wiki/NIP
- """
- vat_digits = []
-
- for _ in range(3):
- vat_digits.append(self.random_digit_not_null())
-
- for _ in range(6):
- vat_digits.append(self.random_digit())
-
- check_digit = company_vat_checksum(vat_digits)
-
- # in this case we must generate a tax number again, because check_digit
- # cannot be 10
- if check_digit == 10:
- return self.company_vat()
-
- vat_digits.append(check_digit)
-
- return "".join(str(digit) for digit in vat_digits)
diff --git a/venv/lib/python3.11/site-packages/faker/providers/company/pl_PL/__pycache__/__init__.cpython-311.pyc b/venv/lib/python3.11/site-packages/faker/providers/company/pl_PL/__pycache__/__init__.cpython-311.pyc
deleted file mode 100644
index d08d8d4..0000000
--- a/venv/lib/python3.11/site-packages/faker/providers/company/pl_PL/__pycache__/__init__.cpython-311.pyc
+++ /dev/null
Binary files differ