httk.core.register

Attributes

Functions

register_loader(, filenames, Ellipsis] = ) → None)

Register a loader under one or more file extensions and/or filenames.

known_extensions(→ list[str])

known_filenames(→ list[str])

register_entry_provider(→ None)

Register an EntryProvider factory under name.

known_entry_providers(→ list[str])

Module Contents

httk.core.register.loaders[source]
httk.core.register.loader_filenames[source]
httk.core.register.register_loader(*, name: str, loader: str, extensions: tuple[str, Ellipsis] = (), filenames: tuple[str, Ellipsis] = ()) None[source]

Register a loader under one or more file extensions and/or filenames.

extensions are matched (case-insensitively) against a file’s suffix, e.g. ".cif". filenames are exact basenames matched (case-insensitively) against a file’s name with any recognized compression suffix stripped, e.g. "POSCAR" matches POSCAR, poscar, and POSCAR.bz2.

httk.core.register.known_extensions() list[str][source]
httk.core.register.known_filenames() list[str][source]
httk.core.register.entry_providers[source]
httk.core.register.register_entry_provider(*, name: str, factory: str) None[source]

Register an EntryProvider factory under name.

factory is a lazy "module:callable" reference to a callable that constructs a provider (providers need data, so applications call the factory themselves; the registry only records how to reach it). This mirrors register_loader.

httk.core.register.known_entry_providers() list[str][source]