Intuned SDK for file operations (to markdown, extract tables)
Project description
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.
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
from intuned_files import to_markdown, extract_tables, PdfFile
# Convert a file to markdown
markdown = await to_markdown(PdfFile(url="https://example.com/report.pdf"))
# Extract tables from a file
tables = await extract_tables(PdfFile(url="https://example.com/report.pdf"))
Both functions also accept a plain dict (typed via the *Dict TypedDicts):
from intuned_files import to_markdown
await to_markdown({"type": "pdf", "url": "https://example.com/report.pdf"})
Extract structured data
extract_structured_data 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
data = await extract_structured_data(
{"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 to_markdown
from intuned_browser import download_file
await to_markdown({"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"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file intuned_files-0.1.0.dev1.tar.gz.
File metadata
- Download URL: intuned_files-0.1.0.dev1.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b97dda2971269621a09f2cee469417a2720d0f7a926c37b6d364e1441aaa777
|
|
| MD5 |
1360f8f8d146acbae71d271abdf7f59c
|
|
| BLAKE2b-256 |
490c3b84b71d7c0f35e8cbb10aa33749ed8dda6516e66ee0277ec7b025af7cc8
|
File details
Details for the file intuned_files-0.1.0.dev1-py3-none-any.whl.
File metadata
- Download URL: intuned_files-0.1.0.dev1-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2ab294c54010887d824a7f26479b585244b341c59ec144a459b6f5170c9eb3a
|
|
| MD5 |
d6974e36892328b31759e21df25076dd
|
|
| BLAKE2b-256 |
03d0db493d21de285353dd118178015cc1b9bcef5efea8c7c8e5a432c9b89c10
|