Skip to main content

enlace-fastapi

FastAPI adapter for Enlace — a visual, chained-execution canvas for any OpenAPI-documented API. Drag operations from your API onto a canvas, wire one call's output into the next call's input, and run the whole chain from the browser. Docs and the full picture of what Enlace is: get-enlace.github.io.

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, running it, and holding credentials all happen client-side, in the browser, once the page loads.

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.1

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.1
File Size Uploaded
enlace_fastapi-0.0.1.tar.gz 361.6 kB Details

Built distribution (wheel)

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

Total release size: 725.3 kB

Release files / enlace_fastapi-0.0.1.tar.gz

Download URL enlace_fastapi-0.0.1.tar.gz
Size 361.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f55ab6613db25fa9712439b56da36f1530a94ed79db13075575c3861f3c1ab4a
BLAKE2b-256 checksum
How to use checksums
a1376f61bf52f1b78b5f6d4759e96f7aa339fe69c05407eda0c2001a19652fad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","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.1-py3-none-any.whl

Download URL enlace_fastapi-0.0.1-py3-none-any.whl
Size 363.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2df1d9a5f56e31fe5ec55d4a61534caa13b387a7d867726eb5504832c737aa98
BLAKE2b-256 checksum
How to use checksums
3512905a6c92fcf9147edcbaebcae96921674ccad81218dfe6d9e36b22af1a85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","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

0.0.9

2 release files

This release

0.0.1 This release

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