<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[SwiftPY - Async-first Python Framework]]></title><description><![CDATA[This publication is going to contain every content that concern SwiftPY framework such as tutorials, release note, changes, insight, etc]]></description><link>https://swiftpy-story.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6afc5ef4f701928eeaa25770/4fcc286d-41a4-4900-9f8a-af35a14d7b34.png</url><title>SwiftPY - Async-first Python Framework</title><link>https://swiftpy-story.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Wed, 18 Nov 2026 15:09:23 GMT</lastBuildDate><atom:link href="https://swiftpy-story.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Why I'm Building SwiftPY: A Decade of Laravel Meets Async Python]]></title><description><![CDATA[Ten years of Laravel, a year of AI projects on FastAPI, and the gap that made me start building SwiftPY. 1.0.0 is getting close.]]></description><link>https://swiftpy-story.hashnode.dev/why-i-m-building-swiftpy-a-decade-of-laravel-meets-async-python</link><guid isPermaLink="true">https://swiftpy-story.hashnode.dev/why-i-m-building-swiftpy-a-decade-of-laravel-meets-async-python</guid><category><![CDATA[Python]]></category><category><![CDATA[Open Source]]></category><category><![CDATA[webdev]]></category><category><![CDATA[AI]]></category><dc:creator><![CDATA[Akeem O. Salau]]></dc:creator><pubDate>Tue, 17 Nov 2026 17:33:58 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6afc5ef4f701928eeaa25770/24825db1-2506-472d-8092-643ae3f75f44.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>SwiftPY</strong> is getting closer to its first stable release: <strong>1.0.0</strong>.</p>
<p>Before I show you what already works, I owe you the story of why this framework exists. A new framework that appears out of nowhere deserves suspicion. This one did not appear out of nowhere.</p>
<h2>Ten years of Laravel, and Python the whole time</h2>
<p>I have built backend projects with Laravel for over ten years. I have also written Python for about as long as I have written PHP. But when a new backend landed on my desk, Laravel was always the tool I reached for first.</p>
<p>The reason is simple. Laravel gets out of your way. One command gives you a model with its migration. Another gives you a request class, a seeder, a service provider. You open any Laravel project and you already know where everything lives. Eloquent lets you write what you mean, and the framework quietly does the rest.</p>
<p>That feeling is hard to describe until you lose it.</p>
<h2>Then AI changed my default stack</h2>
<p>Recently, most of my projects involve AI integration. Embeddings, retrieval, streaming responses, tool calling, agents. And that work lives in Python. The SDKs, the vector databases, the tooling, the community: the gravity of the AI ecosystem pulls you there.</p>
<p>So I started using FastAPI for almost every new project.</p>
<p>I have nothing bad to say about FastAPI. It is fast, async first, and beautifully typed. It earned its popularity honestly. But FastAPI is deliberately a toolkit, not a full framework, and I felt that on every single project:</p>
<ul>
<li>Pick an ORM.</li>
<li>Pick a migration tool.</li>
<li>Decide the folder structure.</li>
<li>Invent your own pattern for services and repositories.</li>
<li>Wire the database pool into dependency injection.</li>
<li>Decide where validation lives.</li>
<li>Write your own seeding scripts.</li>
<li>Figure out background jobs, again.</li>
</ul>
<p>Each project started with the same ritual, and each time the skeleton came out slightly different. I kept missing the things Laravel had made feel normal: a real project structure, an expressive ORM, a CLI that writes the boring code for me, and conventions I did not have to rediscover.</p>
<h2>So this was not an overnight idea</h2>
<p>It was a pattern. The same friction, project after project, until the question changed from "which libraries should I assemble this time?" to "why does the framework I want not exist?"</p>
<p>The answer became SwiftPY: <strong>the async first foundation that FastAPI proved works, combined with the simplicity and flexibility that Laravel taught me to expect.</strong> An Eloquent style ORM. A real CLI with code generation. A professional project structure from the first command. Validation, caching, migrations and seeding as first class citizens instead of afterthoughts.</p>
<p>Here is what a SwiftPY application looks like at its smallest:</p>
<pre><code class="language-python">from swiftpy import Application, Request

app = Application(title="My API", version="0.1.0")


@app.get("/ping")
async def ping(request: Request) -&gt; dict[str, str]:
    return {"message": "pong"}
</code></pre>
<p>And here is validation that runs before your handler ever executes, with an async database rule included:</p>
<pre><code class="language-python">from swiftpy import Response, json_response
from swiftpy.validation import FormRequest
from swiftpy.validation.rules import email, min_, required, string, unique


class RegisterRequest(FormRequest):
    def rules(self) -&gt; dict[str, object]:
        return {
            "name": [required(), string(), min_(3)],
            "email": [required(), email(), unique("users", "email")],
        }


