Familiar structure
app/, routes/, config/, database/, and bootstrap/app.py — a layout you can navigate on day one.
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.
Create apps with almasix new. Drive them with smith …. Write controllers, Articulate models, Prism views, and migrations in a layout that stays navigable as the app grows.
pip install almasixalmasix new blogcd blogpip install -e .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.
from app.http.controllers.flight_controller import FlightController
from almasix.routing import Route
with Route.group(middleware=["web"]): Route.get("/flights", [FlightController, "index"])from 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})from 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)@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.
smith list # every command available to your appsmith make:controller PostControllersmith make:model Post -m # model plus a migrationsmith migrate # run pending migrationssmith db:seed # populate the databasesmith queue:work # process queued jobssmith loupe # a REPL inside your booted app