---
title: "Discussion on \"Convert Keys in Json to Snake Case\" | Hashnode"
description: "Discussion on \"Convert Keys in Json to Snake Case\". import re\n\ndef convert_to_snakecase(original_dict):\n\n    transformed_dict = {}\n    array_items = []\n    if not isinstance(original_dict, list):\n      for k in original_dict.keys():\n          value = re.sub(r'(?<!^)(?=[A-Z])', '_', k).lower()\n        ..."
url: "https://hashnode.com/posts/convert-keys-in-json-to-snake-case/61e66f45f6d40b3391ad6f04"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Convert Keys in Json to Snake Case](https://blog.santhoshthomas.xyz/convert-keys-in-json-to-snake-case?utm_source=hashnode&utm_medium=feed)

import re def convert\_to\_snakecase(original\_dict): transformed\_dict = {} array\_items = \[\] if not isinstance(original\_dict, list): for k in original\_dict.keys(): value = re.sub(r'(?<!^)(?=\[A-Z\])', '\_', k).lower() ...

Jan 18, 2022 · 1 min read · blog.santhoshthomas.xyz  
Updated Feb 11, 2022  
Read the article

-   [#python](https://hashnode.com/tag/python)
-   [#json](https://hashnode.com/tag/json)
-   [#python3](https://hashnode.com/tag/python3)
-   [#python-beginner](https://hashnode.com/tag/python-beginner)

## Written by

[Santhosh Thomas](https://hashnode.com/@santhoshthomas)

@santhoshthomas · Kerala, India

  
[View profile](https://hashnode.com/@santhoshthomas)

Senior Software Engineer

A design-minded front-end software engineer focused on building beautiful interfaces &amp; experiences

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
