Skip to content

Discover

Module discovery

Discover

__init__(directory=None)

Initialize the Discover class.

discover_geniusrise_installed_modules()

Discover installed geniusrise modules from Python path directories.

find_classes(module)

Discover spout/bolt classes in a module.

Parameters:

Name Type Description Default
module Any

Module to scan for spout/bolt classes.

required

get_geniusignore_patterns(directory) staticmethod

Read the .geniusignore file and return a list of patterns to ignore.

Parameters:

Name Type Description Default
directory str

Directory containing the .geniusignore file.

required

Returns:

Type Description
List[str]

List[str]: List of patterns to ignore.

get_init_args(cls)

Extract initialization arguments of a class.

Parameters:

Name Type Description Default
cls type

Class to extract initialization arguments from.

required

Returns:

Type Description
Dict[str, Any]

Dict[str, Any]: Initialization arguments.

import_module(path)

Import a module given its path.

Parameters:

Name Type Description Default
path str

Path to the module.

required

Returns:

Name Type Description
Any

Imported module.

scan_directory(directory=None)

Scan for spouts/bolts in installed extensions and user's codebase.

Parameters:

Name Type Description Default
directory Optional[str]

Directory to scan for user-defined spouts/bolts.

None

Returns:

Type Description
Dict[str, Any]

Dict[str, Any]: Discovered spouts/bolts.