transparentmeta.utils package
Submodules
transparentmeta.utils.encoding_utils module
Utility functions for encoding and decoding strings and bytes.
- transparentmeta.utils.encoding_utils.decode_bytes_to_hexadecimal_string(byte_data, character_encoding)[source]
Decodes bytes to a hexadecimal string.
- Parameters:
byte_data (bytes) – The bytes to encode.
character_encoding (str) – The character encoding to use (e.g., “utf-8”).
- Returns:
- The hexadecimal representation of the bytes encoded with the
specified character encoding.
- Return type:
str
- transparentmeta.utils.encoding_utils.encode_hexadecimal_string_to_bytes(hex_string)[source]
Encodes a hexadecimal string to bytes.
- Parameters:
hex_string (str) – The hexadecimal string to decode.
- Returns:
The corresponding byte representation.
- Return type:
bytes
- Raises:
InvalidHexadecimalStringError – If the input is not a valid hexadecimal string.
- transparentmeta.utils.encoding_utils.encode_string_to_bytes(string, character_encoding)[source]
Encodes a string to bytes using the specified character encoding.
- Parameters:
string (str) – The string to encode.
character_encoding (str) – The character encoding to use (e.g., “utf-8”).
- Returns:
- The byte representation of the string encoded with the specified
character encoding.
- Return type:
bytes
transparentmeta.utils.exceptions module
This module hosts all custom exceptions used in utils.
transparentmeta.utils.file_utils module
Utility functions for file-related operations.
This module provides helper functions to work with files, such as extracting file extensions in a normalized format.