Registry / serialization / humps
library0.2.2pypypi✓ verified 79d ago

humps is a Python library for converting strings between camelCase, snake_case, PascalCase, and other cases. The current version is 0.2.2. It has a low release cadence; the last release was in 2017.

pip install humps
INSTALL
IMPORT
SIG · HUMPS
H
humps
serializationpythonv0.2.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

camelize
import humps
from humps import camelize

Basic usage: convert strings between cases.

from humps import camelize, decamelize, pascalize # Convert snake_case to camelCase print(camelize('hello_world')) # 'helloWorld' # Convert camelCase to snake_case print(decamelize('helloWorld')) # 'hello_world' # Convert snake_case to PascalCase print(pascalize('hello_world')) # 'HelloWorld'
Debug
Known issues
gotchahumps only works on single strings, not on dict keys or nested structures. Use humps.main.convert for dict conversion.
fix
For dict conversion, use humps.camelize or see the main module. Note that automatic dict key conversion is limited.
affects: >=0.1.0
gotchahumps does not preserve leading or trailing underscores in snake_case conversion (e.g., '_private' becomes 'Private').
fix
Manually handle underscore preservation if needed.
affects: >=0.1.0
deprecatedThe old import path 'from humps.camel import case' is deprecated since v0.2.2.
fix
Use 'from humps import camelize' instead.
affects: >=0.2.2
Upgrade
Version history
0.2.2latest on PyPI · released Mar 13, 2018
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
humps — pip install humps · libregistry