Skip to content

Inputs & Extraction

Every docstats request accepts exactly one input source. The extraction pipeline extracts clean prose before scoring, preventing code blocks, markup, and boilerplate from skewing metrics.

A plaintext or markdown string, suitable for editor buffers, single paragraphs, and terminal queries.

{ "text": "Your draft content here..." }

A publicly reachable HTTP or HTTPS URL.

  • HTML pages: Content is retrieved and parsed with BeautifulSoup, removing <script>, <style>, and navigation boilerplate to isolate prose.
  • Web PDFs: For URLs ending in .pdf or returning application/pdf, docstats streams the file and extracts text page by page with pypdf.
{ "web_url": "https://en.wikipedia.org/wiki/Readability" }

A URI referencing a PDF stored in Google Cloud Storage:

gs://bucket-name/path/to/document.pdf

Reading from gs:// URIs requires Google Cloud Application Default Credentials (ADC). Authenticate locally via:

Terminal window
gcloud auth application-default login

Alternatively, set GOOGLE_APPLICATION_CREDENTIALS to a service account key path with roles/storage.objectViewer permissions on the bucket.

Axis B (house-style linting) evaluates extracted prose only. The pipeline strips code blocks, inline code, and table cells before running pattern detectors. This ensures technical exceptions hold automatically, preventing markdown syntax and code operators from triggering lint warnings.