{"id":4466,"library":"case-conversion","title":"Case Conversion Library","description":"The `case-conversion` library for Python, currently at version 3.0.2, provides a robust, dependency-free solution for converting strings between various case styles such as camelCase, PascalCase, snake_case, kebab-case, and more. It offers automatic case detection, advanced acronym handling, and full Unicode support, making non-ASCII characters first-class citizens. The library is actively maintained and supports Python 3.10 and newer.","status":"active","version":"3.0.2","language":"en","source_language":"en","source_url":"https://github.com/AlejandroFrias/case-conversion","tags":["string","case conversion","camelCase","snake_case","kebab-case","unicode"],"install":[{"cmd":"pip install case-conversion","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"note":"Import the main Converter class for object-oriented usage.","symbol":"Converter","correct":"from case_conversion import Converter"},{"note":"Individual case conversion functions are available directly from the package for convenience.","symbol":"Top-level functions (e.g., camel, snake)","correct":"import case_conversion\ncase_conversion.camel(\"some string\")"}],"quickstart":{"code":"from case_conversion import Converter\n\n# Using the Converter class\nconverter = Converter()\ncamel_case_string = converter.camel(\"FOO_BAR_STRING\")\npascal_case_string = converter.pascal(\"another string\")\n\nprint(f\"Camel Case: {camel_case_string}\")\nprint(f\"Pascal Case: {pascal_case_string}\")\n\n# Using top-level convenience functions\nimport case_conversion\n\nsnake_case_string = case_conversion.snake(\"Hello World Example\")\nkebab_case_string = case_conversion.kebab(\"http header case\")\n\nprint(f\"Snake Case: {snake_case_string}\")\nprint(f\"Kebab Case: {kebab_case_string}\")\n\n# Custom acronym handling\ncustom_acronym_converter = Converter(acronyms=[\"BAD\", \"HTTP\"])\ncustom_acronym_snake = custom_acronym_converter.snake(\"fooBADHTTPError\")\nprint(f\"Custom Acronym Snake Case: {custom_acronym_snake}\")\n\n# Unicode support\nunicode_snake = case_conversion.snake(\"fóó-bar-string\")\nprint(f\"Unicode Snake Case: {unicode_snake}\")","lang":"python","description":"This quickstart demonstrates both the `Converter` class and the convenience functions for various case conversions, including basic usage, custom acronym handling, and Unicode support."},"warnings":[{"fix":"Upgrade your Python environment to 3.10 or newer.","message":"The library explicitly requires Python 3.10 or higher. Users on older Python 3 versions (e.g., 3.9 or earlier) will encounter installation or runtime errors.","severity":"breaking","affected_versions":"<3.10"},{"fix":"When initializing the `Converter` class or calling a top-level function, provide a list of expected acronyms (e.g., `Converter(acronyms=['BAD', 'HTTP'])`).","message":"While the library features automatic acronym detection, for complex or unusual sequences of capital letters (e.g., 'fooBADHTTPError'), the default behavior might not split them as desired. Custom acronyms can be provided during initialization to ensure correct parsing.","severity":"gotcha","affected_versions":"All"},{"fix":"Test with diverse input strings, especially those with mixed cases, numbers, or unusual separators, to ensure the output matches expectations. Adjust input or use explicit tokenization if available (though not explicitly exposed in the API).","message":"The library offers 'auto-detection' of the input case, which is a powerful feature. However, for highly ambiguous or unconventional input strings, the detected word boundaries might not perfectly align with every user's specific interpretation. Always verify the output for edge cases.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}