Skip to content

Instantly share code, notes, and snippets.

  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mager/1023638 to your computer and use it in GitHub Desktop.
>>> import simplegeo
>>> client = simplegeo.Client('your-oauth-token', 'your-oauth-secret')
>>> handle = 'SG_3ckjlXmAXOR2XjpuJQ0p7E' # India
>>> annotations = {
... 'country_codes':
... {
... 'alpha-2': 'IN',
... 'alpha-3': 'IND',
... 'numeric': '356',
... 'ISO 3166-2': 'ISO 3166-2:IN'
... }
... }
>>> print client.annotate(handle, annotations, private=False)
{'status': 'success'}
>>> print client.get_annotations(handle)
{'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