doubleblind.blinding.GenericCoder¶
- class doubleblind.blinding.GenericCoder(root_dir: Path, recursive: bool = True, included_file_types: Union[Set[str], Literal['all']] = 'all', excluded_file_types: Set[str] = frozenset({}))¶
A class for encoding and decoding files in a directory using a generic coding scheme.
The GenericCoder class provides functionality for encoding files in a directory using a generic coding scheme, as well as decoding the encoded files back to their original names. It supports various file types and allows customization of the encoding process.
- Args:
root_dir (Path): The root directory containing the files to be encoded/decoded. recursive (bool, optional): Flag indicating whether to perform the operation recursively
on all subdirectories. Defaults to True.
- included_file_types (Union[Set[str], Literal[‘all’]], optional): Set of file extensions
to be included for encoding/decoding. Pass ‘all’ to include all file types. Defaults to ‘all’.
- excluded_file_types (Set[str], optional): Set of file extensions to be excluded from
encoding/decoding. Defaults to an empty set.
- Attributes:
root_dir (Path): The root directory containing the files to be encoded/decoded. recursive (bool): Flag indicating whether to perform the operation recursively on
all subdirectories.
- included_file_types (Set[str] or ‘all’): Set of file extensions to be included for
encoding/decoding. ‘all’ represents all file types.
excluded_file_types (Set[str]): Set of file extensions to be excluded from encoding/decoding.
- __init__(root_dir: Path, recursive: bool = True, included_file_types: Union[Set[str], Literal['all']] = 'all', excluded_file_types: Set[str] = frozenset({}))¶
Methods
__init__
(root_dir[, recursive, ...])blind
([output_dir])Blind (encode) the files in the directory.
unblind
(additional_files)Unblind (decode) the files in the directory.
Attributes
FILENAME