Skip to main content

EDA for single documents and document databases

Project description

docscout

CI PyPI version Python versions License: MIT

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-recurse flag — flat directory scan (no subdirectory traversal)
  • Language detection — per-document language via langdetect or similar
  • Python API — expose parse_file() and scan_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 CLIdocscout cache clear, docscout cache stats

Changelog

See CHANGELOG.md.

License

MIT

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

docscout-0.1.0.tar.gz (24.2 kB view details)

Uploaded Source

Built Distribution

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

docscout-0.1.0-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

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

Hashes for docscout-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9dcb552b6cd1ff1b539b531dcdc07583c4ea3777837228234ddaa047838857fb
MD5 c2e77255564187fd8416d03965dc6210
BLAKE2b-256 b296ad5c017bd874718abd49b3ae4cffc8e5cbeded53e2984b82e596db287791

See more details on using hashes here.

Provenance

The following attestation bundles were made for docscout-0.1.0.tar.gz:

Publisher: publish.yml on felixpeters/docscout

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for docscout-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8e668a6a572dddfbc848a63a6eabb1de6df35589b7a4755673b10a63f724c00b
MD5 0860ffe8bda828c5229c341c41b42911
BLAKE2b-256 72f4fdf08a7957deefe3313a68e389c7ba77dacfe2592ba83e3bfa384ae9ad2b

See more details on using hashes here.

Provenance

The following attestation bundles were made for docscout-0.1.0-py3-none-any.whl:

Publisher: publish.yml on felixpeters/docscout

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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