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.6.tar.gz (5.2 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.6-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: doccloud_cli-1.0.6.tar.gz
  • Upload date:
  • Size: 5.2 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.6.tar.gz
Algorithm Hash digest
SHA256 c3f8e25ea7250c6b88359c63fd3cefee2e9a03462a7b7b2ba95d546ff786aad2
MD5 93eaf0f24f7262fbe03d6d3fa4138b56
BLAKE2b-256 692987dbe7dc422212112c447be1a436e705cf43b2417480dddf1e0c4ac6f760

See more details on using hashes here.

File details

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

File metadata

  • Download URL: doccloud_cli-1.0.6-py3-none-any.whl
  • Upload date:
  • Size: 6.3 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 db2e0e9d2caba7bbd817ef7c4d93e017ade0eb0ebf6fe559316a8bd8b362d9ba
MD5 9766c4e285f290bb768da2cbd9b80fad
BLAKE2b-256 6764d778034c6106b82e029ec76732b84c5af095b0193d91e21b2438b7c8eefb

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