Skip to content

Instantly share code, notes, and snippets.

@palewire
Created January 4, 2012 18:36
Show Gist options
  • Save palewire/1561391 to your computer and use it in GitHub Desktop.
Save palewire/1561391 to your computer and use it in GitHub Desktop.
A quick Python script for rolling through the DcoumentCloud error attachment and setting everything live.
"""
Before you can use this, install the @LATdatadesk DocumentCloud wrapper for Python. Like so:
$ sudo pip install python-documentcloud
"""
import csv
from documentcloud import DocumentCloud
path = '/home/ben/Desktop/docs.csv'
data = csv.DictReader(open(path, 'r'))
client = DocumentCloud(USERNAME, PASSWORD)
for row in data:
id_ = row['document url'].replace("http://www.documentcloud.org/documents/", "").replace(".html", "")
print id_
obj = client.documents.get(id_)
obj.access = 'public'
obj.put()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment