httk.core.register¶
Attributes¶
Classes¶
Registration metadata for one top-level httk command. |
Functions¶
|
Register a loader under one or more file |
|
|
|
|
|
Register one lazy adapter for each neutral payload format in |
|
Return format tags mapped to their registered adapter names. |
|
Register an |
|
|
|
Register a lazy top-level httk command. |
|
Return registered top-level command names without resolving handlers. |
|
Return command metadata without importing its implementation. |
Module Contents¶
- 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
extensionsand/orfilenames.extensionsare matched (case-insensitively) against a file’s suffix, e.g.".cif".filenamesare exact basenames matched (case-insensitively) against a file’s name with any recognized compression suffix stripped, e.g."POSCAR"matchesPOSCAR,poscar, andPOSCAR.bz2.
- httk.core.register.register_format_adapter(*, name: str, adapter: str | collections.abc.Callable[Ellipsis, Any], formats: collections.abc.Sequence[str]) None[source]¶
Register one lazy adapter for each neutral payload format in
formats.adaptermay be a callable or a lazy"module:callable"reference. A format tag has one owner: registering it again raises an error naming both the existing and attempted registrants.
- httk.core.register.known_format_adapters() dict[str, str][source]¶
Return format tags mapped to their registered adapter names.
- httk.core.register.register_entry_provider(*, name: str, factory: str) None[source]¶
Register an
EntryProviderfactory undername.factoryis 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 mirrorsregister_loader.
- class httk.core.register.CLICommand[source]¶
Registration metadata for one top-level httk command.
- handler: str | collections.abc.Callable[Ellipsis, Any][source]¶
- resolve() CLIHandler[source]¶
Import and return the registered command implementation.
- httk.core.register.register_cli_command(name: str, handler: str | collections.abc.Callable[Ellipsis, Any], summary: str) None[source]¶
Register a lazy top-level httk command.
A handler is either a callable or a lazy
"module:callable"reference with the contract(argv: Sequence[str], context: CLIContext) -> int. Names use lowercase, hyphen-separated command syntax. Registration is intentionally strict: reserved names and duplicate registrations are errors rather than order-dependent overrides.
- httk.core.register.known_cli_commands() list[str][source]¶
Return registered top-level command names without resolving handlers.
- httk.core.register.cli_command(name: str) CLICommand | None[source]¶
Return command metadata without importing its implementation.