skillfed

camel-converter

Converts a string from snake case to camel case or camel case to snake case

camel-converter v5.1.0 1.9M downloads/30d#3,414 on PyPI
Permissive 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) Active released

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

uv

uv add camel-converter

poetry

poetry add camel-converter

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Typing :: Typed

Tags

camel case to snake case convertersnake case to camel casejson key naming conventioncase conversion utilitiesdictionary key transformationpydantic camel casestring case conversion
json-interopnaming-conventions

More Utilities packages