title: Python 2.7 Recursive call on formatting dictionary key property
body: <p>I have a sample dictionary data.</p>
  
  <pre><code>obj = {  
      "company-name":"Name Test",
      "contact-name":"Test contact",
      "contact-phone":"1234567890",
      "contact-email":"test@example.com",
      "contact-notes":"Test Notes",
      "company-clients": {
          "client-name": "Test Client",
          "client-address": "Test Client address",
          "client-occupation": {
              "occupation-title": "Test occupation title",
              "occupation-salary": 600000
          }
      }
  } 
  </code></pre>
  
  <p>Now I need it to format all the property with a <code>-</code> and replace it with <code>_</code> instead so. This is the desireable output:</p>
  
  <pre><code>{  
      "company_name":"Name Test",
      "contact_name":"Test contact",
      "contact_phone":"1234567890",
      "contact_email":"test@example.com",
      "contact_notes":"Test Notes",
      "company_clients": {
          "client_name": "Test Client",
          "client_address": "Test Client address",
          "client_occupation": {
              "occupation_title": "Test occupation title",
              "occupation_salary": 600000
          }
      }
  } 
  </code></pre>
  
  <p>So far here is what i tried:</p>
  
  <pre><code>def recursive_formatting(key, value):
      if not isinstance(value, dict):
          return key.replace('-', '_'), value
      else:
          for k, v in value.items():
              _k, _v = recursive_formatting(k, v)
              return _k, _v
  </code></pre>
  
  <p><strong>USAGE</strong></p>
  
  <pre><code>data = {}
  for key, value in obj.items():
      k, v = recursive_formatting(key, value)
      data[k] = v
  
  print data
  </code></pre>
  
  <p>But the code doesn't do a nested formatting only at the root level of the object properties is formatted/changed.</p>
  
  <p>This is what i get:</p>
  
  <pre><code>{  
      "company_name":"Name Test",
      "contact_name":"Test contact",
      "contact_phone":"1234567890",
      "contact_email":"test@example.com",
      "contact_notes":"Test Notes"
  }
  </code></pre>