# case conversion question

**URL:** <https://forum.ansible.com/t/case-conversion-question/21690>\
**Category:** Ansible Developer\
**Created:** [June 7, 2016, 4:53pm UTC](https://forum.ansible.com/t/case-conversion-question/21690 "2016-06-07T16:53:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim1](https://avatars.discourse-cdn.com/v4/letter/t/b782af/32.png) [@Tim1](https://forum.ansible.com/u/Tim1)\
**Post date:** [June 7, 2016, 4:53pm UTC](https://forum.ansible.com/t/case-conversion-question/21690/1 "2016-06-07T16:53:45Z")

</div>

hey folks,

I’m making a module, and have a REST api that I’m working with that returns all its values in camelCase and I wanted to return them in a module to my end users in the snake\_case that ansible uses.

I was wondering if Ansible came with a utility method to do this, or if I should back my own?

Thanks,  
tim

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [June 7, 2016, 7:14pm UTC](https://forum.ansible.com/t/case-conversion-question/21690/2 "2016-06-07T19:14:29Z")

</div>

The ec2 module\_utils have a function called camel\_dict\_to\_snake\_dict

If you are using Ansible 2.1, modules can import specific things from module\_utils, so you could use:

from ansible.module\_utils.ec2 import camel\_dict\_to\_snake\_dict

Not sure if there is anything to be cautious of, but it may work for you.
