Familiar structure
app/, routes/, config/, database/, and bootstrap/app.py — a layout you can navigate on day one.
You are viewing documentation for 0.x, which is not the latest version.Switch to 0.x (latest) →
Almasix is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable, creative experience. Almasix eases common tasks used in many web projects — routing, validation, the database layer, views, queues, and more — with first-class async/await for ASGI.
You do not need prior framework experience. Create apps with almasix new. Drive them with python smith …. Write controllers, Articulate models, Prism views, and migrations in a layout that stays navigable as the app grows. New here? Start with How to read these docs. Almasix is inspired by Laravel — credit and link live there.
pipx install almasixalmasix new blogcd blog# activate the app .venv (or pass --install to almasix new), then:python smith serveFamiliar structure
app/, routes/, config/, database/, and bootstrap/app.py — a layout you can navigate on day one.
Articulate ORM
Active Record models, a fluent query builder, relationships, migrations, and seeders — all async.
Prism views
A template engine with layouts, sections, components, and slots, compiled to Python and cached.
Smith CLI
Generate controllers, models, and migrations. Serve your app. Open Loupe. Migrate and seed your database.
Middleware & HTTP
Register middleware in bootstrap/app.py, define routes in routes/web.py and routes/api.py, and keep FastAPI out of your application code.
Async all the way
Controllers, queries, queue jobs, and scheduled tasks are coroutines — no thread pool bolted on afterwards.
Four files are enough for a page backed by the database.
# routes/web.pyfrom app.http.controllers.flight_controller import FlightController
from almasix.routing import Route
with Route.group(middleware=["web"]): Route.get("/flights", [FlightController, "index"])# app/http/controllers/flight_controller.pyfrom app.models.flight import Flight
from almasix.http import Controllerfrom almasix.prism import view
class FlightController(Controller): async def index(self): flights = await Flight.query().with_("airline").get() return view("flights.index", {"flights": flights})# app/models/flight.pyfrom almasix.orm import Model, relation
class Flight(Model): fillable = ("name", "airline_id")
@relation def airline(self): from app.models.airline import Airline
return self.belongs_to(Airline)<!-- resources/views/flights/index.prism.html -->@extends("layouts.app")
@section("content") <ul> @foreach(flights as flight) <li>{{ flight.name }} — {{ flight.airline.name }}</li> @endforeach </ul>@endsectionSmith is the CLI that ships inside every application. It generates code, runs migrations, serves the app, and opens Loupe — a REPL with your application already booted.
python smith list # every command available to your apppython smith make:controller PostControllerpython smith make:model Post -m # model plus a migrationpython smith migrate # run pending migrationspython smith db:seed # populate the databasepython smith queue:work # process queued jobspython smith loupe # a REPL inside your booted app