Skip to main content

Python package for auto-loading modules and their objects.

Project description

Python Autoloader

This package provides a way to automatically load specified modules with all of its submodules.
It is useful if we want to get all of the submodules without explicitly importing them.

For example, if we want to get all command classes in the package commands, we can do the following: ::

commands = (
    PythonModuleLoader()
    .load("app.commands", recursive=True)
    .find_objects(validators=[lambda obj: issubclass(obj, Command)])
)

The above code will load all modules in the package app.commands and find all subclasses of Command in it.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-module-loader-0.1.0.tar.gz (4.8 kB view hashes)

Uploaded Source

Built Distribution

python_module_loader-0.1.0-py3-none-any.whl (7.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page