Skip to main content

Python backend framework that grows from a seed. Modular monolith first, async-native, built on FastAPI.

Project description

FastSprout

Python backend framework that grows from a seed. Modular monolith first. Async-native. Built on FastAPI.

PyPI version Python versions License: MIT

⚠️ Early preview — 0.1.0 is a foundation release. Full framework is in active development.

The seed metaphor

Your backend starts as a single module — a seed. As your application grows, new modules sprout: users, billing, notifications. Each module is isolated, has its own boundaries (enforced by import-linter), and can be distributed as a PyPI package.

When you're ready, split into microservices. The same modules. Different deployment.

Why FastSprout

Python lacks a Spring Boot equivalent that respects Python idioms.

  • Django is sync-first and not truly modular
  • FastAPI is bare metal — no structure, no modules
  • PySpring violates Zen of Python with Java-style decorators (@GetMapping) and JSON config

FastSprout is Spring-inspired but Pythonic:

PySpring FastSprout
Decorators @GetMapping (Java-style) @rest(method="GET") (Pythonic)
Config JSON files pydantic-settings
Repository Method name DSL Filter objects + q: Select escape hatch
Modules Components in flat structure Modular monolith with boundaries
Type safety Magic at startup mypy sees everything
Stack FastAPI + Pydantic FastAPI + SQLModel + TaskIQ + FastStream

Future API (in development)

from fastsprout.core import BaseAction
from fastsprout.web import rest
from fastsprout.tasks import taskable
from fastsprout.events import emits

@rest(method="POST", path="/")
@taskable(retries=3)
@emits(UserCreated)
class CreateUserAction(BaseAction):
    async def __call__(self, data: UserCreate) -> User:
        ...

One declaration → REST endpoint + background task + emitted event. Each channel is a separate decorator from a separate fastsprout package.

Installation

pip install fastsprout

Status

This is 0.1.0 — a foundation release with the BaseAction protocol. The full framework is in active development.

Roadmap

  • 0.1.0 — Foundation (BaseAction protocol)
  • 0.2.0fastsprout-data (Unit of Work, Repository, Alembic helper)
  • 0.3.0fastsprout-web (@rest decorator, FastAPI integration)
  • 0.4.0fastsprout-tasks (@taskable, TaskIQ integration)
  • 0.5.0fastsprout-events (event bus, @event_handler)
  • 0.6.0fastsprout-modulith (module discovery, boundaries)
  • 0.7.0fastsprout-security (auth, permissions)
  • 0.8.0fastsprout-observability (logging, metrics, tracing)
  • 0.9.0fastsprout-boot (autoconfiguration)
  • 1.0.0 — Production ready

Architecture

FastSprout is built in layers: ┌─────────────────────────────────────┐ │ USER MODULES │ ← your business logic ├─────────────────────────────────────┤ │ BOOT │ ← autoconfiguration ├─────────────────────────────────────┤ │ MODULITH │ ← module discovery, boundaries ├─────────────────────────────────────┤ │ INTERFACES │ ← @rest, @taskable, @event_handler │ (web, tasks, events) │ security guards here ├─────────────────────────────────────┤ │ DATA │ ← UoW, repositories ├─────────────────────────────────────┤ │ CORE │ ← contracts, BaseAction, exceptions └─────────────────────────────────────┘ OBSERVABILITY = cross-cutting, wraps everything

Each layer is a separate PyPI package. Use what you need.

Modules as PyPI packages

The core idea: domain modules are distributed via pip.

pip install your-billing-module

The module is auto-discovered through entry points, its routes/CLI/tasks/migrations are registered, its settings are merged into your app settings. No manual wiring.

# your-billing-module/pyproject.toml
[project]
dependencies = [
    "fastsprout>=1.0",
    "your-users-module>=1.0",  # module dependencies via pip
]

[project.entry-points."fastsprout.modules"]
billing = "your_billing_module"

Links

Author

Illia Bahlaibahlai.illia@gmail.com

License

MIT — see LICENSE

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

fastsprout-0.1.0.tar.gz (28.6 kB view details)

Uploaded Source

Built Distribution

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

fastsprout-0.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file fastsprout-0.1.0.tar.gz.

File metadata

  • Download URL: fastsprout-0.1.0.tar.gz
  • Upload date:
  • Size: 28.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.10","id":"oracular","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for fastsprout-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7b4e6cb7ddfd6b24726f40184ee6184090595b12e04ff3e41dc7ff005fd70ed4
MD5 ecab4e71d260253a7e6422759746447d
BLAKE2b-256 b05a6a97be21b2638c19899fd080ac0f07a3dc07e2ddab2e08c376c3a7f01d9c

See more details on using hashes here.

File details

Details for the file fastsprout-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fastsprout-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.10","id":"oracular","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for fastsprout-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ae7f6012b0becc08b88ab2a6fdf18093b58cfe15a5317dd3b66f95c6478152c0
MD5 eb48806c1d3d888165e99595a66d28da
BLAKE2b-256 cbe8380ec65d3cd753b678a67a036ec8ec92f2f559a8ffde1be01e1b96eaf365

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