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.8.tar.gz (110.1 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.8-py3.5.egg (196.7 kB view details)

Uploaded Egg

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for groundwork-0.1.8.tar.gz
Algorithm Hash digest
SHA256 67d055bf87bcadb06214f934caaa46834f290b2a714469158cf8d254725b2cde
MD5 a57fcde9f685f71309dd00a836d138f2
BLAKE2b-256 0e94dd4fbe62acedf226a6baf3649fc82f880a514a8a045f69d9669a96f4945b

See more details on using hashes here.

File details

Details for the file groundwork-0.1.8-py3.5.egg.

File metadata

  • Download URL: groundwork-0.1.8-py3.5.egg
  • Upload date:
  • Size: 196.7 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for groundwork-0.1.8-py3.5.egg
Algorithm Hash digest
SHA256 7e131ce7782e84902dfb5f7e05434ee5af8b51a4ede466b3d831d52bc2bcd7bd
MD5 51355db1f8274a9490378b05397c704a
BLAKE2b-256 4e527167ca787129ae20e4cfe69d44b4796a5cd0b6bd53db3e82b5856fbf4de1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for groundwork-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 7d7ff3a2b6d7a734c770d61d0eb92f50ddaf6d42c682cb820631de4003f5cafd
MD5 f768b2d855b7280a5ae66795bc1ad902
BLAKE2b-256 1d819b45a04a61d7d284ed8ef634f3e9dfb4caf7751fb6228973b534634bc854

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