• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1477
  • Last Modified:

JSON Serialization in Python

Hi,
Can someone give me a simple example how to use JSON serialization in Python?
0
jyotishb
Asked:
jyotishb
2 Solutions
 
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???
0
 
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...

http://www.djangoproject.com/documentation/serialization/

0
 
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?
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
mish33Commented:
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)
0
 
RichieHindleCommented:
There's a Python JSON library here that should be what you're looking for: http://cheeseshop.python.org/pypi/simplejson
0
 
RichieHindleCommented:
...and here are some examples of how to use simplejson: http://svn.red-bean.com/bob/simplejson/tags/simplejson-1.3/docs/index.html
0
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.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now