EDA for single documents and document databases
Project description
docscout
CLI tool for exploratory data analysis of business document databases (PDF, DOCX, PPTX). Designed to inform agentic retrieval/search projects and test dataset curation. Uses Docling for document parsing.
Installation
Requires Python 3.11+. Uses uv for dependency management.
pip install docscout
Or from source:
uv venv && source .venv/bin/activate
uv pip install -e .
For development (includes pytest, ruff, mypy, and pre-commit):
uv pip install -e ".[dev]"
Usage
Single file analysis
Parses a document and reports page, word, character, table, figure, heading, and section counts.
docscout report.pdf
docscout quarterly_review.pptx
docscout report.pdf --format json
DOCX and PPTX files are automatically converted to PDF via LibreOffice before parsing.
Directory profiling
Recursively scans a directory, parses all supported files, and displays aggregate statistics with per-metric breakdowns (total, avg, std, median, min, max with file paths).
docscout ./contracts/
docscout ./contracts/ --detail # per-file detail table
docscout ./contracts/ --format json
Options
| Flag | Default | Description |
|---|---|---|
--format |
rich |
Output format: rich (terminal tables) or json |
--detail |
off | Show per-file detail table (directory mode only) |
--cache-dir |
~/.cache/docscout/ |
Override cache location |
--no-cache |
off | Bypass cache and force re-parse |
--verbose / -v |
off | Enable verbose logging to stderr |
--save-images |
off | Save annotated page images to the given directory |
--version |
Print version and exit |
Supported file types
Parsed via Docling: PDF, DOCX, PPTX
DOCX and PPTX files require LibreOffice to be installed (soffice on PATH) for conversion to PDF before parsing.
All other file types found during directory scans are categorized and counted in the filetype distribution but not parsed for content metrics.
Caching
Results are cached in a SQLite database (~/.cache/docscout/cache.db) keyed by absolute file path. Cache entries are automatically invalidated when file size or modification time changes. Use --no-cache to force a fresh parse.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Input error (bad path, unsupported file type) |
| 2 | Partial failure (some files failed to parse) |
Development
See CONTRIBUTING.md for full setup instructions.
uv run pytest # all tests
uv run pytest tests/test_parsing.py # single file
uv run pytest -k "test_name" # single test
uv run ruff check src/ tests/ # lint
uv run ruff format src/ tests/ # format
uv run mypy src/ # type check
Future features
--no-recurseflag — flat directory scan (no subdirectory traversal)- Language detection — per-document language via
langdetector similar - Python API — expose
parse_file()andscan_directory()as a public library interface - Additional formats — images (dimensions, EXIF), CSV/XLSX (row/column count), HTML
- Filtering / querying — e.g.
--filter "tables > 5" - Parallel parsing — multi-file parsing via
concurrent.futures - Cache management CLI —
docscout cache clear,docscout cache stats
Changelog
See CHANGELOG.md.
License
MIT
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file docscout-0.1.0.tar.gz.
File metadata
- Download URL: docscout-0.1.0.tar.gz
- Upload date:
- Size: 24.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9dcb552b6cd1ff1b539b531dcdc07583c4ea3777837228234ddaa047838857fb
|
|
| MD5 |
c2e77255564187fd8416d03965dc6210
|
|
| BLAKE2b-256 |
b296ad5c017bd874718abd49b3ae4cffc8e5cbeded53e2984b82e596db287791
|
Provenance
The following attestation bundles were made for docscout-0.1.0.tar.gz:
Publisher:
publish.yml on felixpeters/docscout
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
docscout-0.1.0.tar.gz -
Subject digest:
9dcb552b6cd1ff1b539b531dcdc07583c4ea3777837228234ddaa047838857fb - Sigstore transparency entry: 1038012686
- Sigstore integration time:
-
Permalink:
felixpeters/docscout@bbf3dd55d28ff06bfdf9119edc8f54b521740b92 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/felixpeters
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bbf3dd55d28ff06bfdf9119edc8f54b521740b92 -
Trigger Event:
release
-
Statement type:
File details
Details for the file docscout-0.1.0-py3-none-any.whl.
File metadata
- Download URL: docscout-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e668a6a572dddfbc848a63a6eabb1de6df35589b7a4755673b10a63f724c00b
|
|
| MD5 |
0860ffe8bda828c5229c341c41b42911
|
|
| BLAKE2b-256 |
72f4fdf08a7957deefe3313a68e389c7ba77dacfe2592ba83e3bfa384ae9ad2b
|
Provenance
The following attestation bundles were made for docscout-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on felixpeters/docscout
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
docscout-0.1.0-py3-none-any.whl -
Subject digest:
8e668a6a572dddfbc848a63a6eabb1de6df35589b7a4755673b10a63f724c00b - Sigstore transparency entry: 1038012753
- Sigstore integration time:
-
Permalink:
felixpeters/docscout@bbf3dd55d28ff06bfdf9119edc8f54b521740b92 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/felixpeters
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bbf3dd55d28ff06bfdf9119edc8f54b521740b92 -
Trigger Event:
release
-
Statement type: