Use With python-documentcloudΒΆ

pneumatic happily coexists with python-documentcloud, a full-featured wrapper for the DocumentCloud API. python-documentcloud offers extensive methods for interacting with documents, projects, annotations, entities and other aspects of the platform.

For example, you can create a project with python-documentcloud, then use pneumatic to upload files and capture the results data:

# Import both libraries.
from pneumatic import DocumentCloudUploader
from documentcloud import DocumentCloud

# Create the respective clients.
uploader = DocumentCloudUploader('', 'your-password')
dc_client = DocumentCloud('', 'your-password')

# Using python-documentcloud, create a project under your account.
project = dc_client.projects.create('Loudoun Fire')

# Using pneumatic, upload your files. Add them to the project id obtained when
# the project was created just now.
    source='Loudoun County Fire and Rescue',
    data={'topic': 'fires'})

# pneumatic made a database of your upload results. Print its name and location.

# Dump the pneumatic upload results data to a CSV.