Skip to main content

Module utils

Module utils 

Source
Expand description

Utility functions for grammar and string operations

Functions§

escape_special_characters
Escape special characters in a string for use in configuration values
get_valid_filename
Get a valid filename by stripping invalid characters This is similar to Django’s get_valid_filename
is_special_char
Check if a character is a special character that needs escaping
is_valid_key
Validate that a key name is valid (no special characters except dots and underscores)
join_key
Join key parts into a dotted key
normalize_file_name
Normalize a config file name by adding .yaml extension if needed
sanitize_path_component
Sanitize a string for use in a file path
split_key
Split a dotted key into parts
unescape_string
Unescape a string by removing escape sequences