Forked from aguynamedben/simplegeo-python-annotations.py
Created
June 13, 2011 20:40
-
-
Save mager/1023638 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> 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