Skip to main content

Library to manage plugins/extensions in your applications.

Project description

Latest PyPI version Number of PyPI downloads Travis results Coveralls results_

Goal and Philosophy

Pluginloader is a library to allow an easy way to load plugins. They can be managed by interfaces or just method validators.


  • Each plugin can be instanciated several times.
  • Customizable filter to select if a class should be loaded as a plugin.
  • Sandboxed: plugins cannot access the main program or other plugins by default, because they are loaded in isolated environments.



Two options: to install it in your system/project:

pip install pluginloader


You can load all plugins in a file, just doing:

loader = PluginLoader()
plugins = loader.load_file('')

With those simple lines you will have in the variable plugins a dictionary with each class inside the file as key and a factory as value.

Let’s see an example. Using the file:

class Foo(object):

We can have an object of that class just with:

loader = PluginLoader()
plugins = loader.load_file('')
instance1 = plugins['Foo']()
instance2 = plugins['Foo']()

Simple and easy.


This is a simple module with a simple API. It just contains one class, PluginLoader, with these public methods:

load_file(filename, onlyif=None)

Loads all plugins in a file.


  • filename: File name to be loaded.
  • onlyif: Value or function that will be called with each class found. It will skip the plugin if this function returns False.

load_directory(path, onlyif=None, recursive=False))

Loads all plugins in a directory.


  • path: Path where plugins are in.
  • onlyif: Value or function that will be called with each class found. It will skip the plugin if this function returns False.
  • recursive: Boolean value to allow recursive read of directories.

Links will always be ignored.


Copyright (c) 2014 Miguel Ángel García (@magmax9).

Licensed under the MIT license.

Project details

Release history Release notifications

History Node


History Node


History Node


This version
History Node


History Node


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
pluginloader-0.1.0.tar.gz (3.2 kB) Copy SHA256 hash SHA256 Source None May 22, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page