API Documentation¶
-
class
fptokens.Filename(root, folders=[], base=[], separator='_', extension='jpg', escape='$')[source]¶ Filenames with support for tokens.
Parameters: - root (str) – Root location
- folders (list of str) – Folder names, attribute supports tokens
- base (list of str) – Basename of the file, attribute supports tokens
- separator (str) – Separator for basename elements
- extension (str) – Filename extension
- escape (str) – Escape character for tokens, default:
$
-
abspath¶ Return the filename’s full absolute path.
Returns: Absolute path Return type: Path
-
parse()[source]¶ Parse the filename’s
foldersandbaseattributes, detect components that match the token pattern and replace these withfptokens.Tokenobjects.
-
resolve(**kwargs)[source]¶ Given a set of **kwargs, yield all possible permutations for the data set provided. Raise
TokenErrorifFilenamedoes not haven tokens or the data provided does not match the tokens.Params **kwargs: Permutation data
-
root¶ Return the filename’s root location.
Returns: Root location Return type: Path