Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trouble creating outline for python api results #35

Open
vtischuk opened this issue Aug 15, 2017 · 0 comments
Open

trouble creating outline for python api results #35

vtischuk opened this issue Aug 15, 2017 · 0 comments

Comments

@vtischuk
Copy link

testfile_outline.txt
Hi,

I am using python with the workfront api to return JSON objects (theoretically) like the sample below and am trying to create an outline from either the python results object of from a file that I wrote the results to but I haven't been able to sucessfully generate a results file.

Using this command 👍 python gen_outline.py --collection nodes C:\Python27\resultsj.txt -o C:\Python27\testfile_outlinej.json

produces this
Traceback (most recent call last):
File "gen_outline.py", line 85, in
main()
File "gen_outline.py", line 75, in main
outline = make_outline(args.json_file, args.each_line, args.collection)
File "gen_outline.py", line 50, in make_outline
key_map = gather_key_map(iterator)
File "gen_outline.py", line 31, in gather_key_map
for d in iterator:
File "gen_outline.py", line 26, in coll_iter
for obj in data[coll_key]:
KeyError: 'nodes'


Using this command produces that attached outline file, that when run with json2csv produces a file of headers and 'no data'.

python gen_outline.py --each-line C:\Python27\resultsj.txt -o C:\Python27\testfile_outline.json



Your suggestions would be appreciated. Thanks, Victor

sample json line:

[{u'status': u'CPL', u'name': u'H557 Nano Valve Operator', u'plannedStartDate': u'2014-04-01T08:00:00:000-0400', u'objCode': u'PROJ', u'priority': 0, u'percentComplete': 100.0, u'projectedCompletionDate': u'2015-06-01T07:42:38:615-0400', u'ID': u'52ceb3a1001da497df97a63c7e99d6c8', u'plannedCompletionDate': u'2015-06-01T17:00:00:000-0400'} ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant