pyhumps is a Python library that converts strings and dictionary keys between various casing styles, including snake case, camel case, Pascal case, and kebab case. It is inspired by the Humps library for Node.js. The library is actively maintained, with its current version being 3.8.0, and receives regular updates.
pip install pyhumpsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates converting strings and dictionary keys between snake_case, camelCase, PascalCase, and kebab-case. It highlights the `camelize`, `pascalize`, and `kebabize` functions for both individual strings and lists of dictionaries.
Always install the correct package using `pip install pyhumps`. If you suspect you have the wrong package, uninstall `humps` and then install `pyhumps`.
Avoid naming your Python files or critical variables `humps.py` or `humps` to prevent import conflicts and ensure the correct library module is loaded.
First, ensure only `pyhumps` is installed (`pip install pyhumps`). If a previous `humps` package was installed, uninstall it (`pip uninstall humps`). Consider using a clean virtual environment. The correct import statement should be `import humps` after installing `pyhumps`.
Verify `pyhumps` is installed in your active environment (`pip list | grep pyhumps`). If using PyInstaller, add `--hidden-import humps` to your command to ensure the `humps` module (provided by the `pyhumps` package) is correctly bundled.
Ensure that the argument provided to the `pyhumps` function is a Python dictionary or a list of dictionaries. If your input data is a JSON string, first deserialize it into a Python dictionary using `json.loads()`.
No dependency data recorded yet.