Skip to main content

inflowenger-plugin-sdk

Python SDK for building Inflowenger Plugin nodes (the inflowv1 protocol) — the Python port of go-plugin-sdk (sdkv1). It mirrors the Go SDK file-for-file and keeps the same wire format, so a Python plugin is interchangeable with a Go (or Node) plugin from the runtime's point of view.

Async, but faithful to Go

Go's nats.go is synchronous; Python's maintained NATS client (nats-py) is asyncio-only, so — like the Node port — this SDK is async. Method names are the Go names in snake_case (Job.Donejob.done, CmdGetScopecmd_get_scope, NewPluginnew_plugin).

One deliberate fidelity point: Plugin.send returns (msg, err) and never raises — exactly Go's (*nats.Msg, error) contract. A workflow the user has stopped leaves no NATS responders, and raising there would crash the whole plugin. Job methods return the error object (not raise) or the reply bytes, just like the Go handlers return err or msg.Data.

File map (Go → Python)

Go Python
sdkv1/plugin.go inflow_plugin_sdk/plugin.py
sdkv1/inflowV1.go inflow_plugin_sdk/inflow_v1.py
sdkv1/job.go inflow_plugin_sdk/job.py
sdkv1/req.go inflow_plugin_sdk/req.py
sdkv1/models.go + types.go inflow_plugin_sdk/models.py + types.py
sdkv1/dotenv.go inflow_plugin_sdk/env.py
nats/natsBox.go inflow_plugin_sdk/nats_box.py
formkit/*.go inflow_plugin_sdk/formkit/

Install

pip install inflowenger-plugin-sdk        # pulls nats-py and python-dotenv

Working on the SDK itself? Clone the repo and install it editable, so your source edits are picked up without reinstalling:

pip install -e ".[dev]"                   # editable, plus pytest / build / twine

Quick start

import asyncio
from inflow_plugin_sdk import Action, Frame, Job, new_plugin, with_dot_env


async def main() -> None:
    p = await new_plugin(with_dot_env(".env.inflow"))
    p.intro_data.name = "HTTP.CALL"
    p.intro_data.author = "inflow Dev. Team"
    p.intro_data.version = "v0.0.1"

    async def handler(job: Job) -> None:
        await job.progress(10, Frame(title="init", content="working"))
        await job.done({"action": "done"})

    p.add_action(Action(method="fn", request_handler=handler))

    await p.start()
    await asyncio.Event().wait()  # keep the process alive to serve requests


if __name__ == "__main__":
    asyncio.run(main())

See examples/rpc.py and examples/http_call.py (the ports of TestCommands / TestInit in sdkv1_test.go). Copy .env.inflow.example to .env.inflow and fill in the values Infra minted for your plugin.

Forms

formkit builds an action's JSON Schema + JSON Forms UI Schema from one declaration per field — the port of the Go formkit package:

from inflow_plugin_sdk import formkit

form = formkit.form("Create issue").add(
    formkit.text("projectKey", "Project key").required()
        .lookup("jira.meta.project.resolve", "Find").picks("jira.issue.create"),
    formkit.text("summary", "Summary").required(),
    formkit.text_area("description", "Description"),
).build()

p.add_action(Action(method="jira.issue.create", form=form, request_handler=...))

The protocol docs (docs/) are language-agnostic and shared with the Go and Node SDKs.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

inflowenger_plugin_sdk-0.1.3.tar.gz (35.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

inflowenger_plugin_sdk-0.1.3-py3-none-any.whl (35.6 kB view details)

Uploaded Python 3

File details

Details for the file inflowenger_plugin_sdk-0.1.3.tar.gz.

File metadata

  • Download URL: inflowenger_plugin_sdk-0.1.3.tar.gz
  • Upload date:
  • Size: 35.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for inflowenger_plugin_sdk-0.1.3.tar.gz
Algorithm Hash digest
SHA256 154a62979e4cc75af559ddfd69b755e8407da0c9483a054b8cd4ebafc64dfa46
MD5 295b1affa5b02735db5dbcd69a2e9059
BLAKE2b-256 a34e4ecbfebd8f0cda5d5416a07d38662bfe0b1ec40d13eec53c035b73290a4f

See more details on using hashes here.

File details

Details for the file inflowenger_plugin_sdk-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for inflowenger_plugin_sdk-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 df0c704323950f016a4b2005949678aba8e7ddf1c63caa8d4643766cdba0ae67
MD5 c3725a4e84900adfb6c39b20b555e691
BLAKE2b-256 e88103351d3f9c6ffd57bc4bc403ec45ac9ca50474a1756e0b930d54b879e5d7

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 files

0.1.2

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page