bundles / traitlets 5.16.2 / traitlets / utils / importstring / import_item
function
traitlets.utils.importstring:import_item
Signature
def import_item(name: str) → AnySummary
Import and return bar given the string foo.bar.
Extended Summary
Calling bar = import_item("foo.bar") is the functional equivalent of executing the code from foo import bar.
Parameters
name: stringThe fully qualified name of the module/package being imported.
Returns
mod: objectThe imported object: for a dotted name
foo.bar, thebarattribute of modulefoo(which may be any object); for an un-dotted name, the module itself.
Aliases
traitlets.import_item