I'm trying to export a list of github issues from a repository to csv, but i keep coming across a few errors. I've tried looking into it on other questions but they didn't seem to help me out. I'm currently using python2.7.9 on SLES12 vm.
def write_issues(response):
for issue in response.json():
labels = issue['labels']
for label in labels:
if label['name'] == "Client Requested":
csvout.writerow([issue['number'],
issue['title'].encode('utf-8'),
issue['body'].encode('utf-8'),
issue['created_at'],
issue['updated_at']])
getting these errors
Traceback (most recent call last):
File "export.py", line 50, in <module>
write_issues(r)
File "export.py", line 24, in write_issues
labels = issue['labels']
TypeError: string indices must be integers