json
HTTP requests and JSON parsing in Python
I want to dynamically query Google Maps through the Google Directions API. As an example, this request calculates the route from Chicago, IL to Los Angeles, CA via two waypoints in Joplin, MO and Oklahoma City, OK:
How to JSON serialize sets?
I have a Python set that contains objects with __hash__ and __eq__ methods in order to make certain no duplicates are included in the collection.
Converting dictionary to JSON
r = {'is_claimed': 'True', 'rating': 3.5} r = json.dumps(r) file.write(str(r['rating'])) I am not able to access my data in the JSON. What am I doing wrong? TypeError: string indices must be integers, not str Answers: Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve … Read more
Converting JSON String to Dictionary Not List
I am trying to pass in a JSON file and convert the data into a dictionary.
Python: json.loads returns items prefixing with ‘u’
I’ll be receiving a JSON encoded string form Obj-C, and I am decoding a dummy string (for now) like the code below. My output comes out with character ‘u’ prefixing each item:
Serializing class instance to JSON
I am trying to create a JSON string representation of a class instance and having difficulty. Let’s say the class is built like this:
What are the differences between json and simplejson Python modules?
I have seen many projects using simplejson module instead of json module from the Standard Library. Also, there are many different simplejson modules. Why would use these alternatives, instead of the one in the Standard Library?
How to convert raw javascript object to a dictionary?
When screen-scraping some website, I extract data from <script> tags.
The data I get is not in standard JSON format. I cannot use json.loads().
json.dumps vs flask.jsonify
I am not sure I understand the purpose of the flask.jsonify method. I try to make a JSON string from this: