DEV Community

Cover image for SwiftPY 0.3.5 Beta: I Need Python Developers Who Will Try to Break It
Akeem O. Salau
Akeem O. Salau

Posted on

SwiftPY 0.3.5 Beta: I Need Python Developers Who Will Try to Break It

Most framework announcements say "try it". This one says something slightly different:

Please try to break it.

SwiftPY is an ASGI native, Eloquent style Python web framework I have been building for one reason. After more than ten years of backends with Laravel, and a recent stretch of AI projects on FastAPI, I wanted the async first speed of the Python ecosystem together with the structure, conventions and tooling I had learned to love. That framework did not exist, so I started building it.

SwiftPY is now at version 0.3.5, it is on PyPI, and it is still in beta. Before I call anything 1.0.0, I want people other than me to push on it.

GitHub: https://github.com/Obrainwave/swiftpy

Why beta testers matter more than any feature

I use SwiftPY on real projects, including its own documentation site (Next.js on the frontend, SwiftPY on the backend). Real use is the best bug finder I have, but it has a hard limit: it only exercises the paths I happen to take.

Every developer builds differently. You will name your models differently, nest your routes differently, deploy behind a different proxy and hit combinations I never imagined. That is exactly the information a 1.0.0 release needs.

The changelog shows what this loop looks like in practice. In 0.3.5 alone, the entries under "Fixed" include:

  • a comma separated trusted_proxies string that passed validation but later broke every request.ip() call
  • a scheduler loop that listed every schedule on each wake up instead of reading the earliest due time
  • overlap locks that could expire while a long running job was still executing

Each one is a small, specific, fixable problem. Finding them early, in public, is the whole point.

What is already in the box

SwiftPY is not a toy router. Over the last few weeks the beta has grown into a full framework:

  • An async Active Record ORM with typed models, eager loading, dirty tracking, HasMany, HasOne, BelongsTo and BelongsToMany, plus relationship existence queries such as has() and where_has()
  • A fluent query builder and migrations with Blueprint, pagination, group_by, having, and PostgreSQL advisory locks
  • Validation through FormRequest and validate(), failing closed before your handler runs
  • Authentication with JWT pairs, refresh token rotation, API keys, Auth.attempt(), remember me sessions, auth lifecycle events and built in login throttling
  • A native task scheduler with a strict five field cron engine, time zone support and a durable Redis store, driven by schedule:work
  • Queues, events, cache, storage, mail and WebSockets
  • A native AI subsystem for OpenAI and Anthropic: streaming, embeddings, vector stores, RAG, tool calling agents, and versioned prompt templates
  • A CLI that writes the boring code

A taste of the developer experience:

# Controller routing with per request dependency injection
router.get("/users", UserController.index)

# Credential login with throttling, events and optional remember me
await Auth.attempt({"email": email, "password": password, "active": 1}, remember=True)

# Update a model, respecting __fillable__ / __guarded__
await user.update({"name": "Alice"})
Enter fullscreen mode Exit fullscreen mode
swiftpy new my_service
swiftpy make:model Post -m
swiftpy make:request CreateOrderRequest
swiftpy make:agent SupportAssistant
swiftpy make:prompt summarise.v2
swiftpy migrate
swiftpy db:seed
swiftpy schedule:work
Enter fullscreen mode Exit fullscreen mode

Secure by default, and I want that tested hardest

Security is where outside eyes help most. These defaults already ship, and I would love you to attack them:

  • Mass assignment is denied unless a model declares __fillable__ or __guarded__
  • A WHERE less update() or delete() raises an error unless you opt in with .allow_all()
  • Client IP detection ignores forwarded headers unless you configure trusted proxies, and it resolves them right to left with strict bounds
  • Login throttling buckets IPv6 clients by /64, so rotating addresses inside one prefix cannot dodge a lockout
  • Scheduled tasks carry an HMAC signature, and tampered records are marked failed and never executed
  • Queue envelopes are signed before any class is imported
  • Production mode refuses weak secrets and never leaks tracebacks

If you find a hole, I want to hear about it. For anything security sensitive, please message me privately before posting it publicly.

How to get started

You need Python 3.12+, PostgreSQL and Redis. The scaffold ships with a Docker setup for the last two.

pip install swiftpy-framework
swiftpy new my_service
cd my_service
swiftpy migrate
swiftpy start --reload
Enter fullscreen mode Exit fullscreen mode

The step by step guides live in the repository's documentations folder, and the full documentation site at https://swiftpy.net arrives with 1.0.0.

Five ways to help, from 15 minutes to a weekend

  1. Build something small. A blog API, a todo service, an auth flow, a job that sends email. Whatever you would normally build, build it with SwiftPY.
  2. Stress the risky corners. Try your real database schemas with the migrations, relationships you actually use with the ORM, the scheduler across multiple workers, or login throttling behind your own proxy.
  3. Try your own platform. Windows, macOS, Linux, Docker Desktop, a cheap VPS. Environment bugs are invisible to a single developer.
  4. Report what you find. Open an issue on GitHub with what you expected, what happened and how to reproduce it. "This confused me" is a valid bug report, because confusing documentation is a bug.
  5. Contribute. Tests, examples, documentation fixes and code are all welcome. You do not need prior open source experience.

What to expect

This is a beta, so expect rough edges and the occasional breaking change before 1.0.0. Every release lists what was added, changed, fixed and secured in the public changelog, so nothing changes quietly.

I am also not going to rush 1.0.0 just to have a stable looking number. It ships when I am confident the framework is stable, secure and reliable enough for production. Your testing is how I get there.

Join in

Building a framework is one thing. Building one other developers can trust is another. Help me earn that trust before 1.0.0.

SwiftPY: Building towards 1.0.0.

Top comments (0)