fastsprout 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
fastsprout/__init__.py ADDED
@@ -0,0 +1,13 @@
1
+ """FastSprout - Python backend framework that grows from a seed.
2
+
3
+ Modular monolith first, async-native, built on FastAPI.
4
+
5
+ This is an early preview (0.1.0). The full framework is in active development.
6
+ See https://fastsprout.dev for roadmap.
7
+ """
8
+
9
+ __version__ = "0.1.0"
10
+
11
+ from fastsprout.core.action import BaseAction
12
+
13
+ __all__ = ["BaseAction", "__version__"]
@@ -0,0 +1,3 @@
1
+ from fastsprout.core.action import BaseAction
2
+
3
+ __all__ = ["BaseAction"]
@@ -0,0 +1,24 @@
1
+ """BaseAction - the fundamental unit of work in fastsprout.
2
+
3
+ An action is a class with an async `__call__` method. It is the atomic
4
+ business operation that gets exposed through one or more channels
5
+ (REST endpoint, CLI command, background task, event handler).
6
+
7
+ Example:
8
+ >>> class CreateUser(BaseAction):
9
+ ... async def __call__(self, name: str) -> dict:
10
+ ... return {"created": name}
11
+ """
12
+
13
+ from typing import Any, Protocol, runtime_checkable
14
+
15
+
16
+ @runtime_checkable
17
+ class BaseAction(Protocol):
18
+ """Protocol for fastsprout actions.
19
+
20
+ An action is any callable class with an async `__call__` method.
21
+ Actions are the building blocks of fastsprout applications.
22
+ """
23
+
24
+ async def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
@@ -0,0 +1,159 @@
1
+ Metadata-Version: 2.4
2
+ Name: fastsprout
3
+ Version: 0.1.0
4
+ Summary: Python backend framework that grows from a seed. Modular monolith first, async-native, built on FastAPI.
5
+ Project-URL: Homepage, https://fastsprout.dev
6
+ Project-URL: Documentation, https://fastsprout.dev
7
+ Project-URL: Repository, https://forgejo.3dcra.eu/fastsprout/fastsprout
8
+ Project-URL: Issues, https://forgejo.3dcra.eu/fastsprout/fastsprout/issues
9
+ Project-URL: Changelog, https://forgejo.3dcra.eu/fastsprout/fastsprout/releases
10
+ Author-email: Illia Bahlai <bahlai.illia@gmail.com>
11
+ Maintainer-email: Illia Bahlai <bahlai.illia@gmail.com>
12
+ License: MIT
13
+ License-File: LICENSE
14
+ Keywords: async,backend,fastapi,framework,modular,modular-monolith,spring
15
+ Classifier: Development Status :: 3 - Alpha
16
+ Classifier: Framework :: FastAPI
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: License :: OSI Approved :: MIT License
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
22
+ Classifier: Typing :: Typed
23
+ Requires-Python: >=3.12
24
+ Requires-Dist: pydantic>=2.0
25
+ Description-Content-Type: text/markdown
26
+
27
+ # FastSprout
28
+
29
+ > Python backend framework that grows from a seed.
30
+ > Modular monolith first. Async-native. Built on FastAPI.
31
+
32
+ [![PyPI version](https://img.shields.io/pypi/v/fastsprout.svg)](https://pypi.org/project/fastsprout/)
33
+ [![Python versions](https://img.shields.io/pypi/pyversions/fastsprout.svg)](https://pypi.org/project/fastsprout/)
34
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
35
+
36
+ **⚠️ Early preview — 0.1.0 is a foundation release. Full framework is in active development.**
37
+
38
+ ## The seed metaphor
39
+
40
+ 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.
41
+
42
+ When you're ready, split into microservices. The same modules. Different deployment.
43
+
44
+ ## Why FastSprout
45
+
46
+ Python lacks a Spring Boot equivalent that respects Python idioms.
47
+
48
+ - **Django** is sync-first and not truly modular
49
+ - **FastAPI** is bare metal — no structure, no modules
50
+ - **PySpring** violates Zen of Python with Java-style decorators (`@GetMapping`) and JSON config
51
+
52
+ FastSprout is **Spring-inspired but Pythonic**:
53
+
54
+ | | PySpring | FastSprout |
55
+ |---|---|---|
56
+ | Decorators | `@GetMapping` (Java-style) | `@rest(method="GET")` (Pythonic) |
57
+ | Config | JSON files | pydantic-settings |
58
+ | Repository | Method name DSL | Filter objects + `q: Select` escape hatch |
59
+ | Modules | Components in flat structure | Modular monolith with boundaries |
60
+ | Type safety | Magic at startup | mypy sees everything |
61
+ | Stack | FastAPI + Pydantic | FastAPI + SQLModel + TaskIQ + FastStream |
62
+
63
+ ## Future API (in development)
64
+
65
+ ```python
66
+ from fastsprout.core import BaseAction
67
+ from fastsprout.web import rest
68
+ from fastsprout.tasks import taskable
69
+ from fastsprout.events import emits
70
+
71
+ @rest(method="POST", path="/")
72
+ @taskable(retries=3)
73
+ @emits(UserCreated)
74
+ class CreateUserAction(BaseAction):
75
+ async def __call__(self, data: UserCreate) -> User:
76
+ ...
77
+ ```
78
+
79
+ One declaration → REST endpoint + background task + emitted event. Each channel is a separate decorator from a separate fastsprout package.
80
+
81
+ ## Installation
82
+
83
+ ```bash
84
+ pip install fastsprout
85
+ ```
86
+
87
+ ## Status
88
+
89
+ This is **0.1.0** — a foundation release with the `BaseAction` protocol. The full framework is in active development.
90
+
91
+ ### Roadmap
92
+
93
+ - [x] **0.1.0** — Foundation (`BaseAction` protocol)
94
+ - [ ] **0.2.0** — `fastsprout-data` (Unit of Work, Repository, Alembic helper)
95
+ - [ ] **0.3.0** — `fastsprout-web` (`@rest` decorator, FastAPI integration)
96
+ - [ ] **0.4.0** — `fastsprout-tasks` (`@taskable`, TaskIQ integration)
97
+ - [ ] **0.5.0** — `fastsprout-events` (event bus, `@event_handler`)
98
+ - [ ] **0.6.0** — `fastsprout-modulith` (module discovery, boundaries)
99
+ - [ ] **0.7.0** — `fastsprout-security` (auth, permissions)
100
+ - [ ] **0.8.0** — `fastsprout-observability` (logging, metrics, tracing)
101
+ - [ ] **0.9.0** — `fastsprout-boot` (autoconfiguration)
102
+ - [ ] **1.0.0** — Production ready
103
+
104
+ ## Architecture
105
+
106
+ FastSprout is built in layers:
107
+ ┌─────────────────────────────────────┐
108
+ │ USER MODULES │ ← your business logic
109
+ ├─────────────────────────────────────┤
110
+ │ BOOT │ ← autoconfiguration
111
+ ├─────────────────────────────────────┤
112
+ │ MODULITH │ ← module discovery, boundaries
113
+ ├─────────────────────────────────────┤
114
+ │ INTERFACES │ ← @rest, @taskable, @event_handler
115
+ │ (web, tasks, events) │ security guards here
116
+ ├─────────────────────────────────────┤
117
+ │ DATA │ ← UoW, repositories
118
+ ├─────────────────────────────────────┤
119
+ │ CORE │ ← contracts, BaseAction, exceptions
120
+ └─────────────────────────────────────┘
121
+ OBSERVABILITY = cross-cutting, wraps everything
122
+
123
+ Each layer is a separate PyPI package. Use what you need.
124
+
125
+ ## Modules as PyPI packages
126
+
127
+ The core idea: domain modules are distributed via pip.
128
+
129
+ ```bash
130
+ pip install your-billing-module
131
+ ```
132
+
133
+ 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.
134
+
135
+ ```toml
136
+ # your-billing-module/pyproject.toml
137
+ [project]
138
+ dependencies = [
139
+ "fastsprout>=1.0",
140
+ "your-users-module>=1.0", # module dependencies via pip
141
+ ]
142
+
143
+ [project.entry-points."fastsprout.modules"]
144
+ billing = "your_billing_module"
145
+ ```
146
+
147
+ ## Links
148
+
149
+ - **Website**: [fastsprout.dev](https://fastsprout.dev)
150
+ - **Repository**: [forgejo.3dcra.eu/fastsprout/fastsprout](https://forgejo.3dcra.eu/fastsprout/fastsprout)
151
+ - **PyPI**: [pypi.org/project/fastsprout](https://pypi.org/project/fastsprout/)
152
+
153
+ ## Author
154
+
155
+ **Illia Bahlai** — [bahlai.illia@gmail.com](mailto:bahlai.illia@gmail.com)
156
+
157
+ ## License
158
+
159
+ MIT — see [LICENSE](LICENSE)
@@ -0,0 +1,7 @@
1
+ fastsprout/__init__.py,sha256=wR8iaFFZswfbhJPo1WYR7Wbm8s9s1mBO3-0mg1PE5O0,357
2
+ fastsprout/core/__init__.py,sha256=_BKST-lpT8klA6N0gca5pnzmSkfTEFkgnq9nvr2R6Os,72
3
+ fastsprout/core/action.py,sha256=Zi9t06oiKWyKfcISKQjMd27Qp2yQNxhGYZ48-eKGD6s,763
4
+ fastsprout-0.1.0.dist-info/METADATA,sha256=5dCKzeBCI0xA3sJqlx31sQc5OXOWazzlxwUcQo5LYrc,6686
5
+ fastsprout-0.1.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
6
+ fastsprout-0.1.0.dist-info/licenses/LICENSE,sha256=6ItMrOiu27X1rBdcKh1UZ5uFXn1-YzRJAr-yE6nEsGE,1069
7
+ fastsprout-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.29.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Illia Bahlai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.