Skip to main content

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


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.1.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

python_module_loader-0.1.1-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

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

Hashes for python-module-loader-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4cd4a685fb092c7d2386d70e280d803b1cd6a9af857c542538047f8e08c5c6ca
MD5 226d00aa324d9f1e4789cacc2da1b4fc
BLAKE2b-256 e747b92317967ff983022208e1ec0c5f9e8b6f1a431fecc0d2442ab3d4f603cb

See more details on using hashes here.

File details

Details for the file python_module_loader-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for python_module_loader-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5c12d104c8536a209f13f58308d638c4fbf790f593543af8ee3423fe3964083a
MD5 61e943ab65613190ef615c32c173d3b1
BLAKE2b-256 c9ba6ac61df314754b37a06bd3e94e0c1e8767e8fd07a1e91c132c01f8577ce2

See more details on using hashes here.

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