{"id":13725227,"url":"https://github.com/nficano/humps","last_synced_at":"2025-05-15T00:11:48.668Z","repository":{"id":35072162,"uuid":"152998339","full_name":"nficano/humps","owner":"nficano","description":"Convert strings (and dictionary keys) between snake case, camel case and pascal case in Python. Inspired by Humps for Node","archived":false,"fork":false,"pushed_at":"2024-08-03T00:43:05.000Z","size":5131,"stargazers_count":338,"open_issues_count":13,"forks_count":33,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-03T08:07:08.163Z","etag":null,"topics":["camelcase-to-snakecase","pascal","python3","snakecase"],"latest_commit_sha":null,"homepage":"http://humps.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nficano.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-14T17:08:13.000Z","updated_at":"2025-03-31T23:26:28.000Z","dependencies_parsed_at":"2024-05-15T11:30:39.946Z","dependency_job_id":"f1af26e9-1dbc-4775-a81d-859f755d5ed0","html_url":"https://github.com/nficano/humps","commit_stats":{"total_commits":309,"total_committers":24,"mean_commits":12.875,"dds":0.3268608414239482,"last_synced_commit":"16428e408a94ee90d81edc5eae00683698e69988"},"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nficano%2Fhumps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nficano%2Fhumps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nficano%2Fhumps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nficano%2Fhumps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nficano","download_url":"https://codeload.github.com/nficano/humps/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248354355,"owners_count":21089799,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["camelcase-to-snakecase","pascal","python3","snakecase"],"created_at":"2024-08-03T01:02:16.333Z","updated_at":"2025-04-11T06:29:09.664Z","avatar_url":"https://github.com/nficano.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/nficano/humps/master/artwork/humps.png\" alt=\"Humps logo\" width=\"245\" height=\"118\"\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"http://humps.readthedocs.io/en/latest/?badge=latest\"\u003e\n    \u003cimg src=\"https://readthedocs.org/projects/humps/badge/?version=latest\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://coveralls.io/github/nficano/humps?branch=master\"\u003e\n    \u003cimg src=\"https://coveralls.io/repos/github/nficano/humps/badge.svg?branch=master#cachebus\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://pypi.org/project/pyhumps/\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/v/pyhumps.svg#cachebust\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://pypi.org/project/pyhumps/\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/dm/pyhumps.svg\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://pypi.python.org/pypi/pyhumps/\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/pyversions/pyhumps.svg\" /\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\u003c/p\u003e\n\nConvert strings (and dictionary keys) between snake case, camel case and pascal case in Python. Inspired by [Humps](https://github.com/domchristie/humps) for Node.\n\n## Installation\n\nTo install humps, simply use pipenv (or pip, of course):\n\n```bash\n$ pipenv install pyhumps\n```\n\n## Usage\n\n### Converting strings\n\n```python\nimport humps\n\nhumps.camelize(\"jack_in_the_box\")  # jackInTheBox\nhumps.decamelize(\"rubyTuesdays\")  # ruby_tuesdays\nhumps.pascalize(\"red_robin\")  # RedRobin\nhumps.kebabize(\"white_castle\")  # white-castle\n```\n\n### Converting dictionary keys\n\n```python\nimport humps\n\narray = [{\"attrOne\": \"foo\"}, {\"attrOne\": \"bar\"}]\nhumps.decamelize(array) # [{\"attr_one\": \"foo\"}, {\"attr_one\": \"bar\"}]\n\narray = [{\"attr_one\": \"foo\"}, {\"attr_one\": \"bar\"}]\nhumps.camelize(array)  # [{\"attrOne\": \"foo\"}, {\"attrOne\": \"bar\"}]\n\narray = [{'attr_one': 'foo'}, {'attr_one': 'bar'}]\nhumps.kebabize(array)  # [{'attr-one': 'foo'}, {'attr-one': 'bar'}]\n\narray = [{\"attr_one\": \"foo\"}, {\"attr_one\": \"bar\"}]\nhumps.pascalize(array)  # [{\"AttrOne\": \"foo\"}, {\"AttrOne\": \"bar\"}]\n```\n\n### Checking character casing\n\n```python\nimport humps\n\nhumps.is_camelcase(\"illWearYourGranddadsClothes\")  # True\nhumps.is_pascalcase(\"ILookIncredible\")  # True\nhumps.is_snakecase(\"im_in_this_big_ass_coat\")  # True\nhumps.is_kebabcase('from-that-thrift-shop')  # True\nhumps.is_camelcase(\"down_the_road\")  # False\n\nhumps.is_snakecase(\"imGonnaPopSomeTags\")  # False\nhumps.is_kebabcase('only_got_twenty_dollars_in_my_pocket')  # False\n\n\n# what about abbrevations, acronyms, and initialisms? No problem!\nhumps.decamelize(\"APIResponse\")  # api_response\n```\n\n\u003chr\u003e\n\n## Cookbook\n\n#### Pythonic Boto3 API Wrapper\n\n```python\n# aws.py\nimport humps\nimport boto3\n\ndef api(service, decamelize=True, *args, **kwargs):\n    service, func = service.split(\":\")\n    client = boto3.client(service)\n    kwargs = humps.pascalize(kwargs)\n    response = getattr(client, func)(*args, **kwargs)\n    return (depascalize(response) if decamelize else response)\n\n# usage\napi(\"s3:download_file\", bucket=\"bucket\", key=\"hello.png\", filename=\"hello.png\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnficano%2Fhumps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnficano%2Fhumps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnficano%2Fhumps/lists"}