Skip to main content

A plugin-based microframework for highly reusable applications and their components

Project description

groundwork is a python based microframework for highly reusable applications and their components.

It’s functionality is based on exchangeable, documented and tested plugins and patterns.

It is designed to support any kind of application: command line scripts, desktop programs or web applications.

groundwork enables applications to activate and deactivate plugins during runtime and to control dynamic plugin behaviors like plugin status, used signals, registered commands and much more.

The functionality of plugins can be easily extended by the usage of inheritable patterns. Based on this, groundwork supports developers with time-saving solutions for:

  • Command line interfaces

  • Loose inter-plugin communication via signals and receivers

  • Shared objects to provide and request content to and from other plugins

  • Static and dynamic documents for an overall documentation

Example

The following code defines a plugin with command line support and creates a groundwork application, which activates this plugin:

from groundwork import App
from groundwork.patterns import GwCommandsPattern

class MyPlugin(GwCommandsPattern):
    def _init_(self, *args, **kwargs):
        self.name = "My Plugin"
        super().__init__(*args, **kwargs)

    def activate(self):
        self.commands.register(command='hello',
                               description='prints "hello world"',
                               function=self.greetings)

    def greetings(self):
        print("Hello world")

if __name__ == "__main__":
    my_app = App(plugins=[MyPlugin])        # Creates app and registers MyPlugin
    my_app.plugins.activate(["My Plugin"])  # Initialise and activates 'My Plugin'
    my_app.commands.start_cli()             # Starts the command line interface

On a command line the following commands can be used now:

python my_app.py hello      # Prints 'Hello world'
python my_app.py            # Prints a list of available commands
python my_app.yp hello -h   # Prints some help text for the command hello

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

groundwork-0.1.1a2.tar.gz (18.8 kB view details)

Uploaded Source

File details

Details for the file groundwork-0.1.1a2.tar.gz.

File metadata

  • Download URL: groundwork-0.1.1a2.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for groundwork-0.1.1a2.tar.gz
Algorithm Hash digest
SHA256 4d136a7dc4974b860635d34d296eec802d1d0f55f263256e378f95a3b75ece8b
MD5 6decc3204c7e55bb3dc477a6499c7091
BLAKE2b-256 43754ee98920bee8217f6d07d80a22793de344a0d1aee742c80da62d86943b2b

See more details on using hashes here.

Supported by

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