Skip to content

Instantly share code, notes, and snippets.

@johnboxall
Created January 26, 2009 00:48
Show Gist options
  • Save johnboxall/52639 to your computer and use it in GitHub Desktop.
Save johnboxall/52639 to your computer and use it in GitHub Desktop.
# Official API:
>>> import api
>>> DA = api.DaApi()
>>> tree = DA.getTreeFromFile('DeviceAtlas.json') # What the juice?
>>> ua = 'SonyEricssonW850i/R1GB Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1'
>>> DA.getProperties(tree, ua)
{u'gprs': '1', u'mpeg4': '1', u'drmOmaForwardLock': '1', ...
# Awesome API:
>>> from deviceatlas import DeviceAtlas
>>> DA = DeviceAtlas(''DeviceAtlas.json')
>>> ua = 'SonyEricssonW850i/R1GB Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1'
>>> DA.device(ua)
{u'gprs': '1', u'mpeg4': '1', u'drmOmaForwardLock': '1', ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment