5.11 · Reference
Modules and runtime API¶
hinoki.modules.Module ¶
Base class for modules. Override lifespan to own resources.
from_settings
classmethod
¶
from_settings(settings: object) -> Module
Build the module from the application's settings. Override it to make
Hinoki(modules=[YourModule]) work; the default says it is not supported.
hinoki.modules.ModuleContext ¶
Per-worker context handed to module lifespans.
provide/get is a typed, explicit registry — not a global service
locator: one instance per worker, keyed by type.
hinoki.management.Command ¶
A project command with explicit arguments and module requirements.
Set name and optionally help/requires on a subclass. Override
add_arguments to define CLI arguments and handle to execute the
command. A synchronous or asynchronous handle is supported.
hinoki.management.CommandContext ¶
Settings and resources available during one command invocation.
hinoki.management.CommandError ¶
Bases: Exception
The command could not start or returned an invalid result.
hinoki.runtime.config.RuntimeConfig
dataclass
¶
hinoki.errors.ModuleGraphError ¶
Bases: RegistrationError
Missing dependency, dependency cycle or duplicate module name.
hinoki.errors.RegistrationError ¶
Bases: Exception
Invalid or conflicting declarations, raised before the app serves.