A bulk upload library for DocumentCloud.
Project description
pneumatic is a library that adds some luxury and safeguards to the bulk-uploading of hundreds, thousands or hundreds of thousands of files to DocumentCloud. It is meant to do one thing – upload – and serve as an adjunct to, but not a replacement for, the excellent python-documentcloud API wrapper.
pneumatic’s name is inspired by the newsrooms of yore, which featured a series of pneumatic tubes for sending copy from the newsrooms to other departments such as the composing room.
Features
Catalogs the API response for each upload in a SQLite database along with the file’s canonical URL.
Dumps the SQLite data to a CSV if you wish.
Multiprocessing (under Mac/Linux) for faster submission of files to DocumentCloud’s API.
Prevents inadvertent submission of file types DocumentCloud doesn’t handle, such as audio.
Links
Documentation: http://pneumatic.readthedocs.org/
Repository: https://github.com/anthonydb/pneumatic
Basic Usage
You will need an active DocumentCloud account. Example use: To upload all files in a directory (and all sub-directories below it), assign them to an existing project, set the files to public access, and tag each with metadata, run the following code:
from pneumatic import DocumentCloudUploader
client = DocumentCloudUploader('person@example.com', 'your-password')
client.upload(
file_directory='/govfiles',
project='17477-loudoun-county-government',
access='public',
data={'type': 'government', 'action': 'lawsuit'})
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pneumatic-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8baa5a1dfd6b7e34414f7374c8d7ac04fb32abfabddeb1caaf16ef821bd0e48d |
|
MD5 | 3a4c716d1e98e4ce879709a839e6afb3 |
|
BLAKE2b-256 | d855ac9818866b08116518526a30cb6e53b660c304931945b8e03a0978b62a8f |