Skip to main content

๐Ÿ”ฅ Forge AI-native, full-stack applications with the fire of the gods

Project description

๐Ÿ”ฅ P8s (Prometheus)

Forge AI-native, full-stack applications with the fire of the gods.

Python 3.10+ FastAPI React AI Native License

Getting Started โ€ข Documentation โ€ข Features โ€ข Quick Start


Why P8s?

Django FastAPI P8s
Complete but legacy Fast but fragmented Best of both
Sync-first Async-first Async by default
Admin included No admin Django-style admin
No AI support No AI support AI is a primitive

P8s brings order to modern Python development.


โœจ Features

โšก Async Backend

  • FastAPI under the hood
  • SQLModel ORM (SQLAlchemy + Pydantic)
  • Automatic CRUD for registered models
  • UUID & Soft Deletes by default (.active(), .deleted(), .all_with_deleted())

๐Ÿ” Authentication

  • JWT Authentication out of the box
  • User roles (User, Admin, Superuser)
  • Permissions & Groups (Django-style)
  • Secure defaults (bcrypt, protected routes)

๐Ÿค– AI-Native

  • AIField: Auto-generate content from prompts
  • VectorField: Store embeddings for semantic search
  • VectorSearch: Query by similarity
  • Supports OpenAI, Anthropic, Google, Ollama, and more

๐Ÿง‘โ€๐Ÿ’ผ Admin Panel

  • Django-style admin interface
  • Dynamic CRUD from your models
  • Search, filter, paginate, bulk actions
  • No frontend code required

๐Ÿ“ Forms & Validation

  • Pydantic-based form validation
  • ModelForm auto-generated from models
  • 11 field types with HTML rendering hints
  • CSRF protection middleware

๐Ÿ—„๏ธ Database & Migrations

  • Auto-detected migrations with Alembic
  • Fixtures: dumpdata / loaddata
  • Database shell: dbshell

๐Ÿ“ฆ CLI Tools (18+ commands)

p8s new project myapp    # Create project
p8s new app blog         # Add app
p8s dev                  # Development server (backend + frontend)
p8s migrate              # Run migrations
p8s makemigrations       # Auto-detect model changes
p8s createsuperuser      # Create admin user
p8s shell                # Interactive Python shell
p8s check                # Validate configuration
p8s dumpdata             # Export fixtures
p8s loaddata             # Import fixtures
p8s dbshell              # Database shell
p8s sendtestemail        # Test email config
p8s collectstatic        # Collect static files

๐Ÿš€ Quick Start

Installation

git clone https://github.com/Peppe37/p8s.git
cd p8s
pip install -e ".[all]"

Create a Project

p8s new project myapp
cd myapp

Run Development Server

p8s dev
๐Ÿ”ฅ P8s (Prometheus)
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
Starting development server...
  Backend:  http://localhost:8000
  Frontend: http://localhost:5173

[backend] INFO: Uvicorn running on http://localhost:8000
[frontend] VITE ready in 456ms

Access Your App

URL Description
http://localhost:8000 Backend API
http://localhost:8000/admin/ Admin panel
http://localhost:8000/docs OpenAPI docs
http://localhost:5173 Frontend

๐Ÿ’ป Code Example

from p8s import Model
from p8s.ai import AIField, VectorField
from p8s.admin import register_model
from sqlmodel import Field

@register_model
class Product(Model, table=True):
    name: str = Field(index=True)
    description: str

    # AI-generated SEO description
    seo_description: str | None = AIField(
        prompt="Generate SEO description for {name}: {description}",
        source_fields=["name", "description"],
    )

    # Vector embedding for similarity search
    embedding: list[float] | None = VectorField(
        source_field="description"
    )

    class Admin:
        list_display = ["name", "created_at"]
        search_fields = ["name"]

Forms Example

from p8s.forms import Form, ModelForm, CharField, EmailField

class ContactForm(Form):
    name: str = CharField(max_length=100)
    email: str = EmailField()
    message: str

form = ContactForm.from_data(request.form)
if form.is_valid():
    send_email(form.data)

