Skip to main content

A high-speed, production-proven Python backend framework with built-in ORM, security, and native AI integration support.

Project description

Dreema Python Backend

Build Backend Systems That Scale

• Structure • Consistency • AI-ready systems

The current bottleneck in AI development isn't the AI—it’s the architecture.

While Large Language Models are exceptional at generating code, the systems they produce are often fragile, inconsistent, and difficult to maintain. Traditional frameworks were built for human-centric workflows, relying on deep tribal knowledge, complex boilerplate, and hidden side effects that confuse AI agents.

When frameworks prioritize "magic" over predictability, AI agents struggle to generate code that is production-ready.


Why Dreema?

Dreema is a paradigm shift: A Python framework architected specifically to be AI-native. By enforcing strict, predictable design patterns and standardized interfaces, Dreema ensures that AI-generated code is robust, modular, and natively compatible with automated workflows.

Stop fighting your framework. Start building with a foundation designed for the future of development using:

  • Dreem's batteries-included ecosystem featuring ORMs, Middlewares, Plugs, etc.
  • Enforced Architecture: Replaces flexible chaos with a deterministic MVC structure.
  • Universal Error Contract: Delivers standardized responses that AI agents can reliably parse, debug, and self-heal.
  • Native AI tools: Provides developers with AI tools for better developer experience.
  • Predictable Roadmap: Provides the structural clarity AI needs to build, maintain, and scale systems with confidence.

Our Vision

Dreema aims to redefine backend development by prioritizing both human intuition and AI efficiency. We provide the tools and structured architecture needed to build, maintain, and scale reliable backends that work seamlessly for both developers and AI agents.

Our Core Architecture

1. Enforced MVC Architecture

FastAPI is excellent for prototypes, but it lacks structural enforcement — leading to spaghetti code at scale. Dreema mandates a clean Model-View-Controller structure from day one leading to Zero Guesswork and AI Efficient as developers and AI agents know where to look.


2 . The Universal Response Contract

System fragility is the enemy of automation. Dreema implements a strict, fixed response schema for every request — internal or external. This provides a predictable contract that AI agents can rely on to diagnose, debug, and self-heal.

#Success

{
  "data": { "id": 1, "name": "Jane Doe" },
  "message": "User created successfully",
  "status": 21
}

Failure

{
  "data": null,
  "message": "Validation failed: email required",
  "status": 21
}

No controller-specific error formats. No guessing what shape a failure takes. Every response is machine-readable by design.


3 . Unified ORM

Stop scaffolding database connections by hand. Dreema includes a powerful, database-agnostic ORM that lets you switch between storage engines.

Write Once, Deploy Anywhere  —  Business logic stays decoupled from the storage engine.

Abstraction Done Right  —  Dreema manages connections and dialect differences so you focus on your application.


Demo: Perform CRUD in 60seconds

Setup and Installation

# setup and activate virtual environment
python -m venv venv
source venv/bin/activate

#install dreema
pip install dreema

Choose Your Style

Building high-performance endpoints with Dreema is designed to be intuitive. Choose the approach that fits your project needs.

Style A - Core Mode (Minimalistic)

Best for microservices or simple API routes. This setup provides a single entry point for all your logic.

⚠️ Warning: Not recommended for production; lacks the modularity needed for maintainable, scalable systems.

Create a project

dreema create project_name --mode core
cd project_name

Create and define routes inside endpoint.py

  from dreema.routing import route
  from controllers.usersController import UsersController

  # routes can also be defined this way
  async def create():
      return {
          'data': {
              'name': 'Kweku Dreem'
          },
          "message": "Message sent",
          "status": 20
      }

  async def welcome():
      return "Welcome to Dreema"

  # register created route
  routes = [
          # creating single routes
          route.get('/welcome', welcome),
          route.post('/create', create),
  ]

Start the server

  dreema run .

Style B - Installing with full mode (Recommended)

Step 1 — Create your model

dreema create-model userModel
# app/models/user.py
from dreema.orm import database

class UserModel(database.Database):
    # change tablename here
    tablename = 'users'

Step 2 — Create your controller

dreema create-controller usersController
# app/controllers/users.py
from dreema import Request
from app.models.user import UsersModel

class UsersController:

  @staticmethod
  async def createUser(request: Request):
      # Validate the incoming body
      body = await request.apply_rules({
          "name": "string,required",
          "email": "email,required"
      })

      # Short-circuit on validation failure
      if body.status < 0:
          return body

      # Create the record
      model = UsersModel()
      user = await User.create({
          "name": body.data.name,
          "email": body.data.email,
      })

      return user

Step 2 — Register endpoint

# app/view/endpoint.py
from dreema.routing import route, routegroup
import controllers.users as UsersController

"""
        author:  Raphael Djangmah
        Use:
                This file is the main view entry.
"""
routes = [
        # creating single routes
        route.post('/create-user', UsersController.createUser),
  ]

Step 5 — Start the server

  dreema run .

Step 6 — Call the endpoint

curl -X POST http://localhost:8000/create-user \
  -H "Content-Type: application/json" \
  -d '{"name": "Jane Doe", "email": "jane@example.com"}'

Response — always this shape, always.

  • If validation failed
{
  "data": Null,
  "message": "Attribute is missing",
  "status": -30
}
  • If validation succeeded
{
  "data": { "id": 1, "name": "Jane Doe", "email": "jane@example.com" },
  "message": "Create operation successful",
  "status": 22
}

Routing, validation, ORM, and response formatting — all handled, all consistent.

Convention Over Configuration

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

dreema-0.1.0.tar.gz (44.1 kB view details)

Uploaded Source

Built Distribution

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

dreema-0.1.0-py3-none-any.whl (54.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for dreema-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d8aefa5270097958516d1c672ad7177d5b468a5b18de8fbdfc070da1c508b421
MD5 77ce331c8ab7a6e1786c6add09d13bd5
BLAKE2b-256 6c6f8df86a04067de082ad3190f5f16d90327aded559c0e5d8b87c60e31d183f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for dreema-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eadeb79ee631ba5abbc37d58da5c73168e0749b7afc970191315d6a6551dfcf0
MD5 1820e301518cd9b42647e748b07d2cff
BLAKE2b-256 7173d174d07f89a86037209b1c520edc16a5326c1a382176c86795bba8067f0f

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