Python package for auto-loading modules and their objects.
Project description
Python Module Loader
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file python-module-loader-0.1.1.tar.gz
.
File metadata
- Download URL: python-module-loader-0.1.1.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4cd4a685fb092c7d2386d70e280d803b1cd6a9af857c542538047f8e08c5c6ca |
|
MD5 | 226d00aa324d9f1e4789cacc2da1b4fc |
|
BLAKE2b-256 | e747b92317967ff983022208e1ec0c5f9e8b6f1a431fecc0d2442ab3d4f603cb |
File details
Details for the file python_module_loader-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: python_module_loader-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c12d104c8536a209f13f58308d638c4fbf790f593543af8ee3423fe3964083a |
|
MD5 | 61e943ab65613190ef615c32c173d3b1 |
|
BLAKE2b-256 | c9ba6ac61df314754b37a06bd3e94e0c1e8767e8fd07a1e91c132c01f8577ce2 |