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— resolvesspecand 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-fastapipackage 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
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)
| File | Size | Uploaded | |
|---|---|---|---|
| enlace_fastapi-0.0.1.tar.gz | 361.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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}
|