geohierarchy.naming¶
Text and filename normalization (one implementation for every package of the project).
normalize_text(text)
¶
Lowercase a string and strip diacritics/accents.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Input text. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The lowercased, accent-stripped text. |
sanitize_filename(name)
¶
Replace characters unsafe for filenames with underscores.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Raw string to sanitize (e.g. a feed or provider name). |
required |
Returns:
| Type | Description |
|---|---|
str
|
A filesystem-safe string containing only letters, digits, |
str
|
underscores, and hyphens. |