A bulk upload library for DocumentCloud.
Project description
A Bulk-Upload Library for DocumentCloud
pneumatic is a Python 3 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 pneumatic dispatch systems in 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.io/en/latest/
Repository: https://github.com/anthonydb/pneumatic
Basic Usage
You will need an active DocumentCloud account and Python 3.4+. First, install via pip:
pip install pneumatic
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
uploader = DocumentCloudUploader('person@example.com', 'your-password')
uploader.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.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2628c3dfad8aee350e1e4f454b8ddb24795c5284b38ef8ba5a6b0a9a78c7e668 |
|
MD5 | 87dea1b0d11a6392fbf4142c5eab2a40 |
|
BLAKE2b-256 | e10fcf3fcad4891f9b7ab674011762872960df31d2257044b10e05cf4800e610 |