datamarket 0.9.26__tar.gz → 0.9.27__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.
Potentially problematic release.
This version of datamarket might be problematic. Click here for more details.
- {datamarket-0.9.26 → datamarket-0.9.27}/PKG-INFO +1 -1
- {datamarket-0.9.26 → datamarket-0.9.27}/pyproject.toml +1 -1
- {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/utils/strings.py +34 -12
- {datamarket-0.9.26 → datamarket-0.9.27}/LICENSE +0 -0
- {datamarket-0.9.26 → datamarket-0.9.27}/README.md +0 -0
- {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/__init__.py +0 -0
- {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/interfaces/__init__.py +0 -0
- {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/interfaces/alchemy.py +0 -0
- {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/interfaces/aws.py +0 -0
- {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/interfaces/drive.py +0 -0
- {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/interfaces/ftp.py +0 -0
- {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/interfaces/nominatim.py +0 -0
- {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/interfaces/peerdb.py +0 -0
- {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/interfaces/proxy.py +0 -0
- {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/interfaces/tinybird.py +0 -0
- {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/params/__init__.py +0 -0
- {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/params/nominatim.py +0 -0
- {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/utils/__init__.py +0 -0
- {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/utils/airflow.py +0 -0
- {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/utils/alchemy.py +0 -0
- {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/utils/main.py +0 -0
- {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/utils/selenium.py +0 -0
- {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/utils/soda.py +0 -0
- {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/utils/typer.py +0 -0
- {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/utils/types.py +0 -0
|
@@ -37,8 +37,14 @@ class NamingConvention(Enum):
|
|
|
37
37
|
|
|
38
38
|
def transliterate_symbols(s: str) -> str:
|
|
39
39
|
"""
|
|
40
|
-
Translates symbols (category S*) to lowercase Unicode names,
|
|
41
|
-
with spaces
|
|
40
|
+
Translates Unicode symbols (category S*) in the input string to their lowercase Unicode names,
|
|
41
|
+
with spaces replaced by underscores. Other characters remain unchanged.
|
|
42
|
+
|
|
43
|
+
Args:
|
|
44
|
+
s: The input string.
|
|
45
|
+
|
|
46
|
+
Returns:
|
|
47
|
+
The string with symbols transliterated.
|
|
42
48
|
"""
|
|
43
49
|
out: list[str] = []
|
|
44
50
|
for c in s:
|
|
@@ -55,16 +61,32 @@ def normalize(
|
|
|
55
61
|
s: Any, mode: NormalizationMode = NormalizationMode.BASIC, naming: NamingConvention = NamingConvention.NONE
|
|
56
62
|
) -> str:
|
|
57
63
|
"""
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
Normalizes and applies a naming convention to the input.
|
|
65
|
+
|
|
66
|
+
Handles None and NaN values by returning an empty string. Converts non-string inputs to strings.
|
|
67
|
+
|
|
68
|
+
Normalization is applied according to `mode`:
|
|
69
|
+
- NONE: Returns the input as a string without any normalization.
|
|
70
|
+
- BASIC: Removes accents, converts punctuation and spaces to single spaces, and preserves alphanumeric characters.
|
|
71
|
+
- SYMBOLS: Translates only Unicode symbols (category S*) to their lowercase Unicode names with underscores.
|
|
72
|
+
- FULL: Applies both BASIC and SYMBOLS normalization.
|
|
73
|
+
|
|
74
|
+
After normalization, a naming convention is applied according to `naming`:
|
|
75
|
+
- NONE: Returns the normalized text.
|
|
76
|
+
- CONSTANT: Converts to CONSTANT_CASE (uppercase with underscores).
|
|
77
|
+
- SNAKE: Converts to snake_case (lowercase with underscores).
|
|
78
|
+
- CAMEL: Converts to camelCase (lowercase first word, capitalize subsequent words, no spaces).
|
|
79
|
+
- PASCAL: Converts to PascalCase (capitalize all words, no spaces).
|
|
80
|
+
- PARAM: Converts to parameterize (lowercase with hyphens).
|
|
81
|
+
- TITLE: Converts to Title Case (capitalize each word).
|
|
82
|
+
|
|
83
|
+
Args:
|
|
84
|
+
s: The input value to normalize and format. Can be any type.
|
|
85
|
+
mode: The normalization mode to apply. Defaults to NormalizationMode.BASIC.
|
|
86
|
+
naming: The naming convention to apply. Defaults to NamingConvention.NONE.
|
|
87
|
+
|
|
88
|
+
Returns:
|
|
89
|
+
The normalized and formatted string.
|
|
68
90
|
"""
|
|
69
91
|
# Parameter mapping
|
|
70
92
|
if isinstance(mode, str):
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|