skillfed

pyhumps

🐫 Convert strings (and dictionary keys) between snake case, camel case and pascal case in Python. Inspired by Humps for Node

pyhumps v3.8.0 7.1M downloads/30d#1,787 on PyPI356
Permissive license The Unlicense (Unlicense) DORMANT released

What it is and what it does

pyhumps is a lightweight string and dictionary-key case converter for Python. It transforms between snake_case, camelCase, PascalCase, and kebab-case, and provides checker functions to validate what case a string is already in. The package has no runtime dependencies and works across Python 3.6, 3.7, 3.8, 3.9, and 3.10 on both CPython and PyPy.

Typical use cases include normalizing API responses (e.g., converting camelCase JSON keys from external APIs into snake_case for Python code), preparing data for external services that expect a different naming convention, and validating or asserting the case of identifiers. The description includes a cookbook example of wrapping Boto3 to transparently convert between AWS API conventions and Pythonic naming.

Use it for:

  • Normalize camelCase JSON responses from REST APIs into snake_case Python dictionaries for idiomatic code.
  • Convert snake_case Python function arguments to camelCase before sending to external APIs or services.
  • Validate that configuration keys or identifiers conform to an expected naming convention.
  • Wrap third-party libraries to transparently convert between their naming conventions and yours.
  • Handle acronyms and abbreviations correctly when converting between cases (e.g., APIResponse → api_response).

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Converts strings and dictionary keys between snake_case, camelCase, PascalCase, and kebab-case, plus functions to check what case a string is in.

Yes. pyhumps is a stable, zero-dependency utility with no known vulnerabilities, permissive licensing, and broad Python version support. It solves a common data-transformation problem cleanly. The dormant maintenance status is acceptable for a mature utility that does one thing well; however, if you need active support or expect breaking changes in future Python versions, flag this for periodic review.

Install

pyhumps on PyPI

pip

pip install pyhumps

uv

uv add pyhumps

poetry

poetry add pyhumps

Installing pyhumps

Before you install

Low friction install with no runtime dependencies. Maintenance is dormant—last release was 2022-10-21 and last commit 2024-08-03—but the package remains available and stable.

License in practice

Licensed under The Unlicense (Unlicense), a permissive public-domain-equivalent license with no restrictions on use, modification, or distribution.

Quickstart

pip install pyhumps

import pyhumps

pyhumps.camelize("jack_in_the_box")  # jackInTheBox
pyhumps.decamelize("rubyTuesdays")  # ruby_tuesdays
pyhumps.pascalize("red_robin")  # RedRobin
pyhumps.kebabize("white_castle")  # white-castle

Verify before relying

  • Whether the dormant maintenance status (last release 2022-10-21) poses a risk for future Python version compatibility or edge-case bug fixes.
  • Support for Python versions beyond 3.10 given the last release date.

Package facts

License The Unlicense (Unlicense) (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance dormant — 1,393 days since the last release
Last repo commit
First released
Downloads 7,095,085/month — #1,787 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pyhumps-3.8.0-py3-none-any.whl

Keywords: humps, snakecase, convert case, camelcase

License :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Tags

string case conversionsnake case to camel casedictionary key case conversioncamelcase pascalcase snake casecase checker validatorstring naming conventionpython case formatter
case-conversionstring-formattingdata-normalization

More Utilities packages