Skip to content

Latest commit

 

History

History
51 lines (32 loc) · 1.33 KB

README.md

File metadata and controls

51 lines (32 loc) · 1.33 KB

What is cartodb-python?

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.

Installation

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

Usage example

The following example requires your CartoDB API consumer key and consumer secret or the API KEY. Refer to the CartoDB Authentication documentation for details.

using API KEY

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)

running tests

clone the repo, create a secret.py from secret.py.example, fill the variables and execute:

python setup.py test