This fork uses UltraJSON, gevent and geventhttpclient but doesn't support OAUTH yet
The cartodb-python project is a Python client for the CartoDB SQL API that supports authentication using OAuth.
Clone the repository by using:
git clone [email protected]:yoinup/cartodb-python.git
And them, move to dir and install it in your virtualenv
python setup.py install
The following example requires your CartoDB API consumer key and consumer secret or the API KEY. Refer to the CartoDB Authentication documentation for details.
You can get you api key in https://YOUR_USER.cartodb.com/your_apps/api_key
from cartodb import CartoDBAPIKey
user = '[email protected]'
API_KEY ='YOUR_CARTODB_API_KEY'
cartodb_domain = 'YOUR_CARTODB_DOMAIN'
cl = CartoDBAPIKey(API_KEY, cartodb_domain)
try:
print cl.sql('select * from mytable')
except CartoDBAPIKey.CartoDBException as e:
print ("some error ocurred", e)
clone the repo, create a secret.py from secret.py.example, fill the variables and execute:
python setup.py test