Parsing JSON to CSV with Python - AttributeError: 'str' object has no attribute 'keys'
<p>This JSON to CSV code example is working great:</p>

<pre><code>employee_data = '{"info":[{"employee_name": "James", "email": "james@gmail.com", "job_profile": "Sr. Developer"},{"employee_name": "Smith", "email": "Smith@gmail.com", "job_profile": "Project Lead"}]}'

#This can be parsed and converted to CSV using python as shown below:
import json
import csv

employee_parsed = json.loads(employee_data)

emp_data = employee_parsed['info']

# open a file for writing

employ_data = open('Employee.csv', 'w')

# create the csv writer object

csvwriter = csv.writer(employ_data)

count = 0

for emp in emp_data:

      if count == 0:

             header = emp.keys()

             csvwriter.writerow([header])

             count += 1

      csvwriter.writerow([emp.values()])

employ_data.close()
</code></pre>

<p>My trouble comes in when I'm trying to use the following JSON data below...</p>

<p>I get an AttributeError: 'str' object has no attribute 'keys'.  Please keep your response simple as this is my Python "Hello World". :-)</p>

<pre><code>employee_data = '{"info": {"arch": "x86_64","platform": "linux"},"packages": {"_license-1.1-py27_0.tar.bz2": {"build": "py27_0","build_number": 0,"date": "2013-03-01","depends": ["python 2.7*"],"license": "proprietary - Continuum Analytics, Inc.","license_family": "Proprietary","md5": "5b13c8cd498ce15b76371ed85278e3a4","name": "_license","requires": [],"size": 194947,"version": "1.1"}}}'
</code></pre>

<p>Thank you for any direction on this.</p>