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.3.tar.gz (76.7 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.3-py3-none-any.whl (93.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for django_mindoff-0.1.3.tar.gz
Algorithm Hash digest
SHA256 36daef72dca9daf1666f280f191caecce712f6e901979464adec5c2307a102c1
MD5 9d1f44c5bf406a7d2f0955fa61318b8c
BLAKE2b-256 2d77a55448ea75729cbd24f1f4a9a3d03152555194b33b0cc4ddd146a9b242aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_mindoff-0.1.3.tar.gz:

Publisher: ci.yml on mindoffwork/django-mindoff

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

File details

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

File metadata

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

File hashes

Hashes for django_mindoff-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 28ab29fc866b0d25d0519f0c029fb92941cec5ed6a7cf9b6c5c0f3fe8de659a2
MD5 a614a10a24f74a58e47e37275151e3fc
BLAKE2b-256 5027eaaed6f03efe59145089f917b36b165df0f7f6a466aa20bc2764c40db274

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_mindoff-0.1.3-py3-none-any.whl:

Publisher: ci.yml on mindoffwork/django-mindoff

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