Advertisement
Guest User

Untitled

a guest
Jan 11th, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. # pip install python-documentcloud
  2. from documentcloud import DocumentCloud
  3. import creds
  4.  
  5. username = "someone@somewhere.com"
  6. password = "somethingsneaky"
  7. projectsought = "Cool set of documents"
  8.  
  9. client = DocumentCloud(username, password)
  10. project = client.projects.get(title=projectsought)
  11.  
  12. pagecount = 0
  13. for document in project.document_ids:
  14. docobj = project.get_document(document)
  15. pagecount += docobj.pages
  16.  
  17. print(str(pagecount) + " pages from " + str(len(project.document_ids)) + " documents found in " + projectsought)
  18.  
  19. # 5433 pages from 643 documents found in Cool set of documents
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement