{"id":16652885,"url":"https://github.com/zerointensity/snakedict","last_synced_at":"2026-04-29T05:38:24.856Z","repository":{"id":107060798,"uuid":"515629122","full_name":"ZeroIntensity/snakedict","owner":"ZeroIntensity","description":"Keep your dict keys PEP 8 compliant.","archived":false,"fork":false,"pushed_at":"2022-07-19T15:08:55.000Z","size":8,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-10T14:50:17.739Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pypi.org/project/snakedict","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ZeroIntensity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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":"2022-07-19T14:55:27.000Z","updated_at":"2024-11-07T00:11:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"be93dee1-b3d7-4c48-9e85-d1dfa8e6f505","html_url":"https://github.com/ZeroIntensity/snakedict","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZeroIntensity%2Fsnakedict","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZeroIntensity%2Fsnakedict/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZeroIntensity%2Fsnakedict/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZeroIntensity%2Fsnakedict/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZeroIntensity","download_url":"https://codeload.github.com/ZeroIntensity/snakedict/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243257381,"owners_count":20262290,"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":[],"created_at":"2024-10-12T09:30:19.104Z","updated_at":"2025-12-27T08:29:57.876Z","avatar_url":"https://github.com/ZeroIntensity.png","language":"Python","readme":"# Snake Dict\n\n## Keep your dictionary keys PEP 8 compliant\n\n### Quick Example\n\n```py\nfrom snakedict import convert\n\nmy_dict = {\n    \"helloWorld\": \"test\",\n    \"thisIsCamelCase\": \"hello\",\n    \"this_is_snake_case\": \"world\",\n}\n\nmy_dict = convert(a)\nprint(my_dict[\"hello_world\"])  # test\n```\n\n### Installation\n\n#### Linux/macOS\n\n```\npython3 -m pip install -U snakedict\n```\n\n#### Windows\n\n```\npy -3 -m pip install -U snakedict\n```\n\n### Usage\n\nThere are 2 main functions, `convert` and `auto`.\n\n`convert` does what was shown above, it takes in a dictionary and converts keys that are in camelCase to snake_case:\n\n```py\nfrom snakedict import convert\n\nmy_dict = {\n    \"something\": \"test\",\n    (1, 2, 3): \"hello\"  # you can use any key you want, snakedict won't touch it unless its in camelcase\n}\n\nprint(convert(my_dict))  # no camelcase found, nothing happens\n```\n\nOn the other hand, `auto` is a decorator that converts the response to snake case:\n\n```py\nfrom snakedict import auto\n\n@auto()\ndef fetch_something():\n    return {  # lets pretend this is a call to some api\n        \"accountName\": \"someone1234\",\n        \"joinDate\": \"7/19/22\",\n    }\n\nprint(fetch_something()[\"account_name\"])\n\n```\n\n`auto` has a parameter called `execute_maybe` that won't call `convert` if the response wasn't a `dict`:\n\nIf you want an error to be raised if the function returns `None`, set it to `False`:\n\n```py\n@auto(execute_maybe = False)\ndef fetch_something():\n    return None\n\nfetch_something()  # TypeError!\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzerointensity%2Fsnakedict","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzerointensity%2Fsnakedict","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzerointensity%2Fsnakedict/lists"}