Skip to main content

Python wrapper for the Ethos document evidence CLI.

Project description

Ethos Python Package

This directory contains the ethos-pdf Python package source for Ethos.

The package exposes a public semver API beginning at 0.1.0 for Python >=3.8. Patch releases must not break public function signatures, exception classes, or documented return shapes. Minor releases may add backward-compatible API, and major releases may break API after a release-scope decision.

Public API:

  • EthosCli
  • EthosPythonSurfaceError
  • EthosNotFoundError
  • EthosTimeoutError
  • EthosCommandError
  • EthosOutputError
  • parse_pdf_json
  • parse_pdf_markdown
  • parse_pdf_text
  • crop_element

The current module is intentionally thin: it shells out to a caller-provided local ethos CLI binary and returns ethos doc parse output or source-bound ethos crop_element JSON. It can pass caller-provided source PDF and crop artifact directory arguments for rendered crop artifacts. It does not bundle PDFium, does not publish hosted surfaces, and does not expand parser behavior. The Rust CLI remains the source of truth.

PDFium-backed parse and crop paths require caller-provided PDFium through ETHOS_PDFIUM_LIBRARY_PATH. Importing ethos_pdf does not require PDFium. If PDFium is missing, the underlying CLI error is preserved in EthosCommandError.stderr so callers can show the setup guidance from docs/pdfium-manual-setup.md.

Run the focused tests with:

make python-surface-test

The tests use a fake local command, so they do not require PDFium.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

ethos_pdf-0.1.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file ethos_pdf-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ethos_pdf-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for ethos_pdf-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 04280d851a9f3bfeb4905452e26dcce4000d3a6c597a190e940e4c776d7b935d
MD5 2a86fe0775433982b63a417941774828
BLAKE2b-256 909b1af2fdb7fae11915663e32399dbfb7f4754730d128129168d80ee5f8763d

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