Experimental Python SDK for Fastly Compute services.
- Multiple Framework Support: Examples with Bottle, Flask, and more
- WIT Bindings: Auto-generated Python bindings from Fastly's WIT files
- WSGI Compatibility: Host any WSGI-compatible web framework
- Testing Framework: Comprehensive viceroy-based integration testing
- Type Safety: Full type hints and IDE support
make serve # Serve default example (Bottle)
make serve EXAMPLE=flask-app # Serve Flask exampleVisit http://127.0.0.1:7676/hello/world or http://127.0.0.1:7676/info
make list-examples # List all examples
make build-all # Build all examplesmake test # Run integration testsThe fastly-compute-py build tool is written in Rust. By default, the Makefile uses cargo run (DEV_MODE=1), which means:
- No installation needed - the tool runs directly via cargo
- Always up-to-date - changes to Rust code are automatically picked up
- Fast incremental builds - cargo handles recompilation efficiently
Simply edit the Rust code in crates/fastly-compute-py/ and run make - that's it!
Alternative: Using the Python Entry Point
To test the installed fastly-compute-py command (how end users will invoke it):
make DEV_MODE=0 # Uses `uv run fastly-compute-py` instead of `cargo run`make format # Format code (Python + Rust)
make lint # Run linter (Python + Rust)
make lint-fix # Auto-fix linting issues (Python + Rust)make build/my-app.wasm # Build specific example
make clean # Clean all build artifactsCurrently demonstrates:
- Building pure Python into WebAssembly components
- Creating Python bindings from Fastly's WIT files
- Hosting web frameworks by adapting Fastly's API to WSGI
- Comprehensive testing with viceroy integration
- Any native Python modules need to be compiled against WASI. Few are at the moment. However, Joel has done some, and the changes needed aren't extensive.
See CONTRIBUTING.md.