Skip to content

Instantly share code, notes, and snippets.

@mager
Created February 16, 2011 23:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mager/830557 to your computer and use it in GitHub Desktop.
Save mager/830557 to your computer and use it in GitHub Desktop.
>>> import simplegeo.shared, simplegeo.places
>>> annotations = {
... 'country_codes':
... {
... 'alpha-2': 'IN',
... 'alpha-3': 'IND',
... 'numeric': '356',
... 'ISO 3166-2': 'ISO 3166-2:IN'
... }
... }
>>> feature = 'SG_3ckjlXmAXOR2XjpuJQ0p7E' # India
>>> client = simplegeo.places.Client('your-oauth-token', 'your-oauth-secret')
>>> print client.annotate(feature, annotations, private=True)
{'status': 'success'}
>>> print client.get_annotations(feature)
{'public': {'country_codes': {'ISO 3166-2': 'ISO 3166-2:IN', 'alpha-2': 'IN','numeric': '356', 'alpha-3': 'IND'}}, 'private': {}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment