Skip to main content

enlace-fastapi

FastAPI adapter for Enlace — an interactive visual execution graph for any OpenAPI 3.x API. Drag operations from your API onto a canvas, wire inputs to outputs, and run multi-step workflows concurrently from the browser. Full documentation: get-enlace.github.io.

PyPI Live Demo Star on GitHub

This adapter's job is intentionally small: it serves your OpenAPI document and the canvas UI's static bundle. Nothing else — wiring up a chain, concurrent execution, and holding credentials all happen client-side in the browser.

Install

pip install enlace-fastapi

Usage

from fastapi import FastAPI
from enlace_fastapi import enlace

app = FastAPI()
app.include_router(enlace(spec="./openapi.json"), prefix="/enlace")

Open /enlace and the canvas loads, reading your spec from /enlace/api/spec.

spec is a file path (.json/.yaml/.yml) or an already-parsed OpenAPI 3.x dict — whatever's easiest to point at your API's own document.

Using FastAPI's own generated spec

Already have FastAPI building your OpenAPI document from your routes? Call app.openapi() yourself and pass the result straight through — no separate export step:

from fastapi import FastAPI
from enlace_fastapi import enlace

app = FastAPI(title="My API", version="1.0.0")

# ... your routes ...

app.include_router(enlace(spec=app.openapi()), prefix="/enlace")

app.openapi() builds (and caches) the schema from your routes, so call it after they're registered. Already mounting /docs or /redoc from the same app? Nothing about mounting enlace() changes how those keep working — they're independent consumers of the same spec.

How it works

enlace(spec=...) returns a plain APIRouter with two things mounted on it:

  • GET /api/spec — resolves spec and returns it as JSON, read fresh on every request rather than cached once at startup, so editing a spec file on disk shows up on the next canvas reload with no restart needed.
  • The canvas UI's static assets, at every other path under the router — this is a prebuilt bundle shipped inside the enlace-fastapi package itself, not fetched over the network at request time.

Everything past that — parsing the spec into operations, letting you wire a chain together, actually sending requests to your API when you hit Run — happens in the browser, in the UI bundle. This adapter never sees or proxies that traffic.

Contributing

See CONTRIBUTING.md for local development setup.

License

MIT

Release files for enlace-fastapi 0.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for enlace-fastapi 0.0.9
File Size Uploaded
enlace_fastapi-0.0.9.tar.gz 373.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for enlace-fastapi 0.0.9
File Interpreter ABI Platform
enlace_fastapi-0.0.9-py3-none-any.whl Python 3 none any Details

Total release size: 748.5 kB

Release files / enlace_fastapi-0.0.9.tar.gz

Download URL enlace_fastapi-0.0.9.tar.gz
Size 373.2 kB
Tags Source
SHA-256 checksum
How to use checksums
46fac96f2c1881ad09ea18325d47403bdd2a2101562e9055cebe5e3ba0f8a5c7
BLAKE2b-256 checksum
How to use checksums
ee04670d80256465fad6fc01c3a95e85af7ab5d065feef4e232247f1301b77b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / enlace_fastapi-0.0.9-py3-none-any.whl

Download URL enlace_fastapi-0.0.9-py3-none-any.whl
Size 375.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cf67b8cc6e91c4f7f0adecac68f2790a416001473cc1ec29f9e9736a2dc43dec
BLAKE2b-256 checksum
How to use checksums
acc26a0e7386a07824941ad26ec3d350d6b11157254d25632b225a7758368bda
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.0.9 This release

2 release files

0.0.1

2 release 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