abracudabra._import#

Import utilities for Abracudabra.

Functions#

import_library(→ types.ModuleType)

Import a library.

raise_library_not_found(→ NoReturn)

Raise an error for a missing library.

get_library_name(→ str)

Get the dependency of an object.

Module Contents#

abracudabra._import.import_library(library: str, /) types.ModuleType[source]#

Import a library.

Parameters:

library – The name of the library to import.

Raises:

ImportError – If the library could not be found.

abracudabra._import.raise_library_not_found(library: str, cause: Exception | None = None) NoReturn[source]#

Raise an error for a missing library.

Parameters:
  • library – The name of the missing library.

  • cause – The optional original exception.

Raises:

ImportError – Always.

abracudabra._import.get_library_name(obj: object, /) str[source]#

Get the dependency of an object.

Parameters:

obj – The object to check.

Returns:

The dependency of the object.