@@ -0,0 +1,1002 @@
+#!/usr/bin/env python2%0A%0Aimport requests%0Aimport unicodecsv%0Afrom utils import get_api_key%0A%0Afrom documentcloud import DocumentCloud%0Aclient = DocumentCloud()%0A%0Aclient = DocumentCloud(USERNAME, PASSWORD)%0A%0A# request_pks = %5B%22296716-request-denied%22%5D%0A%0Acsv_file = open('document_cloud_OCR.csv', 'w')%0Acsv_file.seek(0)%0Acsv_writer = unicodecsv.writer(csv_file)%0Acsv_writer.writerow(%5B%22ID%22,%22OCR Text%22%5D)%0A%0Awith open('docIDs.csv', mode='r') as infile:%0A    reader = unicodecsv.reader(infile)%0A    with open('docIDs.csv', mode='r') as outfile:%0A        print %22starting to write%22%0A        writer = unicodecsv.writer(outfile)%0A        print %22starting to read%22%0A        request_pks = %7Brows%5B0%5D:rows%5B0%5D for rows in reader%7D%0A        print %22all read%22%0A        print request_pks%0A%0A%0Afor document_id in request_pks:%0A    print %22Working on request %22 + str(document_id)%0A    try:%0A        obj = client.documents.get(document_id)%0A        OCR = obj.full_text%0A        csv_writer.writerow(%5Bdocument_id,OCR%5D)%0A    except Exception as e:%0A        print e%0A

Create export_documentcloud_text.py