JSON Serialization in Python

Can someone give me a simple example how to use JSON serialization in Python?
Who is Participating?
mish33Connect With a Mentor Commented:
You have an example from http://www.djangoproject.com/documentation/serialization/#serialization-formats:

json_serializer = serializers.get_serializer("json")
json_serializer.serialize(queryset, ensure_ascii=False, stream=response)
ramromconsultant Commented:
If the silence continues it is probably due to the fact that we don't know what the question means. Of course if one of us does know then you are in luck. I Googled "JSON Serialization" so I at least now know what JSON is, but serialization???
jyotishbAuthor Commented:
well, JSON is a serialization  format, now if u ask me what does serialization means, then i guess i m asking the question in a wrong place .. :)
look here...


Build your data science skills into a career

Are you ready to take your data science career to the next step, or break into data science? With Springboard’s Data Science Career Track, you’ll master data science topics, have personalized career guidance, weekly calls with a data science expert, and a job guarantee.

ramromconsultant Commented:
So serialization is converting some data structure(s) to an ascii stream for transmission / storage. Similar to pickling or marshalling. JSON is a language with representations of dictionaries and lists almost identical to Python's represention of lists and dictionaries. JSON serializations is used e.g. by AJAX. Are we on the same page so far?

Are you looking for a 3rd party module/package that can be used from Python to perform this serialization?
RichieHindleConnect With a Mentor Commented:
There's a Python JSON library here that should be what you're looking for: http://cheeseshop.python.org/pypi/simplejson
...and here are some examples of how to use simplejson: http://svn.red-bean.com/bob/simplejson/tags/simplejson-1.3/docs/index.html
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.