camel-converter
Converts a string from snake case to camel case or camel case to snake case
What it is and what it does
Camel Converter is a lightweight utility for transforming naming conventions between camelCase (used in JSON and JavaScript), snake_case (Python convention), and PascalCase. It operates on individual strings, dictionary keys, and class attributes, making it useful when bridging Python code with external APIs or data formats that use different naming standards.
The package provides standalone functions (to_snake, to_camel, to_pascal), dictionary converters (dict_to_snake, dict_to_camel, dict_to_pascal), decorators for automatic conversion on function return values, a base Converter class for adding conversion methods to custom classes, and an optional Pydantic integration (via the pydantic extra) that automatically handles case conversion in model serialization and deserialization.
Use it for:
- Parse JSON APIs that use camelCase keys into Python objects with snake_case attributes
- Convert Python dictionaries with snake_case keys to camelCase for JSON serialization to external services
- Decorate functions that return dictionaries to automatically normalize key naming conventions
- Build Pydantic models that accept camelCase input data and expose snake_case fields internally
- Create custom classes that serialize to camelCase while maintaining snake_case in Python code
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts strings and dictionary keys between camelCase, snake_case, and PascalCase formats, with optional decorator and Pydantic integration.
Yes. Zero runtime dependencies, permissive MIT license, active maintenance, and broad Python version support (3.10–3.14) make this a safe, low-friction addition. Install it when you need to bridge naming conventions between Python and external APIs or JSON data—the common case for web services and data integration work.
Install
camel-converter on PyPI
pip
pip install camel-converteruv
uv add camel-converterpoetry
poetry add camel-converterInstalling camel-converter
Before you install
Low friction install with no runtime dependencies. Actively maintained as of 2026-03-05, marked Production/Stable, and supports current Python versions from 3.10 through 3.14.
License in practice
MIT License permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install camel-converter
from camel_converter import to_snake, to_camel
snake = to_snake("myString") # 'my_string'
camel = to_camel("my_string") # 'myString'
Verify before relying
- Behavior when handling acronyms or consecutive uppercase letters (e.g., 'HTTPServer' → 'http_server' or 'h_t_t_p_server')
- Performance characteristics with deeply nested dictionaries or very large key sets
- Whether the optional Pydantic extra is compatible with Pydantic v2
Package facts
| License | MIT License Copyright (c) 2021 Paul Sanders Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 162 days since the last release |
| First released | |
| Downloads | 1,947,650/month — #3,414 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: camel_converter-5.1.0-py3-none-any.whl
Keywords: camel-case, converter, pydantic, python, snake-case
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
djangorestframework-camel-caseConverts JSON field names between camelCase and…
permissive · top 15,000 on PyPI
pyhumpsConverts strings and dictionary keys between…
permissive · top 5,000 on PyPI
case-convertConverts strings between different case formats…
copyleft · top 15,000 on PyPI
case-conversionConverts strings between any case format…
permissive · top 15,000 on PyPI
pyheckConverts strings between case styles…
permissive · top 15,000 on PyPI
stringcaseConverts strings between different naming…
permissive · top 5,000 on PyPI
jinja2-strcaseAdds string-case conversion filters to Jinja2…
permissive · top 15,000 on PyPI
boa-strConverts strings to snake_case by normalizing…
permissive · top 5,000 on PyPI
humpsConverts strings to camelCase format, handling…
copyleft · top 15,000 on PyPI
textcaseConverts strings between different text case…
permissive · top 15,000 on PyPI