Constants Module
anonipy.constants
Module containing the constants.
The constants module provides a set of predefined constants used in the package. These include supported languages, types of entities, and date transformation variants.
Classes:
| Name | Description |
|---|---|
LANGUAGES | Predefined supported languages. |
ENTITY_TYPES | Predefined types of entities. |
DATE_TRANSFORM_VARIANTS | Predefined types of the date transformation variants. |
LANGUAGES
The main anonipy supported languages.
Attributes:
| Name | Type | Description |
|---|---|---|
DUTCH | Tuple[Literal[nl], Literal[Dutch]] | The Dutch language. |
ENGLISH | Tuple[Literal[en], Literal[English]] | The English language. |
FRENCH | Tuple[Literal[fr], Literal[French]] | The French language. |
GERMAN | Tuple[Literal[de], Literal[German]] | The German language. |
GREEK | Tuple[Literal[el], Literal[Greek]] | The Greek language. |
ITALIAN | Tuple[Literal[it], Literal[Italian]] | The Italian language. |
SLOVENIAN | Tuple[Literal[sl], Literal[Slovenian]] | The Slovenian language. |
SPANISH | Tuple[Literal[es], Literal[Spanish]] | The Spanish language. |
UKRAINIAN | Tuple[Literal[uk], Literal[Ukrainian]] | The Ukrainian language. |
Methods:
| Name | Description |
|---|---|
supported_languages | Return a list of supported languages. |
Source code in anonipy/constants.py
supported_languages() classmethod
Return a list of supported languages.
Returns:
| Type | Description |
|---|---|
List[str] | The list of supported languages. |
Source code in anonipy/constants.py
ENTITY_TYPES
The anonipy supported entity types.
Attributes:
| Name | Type | Description |
|---|---|---|
CUSTOM | Literal[custom] | The custom entity type. |
STRING | Literal[string] | The string entity type. |
INTEGER | Literal[integer] | The integer entity type. |
FLOAT | Literal[float] | The float entity type. |
DATE | Literal[date] | The date entity type. |
EMAIL | Literal[email] | The email entity type. |
WEBSITE_URL | Literal[website_url] | The website url entity type. |
PHONE_NUMBER | Literal[phone_number] | The phone number entity type. |
Source code in anonipy/constants.py
DATE_TRANSFORM_VARIANTS
The supported date transform variants.
Attributes:
| Name | Type | Description |
|---|---|---|
FIRST_DAY_OF_THE_MONTH | Literal[FIRST_DAY_OF_THE_MONTH] | The first day of the month. |
LAST_DAY_OF_THE_MONTH | Literal[LAST_DAY_OF_THE_MONTH] | The last day of the month. |
MIDDLE_OF_THE_MONTH | Literal[MIDDLE_OF_THE_MONTH] | The middle of the month. |
MIDDLE_OF_THE_YEAR | Literal[MIDDLE_OF_THE_YEAR] | The middle of the year. |
RANDOM | Literal[RANDOM] | A random date. |
Methods:
| Name | Description |
|---|---|
values | Return a list of all possible date transform variants. |
is_valid | Check if the value is a valid date variant. |
Source code in anonipy/constants.py
values() classmethod
Return a list of all possible date transform variants.
Returns:
| Type | Description |
|---|---|
List[str] | The list of all possible variants. |
Source code in anonipy/constants.py
is_valid(value) classmethod
Check if the value is a valid date variant.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value | str | The value to check. | required |
Returns:
| Type | Description |
|---|---|
bool |
|