@app.post("/register")
async def register(form: RegisterRequest) -&gt; Response:
    data = form.validated()  # invalid input never reaches here: HTTP 422
    return json_response({"ok": True, "email": data["email"]}, status_code=201)
</code></pre>
<h2>Built in the open, tested on real projects</h2>
<p>Over the past few weeks, I have been publishing experimental and beta versions of SwiftPY to PyPI.</p>
<p>SwiftPY is a Python web framework I am building with one clear ambition: to give developers a powerful, developer friendly framework and a rich ecosystem of built in capabilities.</p>
<p>I do not want to build something that only looks impressive in demos. I want developers to confidently use it in real world applications.</p>
<p>That is why I am dogfooding SwiftPY on actual projects, including its official documentation website: Next.js on the frontend, SwiftPY powering the backend.</p>
<p>Real world testing keeps revealing things to improve: unexpected behaviour, implementation weaknesses and security gaps. I fix them, test the changes, and publish improved versions. That loop is the whole point.</p>
<h2>What is already working</h2>
<p>✅ Docker execution
✅ Routing and request handling
✅ CLI and project scaffolding
✅ ORM and database migrations
✅ Validation and application caching
✅ Code generation and other core features</p>
<h2>SwiftPY in action</h2>
<p><strong>1. CLI and code generation</strong></p>
<p>The generators are my favourite part. They bring back the Laravel habit of letting the framework write the boring code:</p>
<pre><code class="language-bash">swiftpy make:repository admin/admin_repository
swiftpy make:service admin/account_service
swiftpy make:provider PaymentServiceProvider
swiftpy make:request CreateOrderRequest
swiftpy make:model Post -m
swiftpy make:seeder UserSeeder
</code></pre>
<p><strong>2. Async ORM and relationships</strong></p>
<pre><code class="language-python">post = await Post.find_or_fail(1)
post = await Post.with_('user').where('id', 1).first()
</code></pre>
<p>Models are declared with plain Python type hints, and relationships load through explicit eager loading so you never trigger a silent N+1 query:</p>
<pre><code class="language-python">from swiftpy.database.orm import HasMany, Model


class Post(Model):
    __table__ = "posts"
    __fillable__ = ["title", "user_id"]

    id: int
    title: str
    user_id: int


class User(Model):
    __table__ = "users"
    __fillable__ = ["name", "email"]

    id: int
    name: str
    email: str

    posts = HasMany(Post, foreign_key="user_id")


users = await User.with_("posts").where("name", "Alice").get()
</code></pre>
<p><strong>3. Database migrations</strong></p>
<pre><code class="language-bash">swiftpy migrate
swiftpy migrate:rollback
swiftpy migrate:status
</code></pre>
<p><strong>4. Seeding</strong></p>
<pre><code class="language-bash">swiftpy db:seed
</code></pre>
<h2>AI integrations, tested with real credentials</h2>
<p>SwiftPY was born from AI projects, so AI cannot be an afterthought. I am testing the AI integrations with real OpenAI and Anthropic API credentials, not just mocked responses. Because mocks only prove that your code agrees with your assumptions.</p>
<p>The goal is that switching providers is a configuration change, not a rewrite. Streaming a response looks like this:</p>
<pre><code class="language-python">async for chunk in (
    AI.chat("claude-sonnet-4-6")
    .system("You are a helpful assistant.")
    .user(body.message)
    .stream()
):
    ...  # forward each token to the client
</code></pre>
<h2>Why am I taking my time?</h2>
<p>I do not want to rush into publishing 1.0.0 just to have a stable version number.</p>
<p>I want to release it when I am confident the framework is <strong>stable, secure, reliable and ready for production use</strong>. A version number is a promise, and I want to keep it.</p>
<p>The first official production ready release will be <strong>SwiftPY 1.0.0</strong>, and the documentation site will be available at <strong><a href="https://swiftpy.net">https://swiftpy.net</a></strong>.</p>
<h2>Help shape SwiftPY before 1.0.0</h2>
<p>I am looking for Python developers willing to get hands on with the beta releases.</p>
<p>You can help by:</p>
<ol>
<li>Building a small application with SwiftPY.</li>
<li>Testing its ORM, migrations, routing, validation and CLI.</li>
<li>Identifying bugs and potential security issues.</li>
<li>Contributing code, tests, examples or documentation.</li>
</ol>
<p>You do not need prior open source experience. If you are comfortable with Python and interested in helping improve a growing framework, I would love to hear from you.</p>
<p><strong>Send me a DM with "SWIFTPY TESTER" and I will share how to get started.</strong></p>
<h2>Where this is going</h2>
<p>Building a framework is one thing. Building one other developers can trust is another.</p>
<p>That is what I am working towards.</p>
<p><strong>SwiftPY: Building towards 1.0.0.</strong></p>
]]></content:encoded></item></channel></rss>