Skip to content

Instantly share code, notes, and snippets.

@iriberri
Created September 3, 2015 11:11
Show Gist options
  • Save iriberri/8d08048639bdefe6bc81 to your computer and use it in GitHub Desktop.
Save iriberri/8d08048639bdefe6bc81 to your computer and use it in GitHub Desktop.
Python script for uploading file to CartoDB
import requests
url='https://username.cartodb.com/api/v1/imports/?api_key=api_key'
files = {'file': ('report.zip', open('/Users/Iriberri/Downloads/report.zip', 'rb'), 'application/zip')}
r = requests.post(url, files=files)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment