title: How do I replace the key in a JSON file?
body: <p>Could you please tell me how can I replace the <code>key</code> in a <code>JSON file</code>?</p>
  <p>JSON file structure:</p>
  <pre><code>[
     {
        &quot;id&quot; : &quot;365&quot;,
        &quot;credits&quot; : [ {
          &quot;login&quot; : &quot;user1&quot;,
          &quot;password&quot; : &quot;pa$$w0rd&quot;
        } ]
      }, {
        &quot;id&quot; : &quot;366&quot;,
        &quot;credits&quot; : [ {
          &quot;Login&quot; : &quot;user2&quot;,
          &quot;password&quot; : &quot;pa$$w0rd&quot;
        } ]
      }
  ]
  </code></pre>
  <p>it is necessary that the <code>login</code> key be of the same type, i.e. with one <code>register</code> throughout the document, all <code>Login</code> keys become <code>login</code>.</p>
  <p>This is necessary for further analysis and downloading of information from the <code>JSON file</code>.</p>
  <pre><code>with open (&quot;test.json&quot;, &quot;r&quot;) as read_file_json:
      data_json = json.load(read_file_json)
      for n in range(len(data_json)):
          id = (data_json[n]['id'])
          id = str(id)
          for credits in data_json[n][&quot;credits&quot;]:
              login = credits[&quot;login&quot;]
  </code></pre>
  <p>Thank you very much!</p>