Skip to main content

Overview

Launchpad represents a small factory and a distinct abstract for defining actionable items. This is particularly useful when creating libraries of tools or processes which need to be exposed and invokable.

Each action contains general details such as name, description etc as well as some richer functionality to invoke the action or for the action to expose further sub-actions or properties.

As the LaunchPad class is just a factory its population is dynamic based upon the paths your feed it (or expose through the LAUNCHPAD_PLUGIN_PATHS variable).

An example of use might be...

import launchpad

# -- Instance launchpad, this gives access to all the
# -- actions
lp = launchpad.LaunchPad('/usr/my_actions')

# -- We can cycle over all the actions
for action in lp.identifiers():
    print(action)

    # -- We can get an action and run it
    lp.request(action).run()

# -- We can access actions direclty too
action = lp.request('My Action Name')
action.run()

Installation

If you use pip, you can simply run pip install launchpad. That will pull down the required dependencies (scribble & factories) automatically.

Note: If you install launchpanel this module will be pulled down automatically as a dependency. Therefore you only need to pull down this module explicitly if you do not plan to utilise the launchpanel ui.

The Abstract

To define an action you must implement a Launch Action. The process of implementing an action is just a case of creating a python file and inheriting from the LaunchAction object, like this:

import launchpad

# ------------------------------------------------------------------------------
class MyAction(launchpad):
    Name = ''
    Description = __doc__
    Icon = ''
    Groups = []

    @classmethod
    def run(cls):
        pass

    @classmethod
    def actions(cls):
        return dict()

    @classmethod
    def properties(cls):
        return dict()

    @classmethod
    def viability(cls):
        return cls.VALID

The properties are very much about giving descriptive information about your action. Description, Icon and Groups are all optional and can be left out entirely if desired - but Name must always be filled in.

run() is where you perform the default action for this action.

actions() allows you to return a dictionary of key value pairs where the key is the action label and the value is the function/callable. This allows you to give your action variations or extended behaviour which is accessible in a consistent way.

viability() is the mechanism to give an indiciation as to whether your action is valid within the current environment. For example, if your action relies on paths existing, or environment variables being set, you can run those tests there are return the Action Viability (VALID, INVALID, DISABLED).

properties() is a mechanism for storing blind data. It should always return a dictionary but there is not formal structure for that dictionary. This is implemented to give you the oppotunity to store tool specific data within the action depending upon your needs.

Credits & Collaboration

This module was inspired by some excellent collaborative projects with a fantastic tech-artist called Toby Harrison-Banfield.

I am always open to collaboration, so if you spot bugs lets me know, or if you would like to contribute or get involved just shout!

Compatibility

Launchpad has been tested under Python 2.7 and Python 3.7 on Windows and Ubuntu.

Metadata

Release files for launchpad 2.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for launchpad 2.0.3
File Size Uploaded Provenance Actions
launchpad-2.0.3.tar.gz 5.8 kB Without provenance Details for launchpad-2.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for launchpad 2.0.3
File Interpreter ABI Platform Actions
launchpad-2.0.3-py3-none-any.whl Python 3 none any Details for launchpad-2.0.3-py3-none-any.whl

Total release size: 13.0 kB

Release files / launchpad-2.0.3.tar.gz

Download URL launchpad-2.0.3.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9265d9ea4dcfa54db9ab61606c7106fa64f5a1fb2397f23c1d6aaf43dd90a190
BLAKE2b-256 checksum
How to use checksums
dffe9fcfbbf7cd91e0be4cec41d1f80906c09a0a4f27f77cdedd5d24bf037800
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.7

Release files / launchpad-2.0.3-py3-none-any.whl

Download URL launchpad-2.0.3-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1ec20103e288bab35a4f8a725eb3c033f4435ba83125f1d2183d1879649d5bcf
BLAKE2b-256 checksum
How to use checksums
2446c615d80f508e9f7203fc82e317ce2737b66aa7782d446d5b40e8341cd697
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.7

Security for launchpad 2.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page