{"id":1867,"library":"pyhumps","title":"pyhumps","description":"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.","status":"active","version":"3.8.0","language":"en","source_language":"en","source_url":"https://github.com/nficano/humps","tags":["case conversion","string utilities","camelcase","snakecase","pascalcase","kebab-case","dictionaries"],"install":[{"cmd":"pip install pyhumps","lang":"bash","label":"Install with pip"}],"dependencies":[],"imports":[{"note":"The PyPI package name is `pyhumps`, but the module is imported as `humps`. Installing a package named `humps` (an older, unrelated project) instead of `pyhumps` will lead to an `AttributeError` when trying to use functions like `humps.camelize` from the expected library. Always ensure you install `pyhumps`.","wrong":"import humps # after 'pip install humps'","symbol":"humps","correct":"import humps"}],"quickstart":{"code":"import humps\n\nsnake_case_string = \"hello_world_example\"\ncamel_case_string = humps.camelize(snake_case_string)\npascal_case_string = humps.pascalize(snake_case_string)\nkebab_case_string = humps.kebabize(snake_case_string)\n\ndata = [\n    {\"first_name\": \"John\", \"last_name\": \"Doe\"},\n    {\"first_name\": \"Jane\", \"last_name\": \"Smith\"}\n]\ncamelized_data = humps.camelize(data)\n\nprint(f\"Original snake_case: {snake_case_string}\")\nprint(f\"Camel case: {camel_case_string}\")\nprint(f\"Pascal case: {pascal_case_string}\")\nprint(f\"Kebab case: {kebab_case_string}\")\nprint(f\"Camelized dictionary keys: {camelized_data}\")","lang":"python","description":"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."},"warnings":[{"fix":"Always install the correct package using `pip install pyhumps`. If you suspect you have the wrong package, uninstall `humps` and then install `pyhumps`.","message":"Installing the wrong package: There is an older, unrelated PyPI package also named `humps`. If you install `humps` instead of `pyhumps`, you will get a different, unmaintained library. This will likely result in `AttributeError` when attempting to use functions like `camelize` or `decamelize` from the `pyhumps` API, as they won't exist in the incorrectly installed `humps` module.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Avoid naming your Python files or critical variables `humps.py` or `humps` to prevent import conflicts and ensure the correct library module is loaded.","message":"Shadowing the `humps` module: If you create a Python file named `humps.py` in your project or name a variable `humps`, it can shadow the installed `humps` module. This will cause Python to import your local file/variable instead of the library, leading to unexpected errors or `AttributeError`s.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}