F# to Python compiler extension for Fable.
src/stdlib/- Python standard library bindings (Builtins, Json, Os, etc.)src/flask/- Flask web framework bindingssrc/fastapi/- FastAPI web framework bindingssrc/pydantic/- Pydantic model bindingstest/- Test filesexamples/- Example applications (flask, fastapi, django, timeflies)build/- Generated Python output (gitignored)
just clean # Clean all build artifacts (build/, obj/, bin/, .fable/)
just build # Build the project
just test-python # Run Python tests
just restore # Restore .NET and paket dependencies
just example-flask # Build and run Flask example
just example-fastapi # Build and run FastAPI example
just dev-fastapi # Run FastAPI with hot-reloadGenerated Python code goes to build/ directories (gitignored):
build/- Main library outputbuild/tests/- Test outputexamples/*/build/- Example outputs
F# types compile to non-native Python types:
int→Int32(not Python'sint)int64→Int64- F# array →
FSharpArray(not Python'slist) ResizeArray<T>→ Pythonlistnativeint→ Pythonint
Use Fable.Python.Json.dumps with fableDefault for JSON serialization of Fable types.
Use ResizeArray<T> for collections in web API responses.
Use Pydantic BaseModel for FastAPI request/response types (handles Int32 correctly).
See JSON.md for detailed serialization documentation.
Route decorators use Py.DecorateTemplate:
[<Erase; Py.DecorateTemplate("""app.get("{0}")""")>]
type GetAttribute(path: string) = inherit Attribute()Class attributes use Py.ClassAttributesTemplate for Pydantic-style classes.
When asked to create a release, read RELEASING.md for the release process.
Use Release-As: X.Y.Z-alpha.N.P in commit messages or PR descriptions to set the version.