bundles / IPython 9.17.0 / IPython / core / magic / MagicsManager / register_lazy
function
IPython.core.magic:MagicsManager.register_lazy
Signature
def register_lazy(self, name: str, fully_qualified_name: str, magic_kind: _MagicSpec = line_cell) → NoneSummary
Lazily register a magic, without importing what implements it.
Extended Summary
The magic shows up in %lsmagic and in completion straight away; the module is only imported the first time it is looked up.
Parameters
name: strName of the magic you wish to register.
fully_qualified_name: strEither
"package.module", which is loaded as an IPython extension (and trusted to register the magic itself), or"package.module:MagicsClass", which is imported and registered directly -- how IPython declares its own magics.magic_kind: strOne of 'line', 'cell' or 'line_cell' (the default, since a lazily declared magic may well be both).
Aliases
IPython.core.magic.MagicsManager.register_lazy