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
.envconfiguration- 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
557282978daf9a63375caacfe487fb987adf61829d3e0a8ab82f6970800fd667
|
|
| MD5 |
385d8253d5c72a7481becfd96b680d84
|
|
| BLAKE2b-256 |
c8d499498eb315c9f0f181860bddfdf8a8242538f963eb3149be1359fcefa124
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2dfbb8001ed628b9b17222c60e479b26f62271672e84676cf92eac6eab3eeced
|
|
| MD5 |
29afae4b51c9a07d7589f857b423bc2c
|
|
| BLAKE2b-256 |
e8ac75b9e98f332a0fed047502405ab2793a0a2b9be0636c3bb4939160647761
|