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.dev1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c057b2db8fe5f0de4549fbc38e35fe87606fb0eb6ecd1567b2b69cdaa67c627 |
|
MD5 | 85379b1f9cdcc8690d2a32535e0da421 |
|
BLAKE2b-256 | d246066eba67d673cc6c1a8be73495b250884d48ffdfb9466b0f76e60ef4b823 |
Close
Hashes for pyflowlauncher-0.3.0.dev1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 537c4f7b478a389070a87065ec009cd9084bbdfefa03ec5ce75d6d146f6b3537 |
|
MD5 | 4740c5b50114323c324ac1cd5fc63aec |
|
BLAKE2b-256 | d94d9eebe8495d6824287a7147cf0d36f306ccb9679eb81e4ea21bf574db23e9 |