skillfed

djangorestframework-camel-case

Camel case JSON support for Django REST framework.

djangorestframework-camel-case v1.4.2 576.2K downloads/30d#5,931 on PyPI674
Permissive license BSD Active released

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-case

uv

uv add djangorestframework-camel-case

poetry

poetry add djangorestframework-camel-case

Installing 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

Development Status :: 2 - Pre-AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseNatural Language :: EnglishProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

django rest framework camel case jsonsnake case to camel case conversiondrf json field name transformationcamel case api responsesdjango rest framework naming conventionjson serialization case conversionapi field name mapping
django-rest-frameworkjson-serializationnaming-conventions

More Dynamic Content packages