Skip to main content
100%

quick example of using the batch api over python

✓ Published0🌍 Public
Aandrewxhill
Last edited May 3, 2016
Created on May 3, 2016

This example shows how to submit asynchronous SQL jobs to CartoDB’s Batch API from Python, using a query that updates geometries by replacing them with centroids. It demonstrates the workflow of starting a job with a POST request, then polling its status via a GET request, and includes a helper to register new tables with CartoDB’s `CDB_Cartodbfytable` function. The code uses the `requests` library to handle HTTP calls, along with `urllib.quote_plus` for query encoding, and relies on the `cartodb.com` API endpoints for job creation and status retrieval.

AI-generated description

Similar vizzes