semvec/pypi-packages huggingface dataset:
downdocs 0.1.0
CLI tool to download Google Docs from stdin
License: MIT
Requires Python: >=3.8
Keywords: cli, download, gdocs, google-docs, google-drive

# downdocs

A CLI tool to download Google Docs from stdin. Pipe Google Doc IDs and download them as DOCX, TXT, or Markdown files.

## Installation

```bash
pip install downdocs
```

## Setup

1. Go to [Google Cloud Console](https://console.cloud.google.com/)
2. Create a new project or select existing one
3. Enable the Google Drive API
4. Create OAuth 2.0 credentials (Desktop app)
5. Download the credentials JSON file
6. Save it to `~/.config/downloadDocs/credentials.json`

## Usage

```bash
# Pipe document IDs to download
echo "1ABC...xyz" | downdocs

# Specify output directory
echo "1ABC...xyz" | downdocs --out ./my-docs

# Download as Markdown
echo "1ABC...xyz" | downdocs --format md

# Download multiple docs
cat doc_ids.txt | downdocs --format docx --out ./downloads
```

### Options

| Option | Default | Description |
|--------|---------|-------------|
| `--out` | `./docs` | Output directory |
| `--format` | `docx` | Download format (`docx`, `txt`, `md`) |
| `--token` | `~/.config/downloadDocs/token.json` | Path to token.json |
| `--credentials` | `~/.config/downloadDocs/credentials.json` | Path to credentials.json |

## Getting Document IDs

Google Doc IDs are the part of the URL between `/d/` and `/edit`:

```
https://docs.google.com/document/d/1ABC123xyz/edit
                           ^^^^^^^^^^
                           Document ID
```

## License

MIT License - see [LICENSE](LICENSE) for details.