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.

Its functionality is based on exchangeable, documented and tested plugins and patterns.

It is designed to support any kind of Python 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 easily be extended by the usage of inheritable patterns. Thus, 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 the 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

The following commands can be used on a command line 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 syntax help for the hello command

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

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

groundwork-0.1.12-py3-none-any.whl (133.2 kB view details)

Uploaded Python 3

groundwork-0.1.12-py2-none-any.whl (133.2 kB view details)

Uploaded Python 2

File details

Details for the file groundwork-0.1.12.tar.gz.

File metadata

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

File hashes

Hashes for groundwork-0.1.12.tar.gz
Algorithm Hash digest
SHA256 b4a22990042a7633ff425bbdcdd5cfe44453fe0a2f0c403b5c7e4a4a2b5c4ec7
MD5 a77032b423b7efb57af2d121b92d57fc
BLAKE2b-256 18dd171b306eb810dbb067951451bdc7003ee9bf5bd7b229fce422ddd7c745f1

See more details on using hashes here.

File details

Details for the file groundwork-0.1.12-py3-none-any.whl.

File metadata

File hashes

Hashes for groundwork-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 3ebffd182f22f38762f91e3191b350878c2f8356f6f2b4e0b1679c9e1ccc09ed
MD5 0d3ccba48137e76baba48c856515f574
BLAKE2b-256 10a368c8a175dee27bc7fc7b865ac0739d962ef5efeec420d793f89bb07630a2

See more details on using hashes here.

File details

Details for the file groundwork-0.1.12-py2-none-any.whl.

File metadata

File hashes

Hashes for groundwork-0.1.12-py2-none-any.whl
Algorithm Hash digest
SHA256 a71c1a7ca3569fc8cb0eb9f3ec0978424efee75b1a6b0246c36eebd053a16ea3
MD5 712d3eebf7bf245f229deb1aa7879574
BLAKE2b-256 f56905875b2432dc09210edb5d43c33a5bf97867156a6cd6ba46ed5bade61c89

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