Skip to main content

Python library to help build Flow Launcher plugins.

Project description

Installation

Install via pip:

python -m pip install pyflowlauncher

Usage

Basic plugin

A basic plugin using a function as the query method.

from pyflowlauncher import Plugin, Result, send_results
from pyflowlauncher.result import, ResultResponse

plugin = Plugin()


@plugin.on_method
def query(query: str) -> ResultResponse:
    r = Result(
        Title="This is a title!",
        SubTitle="This is the subtitle!",
        IcoPath="icon.png"
    )
    return send_results([r])


plugin.run()

Advanced plugin

A more advanced usage using a Method class as the query method.

from pyflowlauncher import Plugin, Result, Method
from pyflowlauncher.result import, ResultResponse

plugin = Plugin()


class Query(Method):

    def __call__(self, query: str) -> ResultResponse:
        r = Result(
            Title="This is a title!",
            SubTitle="This is the subtitle!"
        )
        self.add_result(r)
        return self.return_results()

plugin.add_method(Query())
plugin.run()

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

pyflowlauncher-0.3.0.dev0.tar.gz (8.4 kB view hashes)

Uploaded Source

Built Distribution

pyflowlauncher-0.3.0.dev0-py3-none-any.whl (10.3 kB view hashes)

Uploaded Python 3

Supported by

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