Python library to help build Flow Launcher plugins.
Project description
pyFlowLauncher
pyFlowLauncher is an API that allows you to quickly create plugins for Flow Launcher!
Installation
Install via pip:
python -m pip install pyflowlauncher[all]
[!IMPORTANT] Please use the
[all]
flag in order to support Python versions older then3.11
.
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
pyflowlauncher-0.9.0.tar.gz
(11.1 kB
view hashes)
Built Distribution
Close
Hashes for pyflowlauncher-0.9.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | baa637f10e22b7ba9127c53fbe7fd227570ed248e70b7cbb0d9a92fe4356457e |
|
MD5 | 6df7ca4f930c1f1d4274c2cdb81de1a3 |
|
BLAKE2b-256 | 7e25a78127bf24c8c98b16e33241d05942b46c7349ed6378153344e818b4f37e |