eyeseast / docviewer-standalone-prototype

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Standalone Document Viewer

This is a prototype document viewer for DocumentCloud. It should create a version of a DocumentCloud embed that will work without an internet connection.

Getting started

To run locally, install a recent version of Python and Poetry.

Clone and install dependencies

git clone https://github.com/eyeseast/docviewer-standalone-prototype && cd docviewer-standalone-prototype
poetry install

This will create a virtual environment and install the required Python dependencies. You can now run the add-on locally to download assets for documents.

Fetch assets

First, store your DocumentCloud login credentials in your environment. The easiest way is to create a .env file in the root of this directory, and set your username and password, like this:

# .env

export DC_USERNAME="you@example.com"
export DC_PASSWORD="password12345"

Run source .env to load the DC_USERNAME and DC_PASSWORD into your environment.

Now, run the script, passing in the ID of a document you want to export:

poetry run ./main.py --documents 23781130

This uses poetry to run the main.py script inside a virtual environment and will fetch assets for a single document. Everything will be downloaded into a folder called assets, as well as an archive called assets.zip.

About

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Python 49.5%Language:Svelte 21.2%Language:JavaScript 19.3%Language:HTML 4.7%Language:Makefile 3.0%Language:Shell 2.2%