Created
January 4, 2012 18:36
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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