please help me how to check the validity of the json object


if suppose the example of the JSON is as

({type:'AAU', msgid:1265033798233, sel:0, gadinfo:[{
adid:316,adprt:40.0,dur:10,ef:'2009/06/03 10:00:00',et:'2012/06/03 12:00:00',imgfurl:'vaccumcleaner_h.jpg'
}]})


SO I want a script in python which would give me the validity of the object as the output by taking the json object as the input.

I tried json module in python but I could'nt fetch the required result..

Thanks in advance.

Recommended Answers

All 3 Replies

You may have to give us more detail about JSON and the json module.

Json in a format used for communication purpose i.e to transfer data.
It is lightweight data format.

In python there is json module but there I am not able to know abt the exact method to the check the validation..

Thanks for the info! It appears that module json is new since Python version 2.6. I will have to explore it with Python 3.1.1, to see if I can figure out a way to validate. Also noticed that FireFox is using the .json format for backup bookmarks.

You may want to take a look at tool.py in library directory json

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.