Python plugin over gRPC
install SDK
Before you develop your python plugin, you need to install an dependency as SDK.
$ python3 -m pip install funppy
create plugin functions
Then you can write your plugin functions in python. The functions can be very flexible, only the following restrictions should be complied with.
- function should return at most one value and one error.
funppy.register()must be called to register plugin functions andfunppy.serve()must be called to start a plugin server process.
Here is some plugin functions as example.
import logging
from typing import List
import funppy
def sum_two_int(a: int, b: int) -> int:
return a + b
def sum_ints(*args: List[int]) -> int:
result = 0
for arg in args:
result += arg
return result
def Sum(*args):
result = 0
for arg in args:
result += arg
return result
if __name__ == '__main__':
funppy.register("sum_two_int", sum_two_int)
funppy.register("sum_ints", sum_ints)
funppy.register("sum", Sum)
funppy.serve()
You can get more examples at funppy/examples/.
build plugin
Python plugins do not need to be complied, just make sure its file suffix is .py by convention and should not be changed.
use plugin functions
Finally, you can use Init to initialize plugin via the xxx.py path, and you can call the plugin API to handle plugin functionality.
Metadata
Release files for funppy 0.5.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| funppy-0.5.2.tar.gz | 8.2 kB | Without provenance | Details for funppy-0.5.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| funppy-0.5.2-py3-none-any.whl | Python 3 | none | any | Details for funppy-0.5.2-py3-none-any.whl |
Total release size: 17.8 kB
Release files / funppy-0.5.2.tar.gz
| Download URL | funppy-0.5.2.tar.gz |
|---|---|
| Size | 8.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0a65b14da7b1507118e944141d9401ad2ba199262bf6e35b4ef35554dcb817e9
|
|
BLAKE2b-256 checksum How to use checksums |
b18fa734c6cb96e72189c4137b251536436d12a50ae8f63c0a8cc5cc00cab370
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.11.4 Darwin/22.5.0
|
Release files / funppy-0.5.2-py3-none-any.whl
| Download URL | funppy-0.5.2-py3-none-any.whl |
|---|---|
| Size | 9.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
85a9ced74a4a9560e179ae5c57cf262e8db2d023d13760d1a5261a9b3e8cb58b
|
|
BLAKE2b-256 checksum How to use checksums |
885717478f5b44110c3f5e5a88853d83749199fcadf1415cd490ff3c818ba488
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.11.4 Darwin/22.5.0
|
Security for funppy 0.5.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.