Skip to main content

Architectural framework for reliable, scalable Django REST APIs with native Polars.

Project description

django-mindoff

django-mindoff is an architectural framework designed to eliminate repetitive API setup so developers can focus on business logic instead of infrastructure, scaffolding, and version coordination.

It combines project automation, standardized API architecture, structured responses, testing utilities, and Polars-powered workflows into one cohesive system.

Project Status ๐Ÿงช

django-mindoff is currently experimental and in active development. Architecture, philosophy, functionality and structure may evolve. It is designed for fresh Django-Mindoff projects and is not intended for retrofitting into existing Django applications.

Requirements โš™๏ธ

  • Python โ‰ฅ 3.12

All other framework dependencies are managed internally. django-mindoff selects compatible versions of Django, DRF, and Polars so you do not have to manage version alignment manually.

Installation ๐Ÿ“ฆ

pip install django-mindoff

Quick Start ๐Ÿš€

1. Initialize a Project

django-mindoff init

Creates a fully structured Django-Mindoff project with:

  • Virtual environment
  • .env configuration
  • Git initialization (if available)
  • Preconfigured architecture

2. Create Apps, Models, and APIs

python mindoff.py create

Interactive CLI allows you to:

  • Create apps โ†’ apps/<app_name>/
  • Create models โ†’ apps/<app_name>/models.py
  • Create APIs โ†’ apps/<app_name>/apis/<api_name>.py
  • Auto-register routes

3. Add Your Logic

Edit your generated API and return structured responses:

return mo_response_kit.json_response(
    code="SUCCESS",
    category="success",
    data={"message": "Hello World"}
)

Run the server. Focus on your logic. Repeat.


Response Standard ๐Ÿ“„

All responses follow a consistent structure:

{
	"status": "ok",
	"message": {
		"code": "SUCCESS",
		"title": "Success",
		"description": "Operation completed successfully.",
		"category": "success"
	},
	"data": {
		"id": "ec4786f7-3646-4159-a091-7c83ba3addaf",
		"name": "John Doe"
	}
}

No unstructured exceptions. No inconsistent payloads. Umm... One more thing. django-mindoff uses uuids for primary keys and foreign keys by design.

Architecture ๐Ÿงญ

Versioned Routing

<int:version>/<app_name>

Routers resolve the correct API version automatically.

Project Structure ๐Ÿ“

A freshly generated project follows this layout:

project_root/
โ”œโ”€ manage.py
โ”œโ”€ mindoff.py
โ”œโ”€ pytest.ini
โ”œโ”€ README.md
โ”œโ”€ .env
โ”‚
โ”œโ”€ config/
โ”‚  โ”œโ”€ settings.py
โ”‚  โ”œโ”€ urls.py
โ”‚  โ”œโ”€ asgi.py
โ”‚  โ”œโ”€ wsgi.py
โ”‚  โ””โ”€ Responses.csv
โ”‚
โ”œโ”€ templates/
โ”‚  โ”œโ”€ index.html
โ”‚  โ””โ”€ 404.html
โ”‚
โ””โ”€ apps/
   โ””โ”€ <app_name>/
      โ”œโ”€ apps.py
      โ”œโ”€ models.py
      โ”œโ”€ serializers.py
      โ”œโ”€ views.py
      โ”œโ”€ urls.py
      โ”œโ”€ apis/
      โ”‚  โ””โ”€ <api_name>.py
      โ”œโ”€ components/
      โ”‚  โ””โ”€ <component_name>.py
      โ””โ”€ tests/
         โ”œโ”€ test_views.py
         โ””โ”€ test_apis/
            โ””โ”€ test_<api_name>.py

Core Kits ๐Ÿงฐ

Mindoff is modular. Each kit removes a specific category of friction.

1. Project Management Kit: Prompt-driven CLI for creating and organizing projects, apps, models, and APIs.

2. API Kit: Centralized configuration layer handling validation, security, documentation, and error handling.

3. CRUD Kit: Polars DataFrame and LazyFrame driven database operations with validation.

4. Polars Kit: High-performance utilities for streaming-safe frame operations.

5. Validation Kit: Single-line validation helpers that reduce conditional complexity.

6. Response Kit: Structured JSON, file, text, and HTML responses.

7. TDD Kit: Testing base classes and helpers for rapid API testing.

CLI Overview ๐Ÿ› ๏ธ

django-mindoff init      # Create project
django-mindoff delete    # Delete project
python mindoff.py create # Create app/model/api
python mindoff.py delete # Delete app

Testing โœ…

MindoffTestCase provides:

  • Pytest integration
  • Mock app and model generation
  • Polars DataFrame and LazyFrame support
  • Assertion helpers

Configuration โš™๏ธ

Optional settings in settings.py:

MINDOFF_LOG_ERRORS_IN_DEBUG = False
MINDOFF_TRACEBACK_DIRS = ["apps", "config"]
REDIS_URL = config("REDIS_URL")
POLARS_VALIDATOR_ERROR_COL = "__error__info"
MINDOFF_USE_VIEW_CACHE = False

.env is auto-generated during initialization.

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

django_mindoff-0.1.2.tar.gz (79.2 kB view details)

Uploaded Source

Built Distribution

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

django_mindoff-0.1.2-py3-none-any.whl (97.8 kB view details)

Uploaded Python 3

File details

Details for the file django_mindoff-0.1.2.tar.gz.

File metadata

  • Download URL: django_mindoff-0.1.2.tar.gz
  • Upload date:
  • Size: 79.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for django_mindoff-0.1.2.tar.gz
Algorithm Hash digest
SHA256 557282978daf9a63375caacfe487fb987adf61829d3e0a8ab82f6970800fd667
MD5 385d8253d5c72a7481becfd96b680d84
BLAKE2b-256 c8d499498eb315c9f0f181860bddfdf8a8242538f963eb3149be1359fcefa124

See more details on using hashes here.

File details

Details for the file django_mindoff-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: django_mindoff-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 97.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for django_mindoff-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2dfbb8001ed628b9b17222c60e479b26f62271672e84676cf92eac6eab3eeced
MD5 29afae4b51c9a07d7589f857b423bc2c
BLAKE2b-256 e8ac75b9e98f332a0fed047502405ab2793a0a2b9be0636c3bb4939160647761

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