Module dirct.key_mappers.key_mapper
Classes
class KeyMapper (*args, **kwargs)-
A protocol for classes that map keys to and from paths.
Ancestors
- typing.Protocol
- typing.Generic
Methods
def get_path(self, key: str, parent: pathlib.Path) ‑> pathlib.Path | None-
Get the child of parent for the given key, or return None if the key does not correspond to a path.
def key_of(self, path: pathlib.Path) ‑> str | None-
Get the key for the given path, or return None if the path does not correspond to a key.