Skip to main content

intuned-files

Intuned SDK for file operations. Provides helpers for converting files to markdown and extracting tables from files, backed by the Intuned file APIs. Must be used within Intuned projects and requires the dependency intuned-runtime.

Installation

pip install intuned-files
# intuned-runtime is required at runtime (provided by the Intuned runtime).
# intuned-browser is optional, only needed for the `download` file source.

Usage

Extract markdown

from intuned_files import PdfFile, extract_markdown_from_file

markdown = await extract_markdown_from_file(PdfFile(url="https://example.com/report.pdf"))

Extract tables

extract_tables_from_file returns each table's page number, title, and cell content.

from intuned_files import PdfFile, extract_tables_from_file

tables = await extract_tables_from_file(PdfFile(url="https://example.com/report.pdf"))

Both functions also accept a plain dict (typed via the *Dict TypedDicts):

from intuned_files import extract_markdown_from_file

await extract_markdown_from_file({"type": "pdf", "url": "https://example.com/report.pdf"})

Extract structured data

extract_structured_data_from_file converts the file to markdown and then extracts data against a schema. It requires the optional intuned-browser dependency (the other operations do not); it raises a clear error at call time if it is missing.

from intuned_files import extract_structured_data_from_file

data = await extract_structured_data_from_file(
    {"type": "pdf", "url": "https://example.com/invoice.pdf"},
    data_schema={
        "type": "object",
        "properties": {
            "invoice_number": {"type": "string"},
            "total": {"type": "number"},
        },
        "required": ["invoice_number", "total"],
    },
)

data_schema accepts a JSON Schema dict or a Pydantic model class.

File sources

Provide exactly one source key on the file object: url, base64, buffer (raw bytes), or download. The download source accepts the result of download_file from intuned-browser, awaited or not:

from intuned_files import extract_markdown_from_file
from intuned_browser import download_file

await extract_markdown_from_file({"type": "pdf", "download": download_file(page, trigger)})

Supported file types

PdfFile, ImageFile, SpreadsheetFile (.xlsx), and DocumentFile (.docx).

Development

uv sync
uv run ruff format --check .
uv run ruff check .
uv run pyright
uv run pytest -m "not e2e"

Metadata

Release files for intuned-files 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for intuned-files 0.1.0
File Size Uploaded
intuned_files-0.1.0.tar.gz 8.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for intuned-files 0.1.0
File Interpreter ABI Platform
intuned_files-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.1 kB

Release files / intuned_files-0.1.0.tar.gz

Download URL intuned_files-0.1.0.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d32504bb1a680db184046fec9104c7ba2c31e2de2a1444bdd017cfa280a9a3c6
BLAKE2b-256 checksum
How to use checksums
9603095ec38f3e62646e4c699a3d3a79faabde7fd8ca85f45df4c374191e7984
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.0

Release files / intuned_files-0.1.0-py3-none-any.whl

Download URL intuned_files-0.1.0-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4676443a02ad02db075384fbfe2def30064b1042a29fb2cfcea98439a7a9fc0d
BLAKE2b-256 checksum
How to use checksums
f887ec80052bfb216aa841a3129497657e0bba26800d2359498ff04bbdb99487
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.0

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page