Importing¶
Tools for easy interaction with modules.
New in version 0.2.
-
brownie.importing.
import_string
(name)[source]¶ Imports and returns an object given its name as a string.
As an addition to the normal way import paths are specified you can use a colon to delimit the object you want to import.
If the given name is invalid a
ValueError
is raised, if the module cannot be imported anImportError
.Beware of the fact that in order to import a module it is executed and therefore any exception could be raised, especially when dealing with third party code e.g. if you implement a plugin system.