Skip to main content

A CLI for the DocumentCloud platform.

Project description

                                         

██████╗ ██████╗ ██████╗ ██████╗██╗ ██████╗ ██╗ ██╗██████╗ ██████╗██╗ ██╗ ██╔══██╗██╔═══██╗██╔════╝██╔════╝██║ ██╔═══██╗██║ ██║██╔══██╗ ██╔════╝██║ ██║ ██║ ██║██║ ██║██║ ██║ ██║ ██║ ██║██║ ██║██║ ██║█████╗██║ ██║ ██║ ██║ ██║██║ ██║██║ ██║ ██║ ██║ ██║██║ ██║██║ ██║╚════╝██║ ██║ ██║ ██████╔╝╚██████╔╝╚██████╗╚██████╗███████╗╚██████╔╝╚██████╔╝██████╔╝ ╚██████╗███████╗██║ ╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝╚══════╝╚═╝
python cli program for the DocumentCloud platform

PyPI License: MIT

A simple CLI tool to enable interacting with DocumentCloud from the comfort of the terminal. Uses the python-documentcloud wrapper of the DocumentCloud API, as well as the excellent Typer CLI library.

Installation

pip install doccloud-cli

Examples

See all commands

doccloud-cli --help

Output:

 Usage: doccloud-cli.exe [OPTIONS] COMMAND [ARGS]...                                                       

╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────╮
│ --install-completion          Install completion for the current shell.                                 │
│ --show-completion             Show completion for the current shell, to copy it or customize the        │
│                               installation.                                                             │
│ --help                        Show this message and exit.                                               │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ──────────────────────────────────────────────────────────────────────────────────────────────╮
│ search         Search DocumentCloud for a query. Optionally specify the number of results shown.        │
│ upload         Upload a document on your machine to DocumentCloud. Will prompt for username and         │
│                password if not entered initially.                                                       │
│ upload-dir     Upload a directory of documents on your machine to DocumentCloud as a Project. Will      │
│                prompt for project name, username, and password if not entered initially.                │
│ get-document   Fetches a document from the numeric ID and displays its metadata.                        │
│ view-text      View the text of a document as parsed by DocumentCloud. Your mileage may vary.           │
│ save-text      Saves the text of a document to a .txt file.                                             │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Searching for documents with the term "Los Angeles". Optional argument to limit the amount of results displayed

doccloud-cli search "Los Angeles" 5

Output:

                                  Search Results                                  
┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━┓
┃  Contributor  ┃                Title                ┃ Creation Date ┃    ID    ┃
┡━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━┩
│  Rosanna Xia  │ 801 S. Los Angeles St., Los Angeles │  Jul 02 2013  │  723521  │
│  Rosanna Xia  │ 817 S. Los Angeles St., Los Angeles │  Jun 28 2013  │  719140  │
│  Rosanna Xia  │ 824 S. Los Angeles St., Los Angeles │  Jun 28 2013  │  719138  │
│ Online Staff  │         Los Angeles County          │  Aug 24 2021  │ 21048519 │
│ Cheryl Miller │        Los Angeles Response         │  Apr 26 2018  │ 4448284  │
└───────────────┴─────────────────────────────────────┴───────────────┴──────────┘

Uploading a document on your machine to DocumentCloud. You will be prompted for credentials if they are not included.

doccloud-cli upload C:\Users\name\Downloads\document.pdf username password

Features

  • Logging into DocumentCloud
  • Searching for documents (with hyperlinking!)
  • Uploading documents
  • Viewing/saving the full text of documents as parsed by DocumentCloud (your mileage may vary)

TODO

  • Improve uploading functionality (uploading from URL)
  • Support for viewing/adding/deleting annotations
  • Improve search functionality (ability to fetch more metadata)

Contributing

  1. Fork it (https://github.com/leadbraw/doccloud-cli/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

doccloud_cli-1.0.7.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

doccloud_cli-1.0.7-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file doccloud_cli-1.0.7.tar.gz.

File metadata

  • Download URL: doccloud_cli-1.0.7.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.12.6 Windows/10

File hashes

Hashes for doccloud_cli-1.0.7.tar.gz
Algorithm Hash digest
SHA256 ee83e6119d5e10c58c9ca4ff9e67179dc6c98c2ea90426e6385c8ef4a9e2a35b
MD5 6b2a64adaec1a01242c4547f60d64237
BLAKE2b-256 869b962ea4216e860ada87efb19d098d9574957a0d734c2b1b9f56ba463d6d32

See more details on using hashes here.

File details

Details for the file doccloud_cli-1.0.7-py3-none-any.whl.

File metadata

  • Download URL: doccloud_cli-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.12.6 Windows/10

File hashes

Hashes for doccloud_cli-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 cf823fcf08b8bdfb6879ef331f3289758611367168bf75e55350fc44c67c1597
MD5 7fb5d6b1de97e3b9440653da428daf03
BLAKE2b-256 38c9cfbc1b667e8bacb56ab99ad22af29a426be4452d807c06b6016a5d42b22f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page