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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for pyflowlauncher-0.3.0.dev0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f8f4f71836dcf10be0c8abc7f8e755776afab5b9a1055e6ae1b998db9bb9d1f |
|
MD5 | 91ad06c6373bff7bbea1fa42b9f84872 |
|
BLAKE2b-256 | 0d6c57982954bbead52fd057ccfc232b80f1616332a6a05bd6b7991ca914a2e3 |
Close
Hashes for pyflowlauncher-0.3.0.dev0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db065973d5062b17822ccfd8ef4a068ca2064daecf15a161b88be5b7c6bf171e |
|
MD5 | 8322ef4471dd97f93bd87911e20db3ef |
|
BLAKE2b-256 | 2962a3a25ab8619bf6c78dde185668b67deb91ad6beb264e46e5572ff912c21a |