Skip to main content

A Python plugin loader that will search for classes based from a list ofmodules and optionally use the file system to recurse into packages.

Project description

pyscovery is a Python plugin loader that will search for classes based from a
list of modules and optionally use the file system to recurse into packages.

This is different from pkg_resources and friends since it doesn't require you
to add every module that might have packages, it will discover it for you.

I wrote this because none of the existing solutions fit my need of being able
to logically group similar plugins in the filesystem.

Say you have the following structure in your project:

module/
__init__.py
plugin.py
plugins/
__init__.py
plugin1/
__init__.py
plugin2/
__init__.py
plugin3.py

With pyscovery, the following code will find plugins 1, 2, and 3 for you:

import pyscovery

from plugin import Plugin

pyscovery.add_module('plugins')
for plugin in pyscovery.find(Plugin, recurse=True):
print plugin

Recursion in the filesystem is off by default, since that's the way people are
used to. If there is enough demand, I will make it the default.

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

pyscovery-1.0.tar.gz (2.6 kB view details)

Uploaded Source

File details

Details for the file pyscovery-1.0.tar.gz.

File metadata

  • Download URL: pyscovery-1.0.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyscovery-1.0.tar.gz
Algorithm Hash digest
SHA256 33a0f1db26c10971adb8570a72dbf6dcf9b236af54cfab3cf03a488653649f2d
MD5 25b2eda6d27b9dadfdf7d1ebb3fe675d
BLAKE2b-256 1882c0b2076783a3d38ee390e52dc8f43a999e8cfed9d9924be65a75d5282c84

See more details on using hashes here.

Provenance

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