Skip to main content

Core package

Project description

Fastloom – The Open Foundation for Building Event-Driven Services

Fastloom is a lightweight, batteries-included foundation for building modern backends. Define your settings, schemas, and endpoints; Fastloom wires up the rest: FastAPI, Mongo (Beanie), Rabbit (FastStream), metrics/traces/logs/errors, and more.

Think of it as the glue for your stack: web, messaging, caching, DB, observability, and integrations with best-in-class tools.


Why Fastloom

  • No boilerplate: minimal scaffolding/templating; most wiring is handled inside the library.
  • Composable: opt into only what you need via extras (fastapi, rabbit, kafka, mongo, redis, mcp, celery, openai).
  • Pydantic-first: type-safe models, validators, and clear input/output contracts.
  • Multi-tenant by design: tenant context flows through DI and storage.
  • AuthN/Z via DI: OIDC token introspection and pluggable PDP (ABAC/RBAC/ReBAC) hooks.
  • Event-driven ready: publish/subscribe with routing keys and health.
  • Observability-native: metrics, traces, logs from day one.
  • Self-hostable: production parity with a cloud/aaS setup.

Integrated Services (the platform)

Fastloom plugs into a family of self-hostable services:

  • IAM → OIDC/SSO, authN/Z, RBAC/ABAC/ReBAC.
  • Notify → realtime notifications, Pusher-compatible API.
  • Pulse → user activity + event tracking with OpenTelemetry hooks.
  • File → object storage on MinIO (S3-compatible).
  • Finance, Subscription, SMS/Email, Meet, Persona → optional services you can wire in.

Each service is:

  • self-hostable (Docker Compose or Helm),
  • BaaS-available.

Quick start

# Install fastloom with the extras you need
poetry add fastloom -E fastapi -E mongo -E rabbit

A minimal service is two files at the project root — settings.py and app.py — plus a tenants.yaml for defaults:

# settings.py
from fastloom.db.settings import MongoSettings
from fastloom.launcher.settings import LauncherSettings
from fastloom.observability.settings import ObservabilitySettings
from fastloom.settings.general import BaseGeneralSettings
from fastloom.signals.settings import RabbitmqSettings


class Settings(
    BaseGeneralSettings,
    LauncherSettings,
    MongoSettings,
    RabbitmqSettings,
    ObservabilitySettings,
): ...
# app.py
from fastapi import APIRouter

from fastloom.launcher.schemas import App

from my_service import models, signals

router = APIRouter()


@router.get("/ping")
async def ping() -> dict[str, str]:
    return {"pong": "ok"}


app = App(
    routes=[(router, "", "Health")],
    models_module=models,
    signals_module=signals,
)
# tenants.yaml
default:
    ENVIRONMENT: development
    PROJECT_NAME: my_service
    MONGO_URI: mongodb://localhost:27017
    MONGO_DATABASE: my_service
    RABBIT_URI: amqp://guest:guest@localhost:5672/

Run with the bundled CLI (registered as launch via [project.scripts]):

launch

See docs/quickstart.md for a fuller walkthrough.


What you get out of the box

  • App orchestrator (fastloom.launcher)
    • Discovers your routes, models, signals, and healthchecks from app.py / settings.py
    • Exposes settings and health endpoints (public toggle via LauncherSettings.SETTINGS_PUBLIC)
  • FastAPI-native
    • Dependency-injected request/tenant context and guards
    • Clear routing, OpenAPI, and dependency injection patterns
  • Auth & Access
    • DI-based guards with OIDC / OAuth2 token introspection
    • Optional IAM sidecar for introspection + ACL
  • Multi-tenancy
    • Tenant-aware DI context across web, DB, and messaging
    • Per-tenant settings endpoint backed by DB + cache, with tenants.yaml defaults
  • Database layer (MongoDB via Beanie)
    • Created/updated mixins, pagination utilities, typed helpers
    • Auto model discovery for DB init via App.models_module
  • Signals / Messaging (Rabbit via FastStream)
    • Event-driven publish/subscribe with retries and DLX-based backoff
    • Subscriber wiring and healthchecks
    • Auto-streamed BaseDocumentSignal Beanie models
  • Observability
    • OpenTelemetry distro + OTLP exporter, Logfire, Sentry (errors + profiling)
  • I18N
    • Exception handler and template utils with Babel/Jinja2
  • Healthchecks
    • Automatic app/DB/messaging/cache checks + system routes
  • MCP
    • Optional FastMCP mount with bearer auth forwarding
  • Pydantic-native schemas and validators
    • Schema In/Out validation for request/response contracts
    • Common types and validators (fastloom.types)

Dive deeper in the docs below.


Documentation


Claude Code integration

If you build services on top of fastloom and use Claude Code, you can install the fastloom-sdk plugin. It bundles:

  • Scaffolding skillsscaffold-fastloom-service, add-fastloom-route, add-rabbit-subscriber.
  • Audit skillaudit-fastloom-settings flags misuse in your settings.py / tenants.yaml.
  • Reference skillfastloom-reference ships the full docs/ so Claude can ground its answers in the canonical documentation instead of guessing from training data.
/plugin marketplace add aradng/FastLoom
/plugin install fastloom-sdk@fastloom

Skills auto-activate from context (e.g. asking "how does fastloom auth work?" triggers fastloom-reference); explicit invocation is /fastloom-sdk:<skill-name>. The plugin is opt-in per user and doesn't ship via PyPI — it's distributed through the marketplace in this same repo.


Roadmap

  • More CLI scaffolds and blueprints.
  • Automatic pydantic-ai agentic tool creation from APIs.
  • Migrate PDP to OPAL / opa based.

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

fastloom-0.4.41.tar.gz (40.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastloom-0.4.41-py3-none-any.whl (59.6 kB view details)

Uploaded Python 3

File details

Details for the file fastloom-0.4.41.tar.gz.

File metadata

  • Download URL: fastloom-0.4.41.tar.gz
  • Upload date:
  • Size: 40.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.13.13 Linux/6.17.0-1015-azure

File hashes

Hashes for fastloom-0.4.41.tar.gz
Algorithm Hash digest
SHA256 1f4176088fdc798f1dbaf5c9e475aa0fad5c9d199f4577063339918076043348
MD5 d6de4081d39727e2907af7a0eec8e3bd
BLAKE2b-256 31a5908d3fce4c8b44fd976ef8862448f058e3aaf3e2a52b0a132718923ef2e8

See more details on using hashes here.

File details

Details for the file fastloom-0.4.41-py3-none-any.whl.

File metadata

  • Download URL: fastloom-0.4.41-py3-none-any.whl
  • Upload date:
  • Size: 59.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.13.13 Linux/6.17.0-1015-azure

File hashes

Hashes for fastloom-0.4.41-py3-none-any.whl
Algorithm Hash digest
SHA256 7da8ad2226c8ce3f6d9701fc3a95f113a3ec602e35bfa0afaddc647973323928
MD5 0ba2f40df0f777debd79673c3342627a
BLAKE2b-256 9c7104d4a1d1aca6dbe0b0a1dd296f61990caf8eeacc7b63c198d5ce00e77296

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page