Skip to content
Bits & Flames Fyron Documentation GitHub
DocsDocuments

Documents

For site-specific access setup, see Document authentication. Choose the method and permissions approved by your administrator.

fyron.documents retrieves URL-addressable documents for research workflows, including plain-text reports (text/plain) and PDFs (application/pdf). Download files first, review their outcomes, then pass the local files to parsing or analysis.

Documents Submodules

ChapterUse it for
DocumentDownloaderSingle-document and batch downloads, OIDC authentication, PDF validation, and verified restarts.

Choose The Right Path

NeedPrefer
Download a plain-text reportPlain text, without strict PDF mode.
Download and validate a PDF responseOIDC PDF workflow, with require_pdf=True or --pdf.
Download a mixed cohort of text files and PDFsMixed batches, without --pdf.
Download URLs listed in a CSVCSV batch downloads, using the document_url column.
Save all files in one folder and record their pathsFlat-folder Python and CLI examples, with flat_output=True / --flat-output.
Omit per-document JSON filesCompletion-record opt-out, with explicit overwrite required on unverified reruns.
Sign in through browser approval or a service accountAuthentication using the shared Fyron Auth.
Choose document filenames and reuse cached loginCustom IDs and cached login.
Restart an interrupted downloadSafe restarts, with verified completion records.
Run downloads from a terminalDocument CLI.

Typical Workflow

  1. Obtain approved document URLs from the source system or a cohort table.
  2. Configure authentication and choose general or strict PDF download mode.
  3. Download files and inspect the returned errors, content types, and paths.
  4. Keep completion records and sensitive results tables with the downloaded files.
  5. Process local documents only after checking the download outcomes.

Import

python
from fyron import Auth, DocumentDownloader

Formats and Output

General mode supports both text and PDF files and saves response bytes without converting formats. Automatic naming uses the response content type; an explicit output path keeps the chosen filename. Strict PDF mode is optional and rejects non-PDF responses. It checks the media type and signature, not the entire PDF syntax.

The same downloader supports one URL, URL lists, and DataFrame/CSV batches. Results include a deterministic download ID, local path, HTTP status, content type, hash, and error/skip information. URL and path fields can be sensitive; logs contain controlled diagnostics and outcome counts.

  • FHIR for querying document metadata and resource references.
  • Core I/O for local tables and file operations.
  • LLM for reviewed narrative assistance after retrieval.
  • Audit & Provenance for reproducibility manifests.