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.

Files changed (25) hide show
  1. {datamarket-0.9.26 → datamarket-0.9.27}/PKG-INFO +1 -1
  2. {datamarket-0.9.26 → datamarket-0.9.27}/pyproject.toml +1 -1
  3. {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/utils/strings.py +34 -12
  4. {datamarket-0.9.26 → datamarket-0.9.27}/LICENSE +0 -0
  5. {datamarket-0.9.26 → datamarket-0.9.27}/README.md +0 -0
  6. {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/__init__.py +0 -0
  7. {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/interfaces/__init__.py +0 -0
  8. {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/interfaces/alchemy.py +0 -0
  9. {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/interfaces/aws.py +0 -0
  10. {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/interfaces/drive.py +0 -0
  11. {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/interfaces/ftp.py +0 -0
  12. {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/interfaces/nominatim.py +0 -0
  13. {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/interfaces/peerdb.py +0 -0
  14. {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/interfaces/proxy.py +0 -0
  15. {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/interfaces/tinybird.py +0 -0
  16. {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/params/__init__.py +0 -0
  17. {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/params/nominatim.py +0 -0
  18. {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/utils/__init__.py +0 -0
  19. {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/utils/airflow.py +0 -0
  20. {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/utils/alchemy.py +0 -0
  21. {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/utils/main.py +0 -0
  22. {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/utils/selenium.py +0 -0
  23. {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/utils/soda.py +0 -0
  24. {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/utils/typer.py +0 -0
  25. {datamarket-0.9.26 → datamarket-0.9.27}/src/datamarket/utils/types.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: datamarket
3
- Version: 0.9.26
3
+ Version: 0.9.27
4
4
  Summary: Utilities that integrate advanced scraping knowledge into just one library.
5
5
  License: GPL-3.0-or-later
6
6
  Author: DataMarket
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "datamarket"
3
- version = "0.9.26"
3
+ version = "0.9.27"
4
4
  description = "Utilities that integrate advanced scraping knowledge into just one library."
5
5
  authors = ["DataMarket <techsupport@datamarket.es>"]
6
6
  license = "GPL-3.0-or-later"
@@ -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→underscores. The rest of the text remains the same.
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
- 1. Normalizes the string according to `mode`:
59
- - NONE: returns the original input as an unprocessed string.
60
- - BASIC: removes accents, converts punctuation to spaces, preserves alphanumeric characters.
61
- - SYMBOLS: translates only symbols to Unicode name.
62
- - FULL: combines BASIC + SYMBOLS.
63
- 2. Applies naming convention according to `naming`:
64
- - NONE: returns the normalized text.
65
- - PARAM: parameterize (hyphens).
66
- - SNAKE: snake_case (underscore, lowercase).
67
- - CONSTANT: CONSTANT_CASE (underscore, uppercase).
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