Serve React components from Python backends
Project description
wilco
Server-defined React components for Python backends.
Documentation: FastAPI Guide | Django Guide | Flask Guide | Starlette Guide
Features
- Co-locate components with backend logic — Keep UI components next to the Python code that powers them
- No frontend build pipeline — Components bundled on-the-fly with esbuild when requested
- Production-ready — Pre-compile bundles with
wilco buildfor static file serving - Full source map support — Debug TypeScript directly in browser devtools
- Component composition — Components can dynamically load other components
- Framework agnostic — Works with FastAPI, Django, Flask, Starlette, or any ASGI/WSGI-compatible framework
Quick Start
pip install wilco[fastapi] # or wilco[django], wilco[flask], wilco[starlette]
Create a component
my_components/
└── greeting/
├── __init__.py
├── index.tsx
└── schema.json
// index.tsx
interface GreetingProps {
name: string;
formal?: boolean;
}
export default function Greeting({ name, formal = false }: GreetingProps) {
const message = formal ? `Good day, ${name}.` : `Hey ${name}!`;
return <p>{message}</p>;
}
Mount the API
from pathlib import Path
from fastapi import FastAPI
from wilco import ComponentRegistry
from wilco.bridges.fastapi import create_router
app = FastAPI()
registry = ComponentRegistry(Path("./my_components"))
app.include_router(create_router(registry), prefix="/api")
Load in React
import { useComponent } from '@wilcojs/react';
function App() {
const Greeting = useComponent('greeting');
return <Greeting name="World" />;
}
For component schemas, composition patterns, and framework-specific guides, see the documentation.
API Endpoints
| Endpoint | Description |
|---|---|
GET /api/bundles |
List available components |
GET /api/bundles/{name}.js |
Get bundled JavaScript |
GET /api/bundles/{name}/metadata |
Get component metadata |
Requirements
- Python 3.10+
- Node.js (for esbuild bundling)
- React 19 on the frontend (bundled in the standalone loader)
CLI
wilco serve # Start development server (default)
wilco build --output dist/wilco/ # Pre-compile bundles for production
wilco build --output dist/wilco/ --prefix store --no-minify --sourcemap
See the CLI reference for all options.
Development
This project follows strict TDD methodology.
make test # Run all tests
make docs # Build documentation
make help # Show all available commands
License
Makersquad Source License 1.0 — see LICENSE.md for details.
Free for non-commercial use. Commercial use requires a license. Contact licensing@makersquad.fr for inquiries.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wilco-0.5.0.tar.gz.
File metadata
- Download URL: wilco-0.5.0.tar.gz
- Upload date:
- Size: 4.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97c311f286ee7e0222bb47eedbd91ba2865c793a5e8e07e8159391482ee90dc7
|
|
| MD5 |
d82385f595d0f6796b4ac1f1910504a1
|
|
| BLAKE2b-256 |
41aed51fcec2fd348fb73906af01e513c521abce0c4402259107682b69d67248
|
Provenance
The following attestation bundles were made for wilco-0.5.0.tar.gz:
Publisher:
cicd.yml on msqd/wilco
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wilco-0.5.0.tar.gz -
Subject digest:
97c311f286ee7e0222bb47eedbd91ba2865c793a5e8e07e8159391482ee90dc7 - Sigstore transparency entry: 1181683890
- Sigstore integration time:
-
Permalink:
msqd/wilco@917d5678c9b66d7fa084349df32fee611d49c1d9 -
Branch / Tag:
refs/tags/0.5.0 - Owner: https://github.com/msqd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cicd.yml@917d5678c9b66d7fa084349df32fee611d49c1d9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file wilco-0.5.0-py3-none-any.whl.
File metadata
- Download URL: wilco-0.5.0-py3-none-any.whl
- Upload date:
- Size: 112.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b1bc1939363916b130818ae840d0621a692c6f93ee4ecf7fd286385374cc523
|
|
| MD5 |
d35266811fbf854d86e297dcc480d2d3
|
|
| BLAKE2b-256 |
5325fce9602690e4ae2e0ca70ca4d9051bb75601abab182414cc7cfafda09d99
|
Provenance
The following attestation bundles were made for wilco-0.5.0-py3-none-any.whl:
Publisher:
cicd.yml on msqd/wilco
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wilco-0.5.0-py3-none-any.whl -
Subject digest:
8b1bc1939363916b130818ae840d0621a692c6f93ee4ecf7fd286385374cc523 - Sigstore transparency entry: 1181683893
- Sigstore integration time:
-
Permalink:
msqd/wilco@917d5678c9b66d7fa084349df32fee611d49c1d9 -
Branch / Tag:
refs/tags/0.5.0 - Owner: https://github.com/msqd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cicd.yml@917d5678c9b66d7fa084349df32fee611d49c1d9 -
Trigger Event:
push
-
Statement type: