@KA The result does not seem to be directly serializable to JSON. I found a library JSONS that can do the heavy lifting if you are using python 3.5 or higher.
Install jsons
pip install jsons
Import JSONS and using jsons.dump() on docs object.
import jsons #import in the import section
print(jsons.dump(docs)) #Printing the json after docs is created
This should give a file of this format in this case. Uploaded the file in .txt format since JSON files cannot be uploaded on Q&A, download the file and rename it to .json
I hope this helps!!
If an answer is helpful, please click on or upvote
which might help other community members reading this thread.