Skip to main content

Rails-inspired web framework for FastAPI

Project description

PyRails

Convention over configuration web framework for FastAPI. Rails-inspired CLI and structure for Python's async ecosystem.

Installation

# From GitHub
pip install git+https://github.com/yourusername/pyrails.git

# From source
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              # Create app
pyrails g model NAME ...     # Generate model + migration
pyrails g controller NAME    # Generate controller  
pyrails db:migrate           # Run migrations
pyrails server               # Start dev server
pyrails console              # Interactive REPL

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    # Install with dev dependencies
make test       # Run tests
make lint       # Lint code
make demo       # Create demo app

Testing

# Run test suite
pytest

# Test installation
./test_install.sh

# Test pip install
./test_pip_install.sh

Contributing

See CONTRIBUTING.md

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyrails_mvc-0.1.0.tar.gz (45.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyrails_mvc-0.1.0-py3-none-any.whl (47.4 kB view details)

Uploaded Python 3

File details

Details for the file pyrails_mvc-0.1.0.tar.gz.

File metadata

  • Download URL: pyrails_mvc-0.1.0.tar.gz
  • Upload date:
  • Size: 45.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for pyrails_mvc-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a4e92d23c403fd065e990ae1a286d2f12509962302d2cc33d0038d415abeb6b2
MD5 678838fb032c9328e8c85d3d39dd5241
BLAKE2b-256 d6e330b5b01278905d2bf511193c6ee6be911ce11e7a1d71e32d5f2700eab105

See more details on using hashes here.

File details

Details for the file pyrails_mvc-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyrails_mvc-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 47.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for pyrails_mvc-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2ef5744b4cdee22906ad47e864a5006e600aa844156891e90efa97265b84785a
MD5 ed40aafbda58a9ade75b7943850e1c4d
BLAKE2b-256 0d126df08bdbeca12f41019b5a8269efaecdd778806ebb64c3608b0f8c832d07

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page