Hello @rajniali and welcome to the community!
I hope you like it here 💪
I do not have experience with Python, but you might be able to find some useful information by searching for the posts related to Python in the community.
Hope you find what you are looking for 🙂
Cheers,
Matias
Hi,
I think the Python json functionality is broken, what is returned fails json formatting tests. It’s also mentioned in another post on here with the same error I see.
Best Regards,
Delos
Quite late to this thread, but I’ve found that running python vars through json.dumps usually fixes the main formatting issues
I’m going to see if I can help a little bit, and also hoping someone else may be to help me in return. I ran a “simple” query and then was able to parse the json dictionary values. This resulted in a nice pandas dataframe.
Step #2 for me is to replicate the “full” query like the OP did for a full board query in an attempt to get all the data nicely formatted in rows & columns.
Here is my simple query, with json parse code:
Setup the query we want to run:
query = ‘{ boards (limit:5) {name id} }’
data = {‘query’ : query}
Run the desired query:
r = requests.post(url=apiUrl, json=data, headers=headers) # makes request
Set the result dictionary to a variable:
json_data = r.json()
Extract key-value pairs from the nested dictionary
data_frame =
for board in json_datab‘data’] ‘boards’]:
data_frame.append({‘Board_Name’: boardp‘name’], ‘Board_Id_Num’: board‘id’]})
Convert the key-value pairs to a DataFrame
df = pd.DataFrame(data_frame)
View the DataFrame
print(df)
Sorry, some of that did not format nicely because of HTML. Will try and screenshot the parsing.
