PyRails
Convention over configuration web framework for FastAPI. Rails-inspired CLI and structure for Python's async ecosystem.
Installation
pip install git+https://github.com/yourusername/pyrails.git
git clone https://github.com/yourusername/pyrails.git
cd pyrails
pip install .
See INSTALL.md for more options.
Quick Start
pyrails new blog
cd blog
pyrails generate model Post title:str body:text
pyrails db:migrate
pyrails server
Visit http://localhost:8000/docs
Commands
pyrails new APP
pyrails g model NAME ...
pyrails g controller NAME
pyrails db:migrate
pyrails server
pyrails console
See QUICKSTART.md for full command reference.
Features
- Rails-style CLI with colon notation (
db:migrate)
- Interactive app creation with templates
- Auto-generating migrations with models
- Async-first (FastAPI + SQLAlchemy 2.0)
- Convention over configuration
- Multiple templates (blog, chat, SaaS, API)
Templates
- empty - Bare structure
- blog - User + Article
- chat - OpenAI with vanilla JS
- saas - Multi-tenant + Stripe
- api - API-only
Field Types
str, text, int, float, bool, datetime, date, json, references
Example:
pyrails g model Post title:str author:references published:bool
Documentation
Development
git clone https://github.com/yourusername/pyrails.git
cd pyrails
make install
make test
make lint
make demo
Testing
pytest
./test_install.sh
./test_pip_install.sh
Contributing
See CONTRIBUTING.md
License
MIT