djangorestframework-camel-case
Camel case JSON support for Django REST framework.
What it is and what it does
This package bridges the naming-convention gap between JavaScript frontend conventions (camelCase) and Python backend conventions (snake_case) in Django REST Framework APIs. It provides custom renderers and parsers that automatically transform field names in both directions—converting Python snake_case model fields to camelCase in JSON responses and converting camelCase request bodies back to snake_case for Python processing.
The package handles this transformation at multiple layers: JSON rendering/parsing, form data parsing, and query parameter middleware. It supports configuration options like ignoring specific fields or keys, handling numbers in field names with different conventions, and swapping the underlying JSON renderer (e.g., to use ORJSONRenderer for performance). No runtime dependencies means lightweight installation, but setup requires explicit Django settings configuration.
Use it for:
- Frontend-backend API contracts where JavaScript clients expect camelCase but Django models use snake_case
- Migrating JavaScript-first codebases to Django without renaming all model fields
- Standardizing API responses to match JavaScript naming conventions while keeping Python code idiomatic
- Handling query parameters in camelCase from frontend requests and converting them to snake_case
- Building REST APIs that serve both web and mobile clients expecting camelCase JSON
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts JSON field names between camelCase and snake_case in Django REST Framework, providing renderers, parsers, and middleware to handle case transformation automatically.
Yes, if you need automatic case conversion between camelCase and snake_case in Django REST Framework. The package is actively maintained, has no runtime dependencies, carries a permissive license, and solves a real naming-convention mismatch problem. Setup requires explicit Django configuration but is straightforward. No known vulnerabilities. Install friction is high only due to configuration overhead, not dependency complexity.
Install
djangorestframework-camel-case on PyPI
pip
pip install djangorestframework-camel-caseuv
uv add djangorestframework-camel-casepoetry
poetry add djangorestframework-camel-caseInstalling djangorestframework-camel-case
Before you install
High install friction due to no runtime dependencies but requires explicit Django settings configuration. Package is actively maintained with recent commits and a stable release history since 2013, though marked Pre-Alpha in classifiers.
License in practice
BSD license is permissive; you can use, modify, and distribute this package freely in commercial and open-source projects with minimal restrictions.
Quickstart
pip install djangorestframework-camel-case
# In Django settings.py:
REST_FRAMEWORK = {
'DEFAULT_RENDERER_CLASSES': (
'djangorestframework_camel_case.render.CamelCaseJSONRenderer',
),
'DEFAULT_PARSER_CLASSES': (
'djangorestframework_camel_case.parser.CamelCaseJSONParser',
),
}
MIDDLEWARE = [
'djangorestframework_camel_case.middleware.CamelCaseMiddleWare',
]
Requires Django and Django REST Framework to be installed and configured; no automatic case conversion occurs without explicit settings registration.
Verify before relying
- Whether the Pre-Alpha classifier reflects current stability or is outdated given active maintenance since 2013
- Performance impact of recursive case transformation on large JSON payloads
- Compatibility with Django REST Framework versions beyond those in classifiers
Package facts
| License | BSD (permissive) |
| Python support | supports the current Python release (>=3.5) |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | actively maintained — 1,278 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 576,207/month — #5,931 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: djangorestframework-camel-case-1.4.2.tar.gz
Keywords: djangorestframework_camel_case
Tags
More Dynamic Content packages
MarkupSafe provides a text object that escapes…
permissive · top 100 on PyPI
Jinja2Jinja2 is a templating engine that renders…
permissive · top 100 on PyPI
soupsieveSoupsieve is a CSS selector library designed to…
permissive · top 100 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
FlaskFlask is a lightweight WSGI web application…
permissive · top 1,000 on PyPI
MakoMako compiles Python-embedded templates into…
permissive · top 1,000 on PyPI
camel-converterConverts strings and dictionary keys between…
permissive · top 5,000 on PyPI
case-convertConverts strings between different case formats…
copyleft · top 15,000 on PyPI
pyhumpsConverts strings and dictionary keys between…
permissive · top 5,000 on PyPI
djangorestframework-xmlAdds XML parsing and rendering support to…
permissive · top 15,000 on PyPI
drf-orjson-rendererProvides a high-performance JSON renderer and…
permissive · top 15,000 on PyPI
boa-strConverts strings to snake_case by normalizing…
permissive · top 5,000 on PyPI
djangorestframework-yamlAdds YAML parsing and rendering support to…
permissive · top 15,000 on PyPI
case-conversionConverts strings between any case format…
permissive · top 15,000 on PyPI
humpsConverts strings to camelCase format, handling…
copyleft · top 15,000 on PyPI
casefyCasefy converts strings between different…
permissive · top 5,000 on PyPI