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.1.0.dev0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49362012b1af064068399e9a5e2ffffa103a1e6c1e9383a8f5fedffc5682c683 |
|
MD5 | c49e0a19b1badabdee58d00a4d768b22 |
|
BLAKE2b-256 | 88f10d18e6bcac564db30b91c8e00b6ff38584e5978692144ad6acd8924cd0d2 |
Close
Hashes for pyflowlauncher-0.1.0.dev0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b86738f5bd7b37a7b11d8db1daa0ebe08096253475b1286233ce2e88fb70180a |
|
MD5 | 78b456a3597f0dcdc0be1de7d093d71a |
|
BLAKE2b-256 | 8fcda6c4082e6d67ee76e0f280cef2ce0814e0a2953d07f1fcfe2399774e4748 |