• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1468
  • 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
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
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

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

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