jina.importer¶

jina.importer.import_classes(namespace, targets=None, show_import_table=False, import_once=False)[source]¶

Import all or selected executors into the runtime. This is called when Jina is first imported for registering the YAML constructor beforehand. It can be also used to import third-part or external executors.

Parameters
  • namespace (str) – the namespace to import

  • targets – the list of executor names to import

  • show_import_table (bool) – show the import result as a table

  • import_once (bool) – import everything only once, to avoid repeated import

class jina.importer.ImportExtensions(required, logger=None, help_text=None, pkg_name=None, verbose=True)[source]¶

Bases: object

A context manager for wrapping extension import and fallback. It guides the user to pip install correct package by looking up extra-requirements.txt

Parameters
  • required (bool) – set to True if you want to raise the ModuleNotFound error

  • logger – when not given, built-in warnings.warn will be used

  • help_text (Optional[str]) – the help text followed after

  • pkg_name (Optional[str]) – the package name to find in extra_requirements.txt, when not given the ModuleNotFound exec_val will be used as the best guess

class jina.importer.PathImporter[source]¶

Bases: object

static add_modules(*paths)[source]¶
Return type

Optional[module]