A couple of Google Data services have recently added support for a
new, more compact, JSON based format which I think this library should
support. Here's a recent announcement on the YouTube API blog for more
details:
http://apiblog.youtube.com/2010/02/new-format-for-json-results.html
There are a few ways that this format could be handled, but one
approach that I like is a new class which wraps a simplejson style
dict and allows access to members as follows:
x.data.items[0].favorite_count
Also this class supports the more typical simplejson style access
pattern. So you could also do:
x['data']['items'][0]['favoriteCount']
Here's my implementation:
Please let me know what you think. Is this easy to use? Too much
magic? Would you rather just use the simplejson/json module?
Thank you,
Jeff
On Feb 9, 4:42 pm, Jeff S <j...@google.com> wrote:
> Hi all,
>
> A couple of Google Data services have recently added support for a
> new, more compact, JSON based format which I think this library should
> support. Here's a recent announcement on the YouTube API blog for more
> details:
>
> http://apiblog.youtube.com/2010/02/new-format-for-json-results.html
>
> There are a few ways that this format could be handled, but one
> approach that I like is a new class which wraps a simplejson style
> dict and allows access to members as follows:
>
> x.data.items[0].favorite_count
>
> Also this class supports the more typical simplejson style access
> pattern. So you could also do:
>
> x['data']['items'][0]['favoriteCount']
>
> Here's my implementation:
>
> http://gdata-python-client-library-contributors.googlegroups.com/web/...
-Jeff