๐Ÿ—๏ธ Project Structure

myapp/
โ”œโ”€โ”€ backend/
โ”‚   โ”œโ”€โ”€ main.py          # FastAPI entry point
โ”‚   โ”œโ”€โ”€ models.py        # Database models
โ”‚   โ”œโ”€โ”€ settings.py      # Configuration (Pydantic Settings)
โ”‚   โ””โ”€โ”€ apps/            # Your apps
โ”‚       โ””โ”€โ”€ products/
โ”‚           โ”œโ”€โ”€ models.py
โ”‚           โ”œโ”€โ”€ router.py
โ”‚           โ””โ”€โ”€ schemas.py
โ”œโ”€โ”€ frontend/            # React + Vite
โ”‚   โ””โ”€โ”€ src/
โ”œโ”€โ”€ migrations/          # Alembic migrations
โ””โ”€โ”€ .env                 # Environment variables

๐Ÿ“š Documentation

Topic Description
Getting Started Create your first project
CLI Reference All 18+ commands
Models & Database SQLModel ORM usage
Migrations Auto-detected migrations
Authentication JWT and user management
Admin Panel Django-style admin
Forms Validation & ModelForm
Middleware CSRF, security, timing
AI Features AIField, VectorField, search
Testing Test utilities
Configuration Environment and settings
Deployment Docker, Railway, Fly.io

๐Ÿงช Test Coverage

pytest tests/ -v
# 186 passed โœ…

๐Ÿ›ฃ๏ธ Roadmap

โœ… Completed

  • Django-style settings discovery (P8S_SETTINGS_MODULE)
  • Admin panel with login, CRUD, bulk actions
  • JWT authentication with permissions/groups
  • SQLModel integration with soft deletes
  • Alembic migrations with auto-detection
  • Forms module with ModelForm
  • CSRF middleware
  • Fixtures (dumpdata/loaddata)
  • Testing utilities
  • 186 tests passing

๐Ÿšง In Progress

  • Admin inlines (nested models)
  • Frontend auth hooks
  • TypeScript type generation

๐Ÿ“‹ Planned

  • WebSocket support
  • Background tasks (Celery/ARQ)
  • i18n/l10n
  • Multi-tenancy
  • GraphQL support
  • PyPI release

๐Ÿค Contributing

Contributions are welcome! Please read the contributing guidelines before submitting a PR.

# Run tests
pytest tests/

# Lint
ruff check src/

# Format
ruff format src/

๐Ÿ“œ License

MIT โ€” steal the fire, responsibly ๐Ÿ”ฅ


Built with โค๏ธ by the Prometheus team

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

p8s-1.0.3.tar.gz (189.5 kB view details)

Uploaded Source

Built Distribution

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

p8s-1.0.3-py3-none-any.whl (217.5 kB view details)

Uploaded Python 3

File details

Details for the file p8s-1.0.3.tar.gz.

File metadata

  • Download URL: p8s-1.0.3.tar.gz
  • Upload date:
  • Size: 189.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for p8s-1.0.3.tar.gz
Algorithm Hash digest
SHA256 0b65d49c15882a8963477c2a64ad3bc5b25dccd60b6a3f80a1c4269e07dd9618
MD5 9de0a15984cf316ff4446aab98904f57
BLAKE2b-256 18dabfe526ea6360ecd410378a3bb263be5cc01b93b6020f769712d637e71fa4

See more details on using hashes here.

Provenance

The following attestation bundles were made for p8s-1.0.3.tar.gz:

Publisher: release.yml on Peppe37/p8s

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file p8s-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: p8s-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 217.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for p8s-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e79256f1a462e1bc4993efc179ddc984db68d7c7706a968949acc473cefc94a1
MD5 6c4407cded3b84845cbdc342cd2a9eb6
BLAKE2b-256 423d95058c0a671bfc3405e8f0013ddede56ae3f23518ba4d44cbd1d0ab5570e

See more details on using hashes here.

Provenance

The following attestation bundles were made for p8s-1.0.3-py3-none-any.whl:

Publisher: release.yml on Peppe37/p8s

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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