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 -e .        # depends on nats-py and python-dotenv

Quick start

import asyncio
from inflow_plugin_sdk import Action, 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, __import__("inflow_plugin_sdk").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.2.tar.gz (35.1 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.2-py3-none-any.whl (35.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: inflowenger_plugin_sdk-0.1.2.tar.gz
  • Upload date:
  • Size: 35.1 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.2.tar.gz
Algorithm Hash digest
SHA256 e1c9e86cc2fc229d523045d506a100c00bdf2f924a28d35253747ab9608d3f96
MD5 8b53bc0ec9c8e333321b93522d73cbae
BLAKE2b-256 e159f63399e2c134cc7a75259ba49643396d1c2ee49ea7df928a5bc2916b0572

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for inflowenger_plugin_sdk-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ecda31b1c4555f84785f9a0fbe6f22878dd7982b8fc3194bee4f0f09ab5f0278
MD5 22112f30e871cdff70238e883cfb8990
BLAKE2b-256 cb0f12d2ffeb21a8dd6614094fca5ffa3a4904da402fdb378d9d91681291ed8e

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.3

2 files

This release

0.1.2 This release

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