title: Get key values from a nested dictionary
body: <p>I'm trying to write a very simple, yet modular script to rename files.</p>
  
  <p>I would like to process the contents of a JSON file, however, I'm stuck at returning all the sub-values of a key(object?) not just one.</p>
  
  <p>My test code looks like this so far:</p>
  
  <pre><code>import json
  
  DB_dict = json.load(open("../source_code/db3.json", encoding='utf-8-sig'))
  old_names_of_Book1 = DB_dict["Book1"]["Book1_section1"]["old_name"]
  print(old_names_of_Book1)
  print("________________________")
  
  for key, values in DB_dict.items():
      print(key)
      print(values)
  </code></pre>
  
  <p>Contents of the imported db3.json:</p>
  
  <pre><code>{
    "Book1": {
      "Book1_section1": {
        "old_name": "Adventures of X1",
        "new_name": "Adventures of Y1"
      },
      "Book1_section2": {
        "old_name": "Adventures of X2",
        "new_name": "Adventures of Y2"
      },
      "Book1_section3": {
        "old_name": "Adventures of X3",
        "new_name": "Adventures of Y3"
      },
      "Book1_section4": {
        "old_name": "Adventures of X4",
        "new_name": "Adventures of Y4"
      }
    },
    "Book2": {
      "Book2_section1": {
        "old_name": "Adventures of X1",
        "new_name": "Adventures of Y1"
      },
      "Book2_section2": {
        "old_name": "Adventures of X2",
        "new_name": "Adventures of Y2"
      },
      "Book2_section3": {
        "old_name": "Adventures of X3",
        "new_name": "Adventures of Y3"
      },
      "Book2_section4": {
        "old_name": "Adventures of X4",
        "new_name": "Adventures of Y4"
      }
    }
  }
  </code></pre>
  
  <p>The Book1, Book2, Book<strong>x</strong> keys in the JSON file would be hard-coded in the script, as I'd like to rename different files based on the user input using branching statements. For example, if the user picks Book1, then rename each <code>old_name</code> value to <code>new_name</code>, but don't mind the number of occurrences of "sections".
  (The number of sections (<code>Book1_section1</code>) could change overtime, therefore, I want my script to iterate on each occurrence of sections.)</p>
  
  <p>My problem is that, I don't know how to ignore the <code>Book1_section1</code>, <code>Book1_section2</code>, etc... keys in my JSON and only parse their content. With </p>
  
  <pre><code>print(DB_dict["Book1"]["Book1_section1"]["old_name"])
  </code></pre>
  
  <p>I can get the value I want but I don't know how to get all the values.</p>