tagkit.core.utils¶
Utility functions for tagkit.
This module provides general utility functions used throughout the tagkit package.
Module Contents¶
Functions¶
Validate that only one of the given keyword arguments is set. |
|
Format a list of strings as a comma-separated list with each item in quotes. |
Data¶
API¶
- tagkit.core.utils.T = 'TypeVar(...)'¶
- tagkit.core.utils.validate_single_arg_set(kwarg_dict: dict[str, Any], allow_nothing_set: bool = True, strict_none: bool = True) None¶
Validate that only one of the given keyword arguments is set.
- Args:
kwarg_dict: Dictionary of keyword arguments to validate allow_nothing_set: If True, allows no arguments to be set strict_none: If True, considers None values as not set
- Raises:
- ValueError: If more than one argument is set, or if no arguments are set
and allow_nothing_set is False
- tagkit.core.utils._quoted_comma_sep_list(items: Iterable[str]) str¶
Format a list of strings as a comma-separated list with each item in quotes.
- Args:
items: Iterable of strings to format
- Returns:
A string with each item in quotes, separated by commas