DEV Community

Selva Ganapathi Arumugam
Selva Ganapathi Arumugam

Posted on

I built a schema-driven Python web framework that generates your entire FastAPI stack — meet tamilPY

If you've ever hand-rolled the same models → migrations → repositories → services → controllers → routes boilerplate for the fifth API in a row, this one's for you.

I just shipped tamilPY (v0.1.9) on PyPI — a schema-first Python web framework built on top of FastAPI. You write one file, schema.tpy, and it generates a production-ready backend (and optionally a full admin dashboard) around it.

bash
pip install tamilPY
The pitch in one sentence

Define your models once in a tiny domain-specific schema language, run tpy build, and get a fully wired FastAPI application — models, migrations, repositories, services, controllers, and routes — without writing any of the plumbing by hand.

Why "tamilPY"?

Small personal touch: the name nods to my mother tongue, Tamil. The framework itself isn't Tamil-specific at all — it's a general-purpose tool for any team, any language, any project.

What's actually in the box
Schema-first generation — schema.tpy drives everything downstream
Multi-database support — SQLite, PostgreSQL, MySQL, and MongoDB
Full CRUD generation from a single build step
Query builder + relationships — fluent queries, relations { } blocks, eager loading
Events, queues, and a scheduler — sync event bus, background jobs, cron-style tasks
Caching, validation, and API envelopes — memory/file/Redis cache, pipe-style validation rules, ApiResponse
A small "kernel" platform — providers/plugins, middleware groups, health checks, lifecycle hooks
Generated admin dashboard — an optional Vite + React UI built straight from your schema
A real CLI — scaffolding, migrations, seeding, queues, scheduling, cache control, and a dev server
A taste of the schema language
tpy
database postgres

model User {
id: uuid primary
email: string unique required
}

model Post {
id: uuid primary
title: string required index
body: string nullable
user_id: uuid references User
status: string default "draft"
published: bool default false
views: int default 0

relations {
belongs_to User as author via user_id
has_many Comment as comments
}
}

Constraints like required, unique, nullable, index, default, and references map straight to real column definitions, indexes, and foreign keys. Define parent models before their dependents and migrations run in the right order automatically.

From zero to running API
bash
tpy new myapp
cd myapp

edit schema.tpy, then:

tpy build # configure your database + generate app layers
tpy migrate # apply migrations
tpy seed # optional sample data
tpy serve # http://127.0.0.1:8000

Want an admin panel too?

bash
tpy admin
cd admin && npm install && npm run dev # http://127.0.0.1:5173

Need auth? tpy auth scaffolds JWT login/register/refresh/logout, roles, and seeds a default super-admin — one command, and your dashboard is already gated by role.

How it stacks up
Criteria Django Flask FastAPI (plain) tamilPY
Boilerplate High Build it yourself Moderate Very low (schema-generated)
Code generation ❌ ❌ ❌ ✅ Full stack
Admin dashboard ✅ Built-in ❌ ❌ ✅ Generated (Vite + React)
Type safety Optional Optional ✅ Pydantic ✅ Pydantic-enforced
Time to MVP Days/weeks Weeks Days Hours to a few days

(Ratings reflect typical experience on standard CRUD/API projects — your mileage will vary with team familiarity and project scope.)

One honest caveat

Generated repositories and DB providers are synchronous, and FastAPI route handlers call them directly. That keeps things simple and portable across all four database backends, but if you're planning for heavy IO under load, run workers behind a process manager rather than assuming the DB layer is async-native — that's on the roadmap, not in v0.1.9.

Try it
bash
pip install tamilPY
python -m tpy.cli version
📦 PyPI: https://pypi.org/project/tamilPY/
📚 Docs: https://selvaganapathiarumugam.github.io/tamilPY/
💻 GitHub: https://github.com/Selvaganapathiarumugam/tamilPY

Requires Python 3.12+. MIT licensed.

I'd genuinely love feedback from this community — especially on the schema language design and where the generated code gets in your way. Issues and PRs welcome. 🙏

Built by Selvaganapathi Arumugam.

Top comments (0)