omniscient-sdk
Official Python SDK for the Omniscient platform.
The SDK lets external services talk to an Omniscient backend over HTTP. A
single class — Omniscient — wraps every endpoint the backend publishes
under /sdk/*:
| Capability | Token permission | What it does |
|---|---|---|
| External connectors | connector |
Register a connector, run sync cycles, push files, query checksums. |
| MCP attachments | mcp |
Upload/download files referenced from chat. |
| OCR | ocr |
Extract Markdown/JSON/PDF from a document. |
| Chat | chat |
OpenAI-style chat completions (not implemented yet). |
A token's permissions decide which methods are callable; the backend rejects
calls made with a token that lacks the required permission. The chat methods
raise NotImplementedError until the backend implementation lands.
Installation
pip install omniscient-sdk
Imports use the top-level omniscient package:
from omniscient import Omniscient
Authentication
All calls authenticate with an API token sent through the X-Api-Key HTTP
header. Tokens are created from the Omniscient admin panel and carry one or
more permissions (connector, mcp, ocr, chat).
The client reads two environment variables by default (or accepts them as constructor arguments):
| Variable | Purpose |
|---|---|
OMNISCIENT_API_URL |
Base URL of the Omniscient backend. |
OMNISCIENT_API_TOKEN |
API token (omni_...). |
from omniscient import Omniscient
# Reads OMNISCIENT_API_URL / OMNISCIENT_API_TOKEN from the environment.
with Omniscient() as client:
print(client.connector_id) # connector bound to this token, if any
print(client.last_sync_started_at) # checkpoint of the last sync run
# …or pass them explicitly:
client = Omniscient(api_url="https://omniscient.example.com", api_token="omni_…")
When the token is bound to a connector, the client resolves the connector ID
on construction. Pass resolve_connector=False to skip that lookup when you
only use the MCP or OCR features.
External connectors
A connector pushes documents from an external source into Omniscient. The
run_sync helper drives a full cycle — optional auto-register → notify start
→ your sync function → notify end (with stale-item cleanup):
import os
from pathlib import Path
from omniscient import Omniscient
def sync(client: Omniscient) -> list[str]:
source_dir = Path(os.environ["OMNISCIENT_SOURCE_DIR"])
existing = set(client.get_existing_checksums())
active: list[str] = []
for path in sorted(source_dir.rglob("*")):
if not path.is_file():
continue
checksum = Omniscient.compute_checksum(path)
active.append(checksum)
if checksum not in existing:
client.push_file(path, source_id=str(path.relative_to(source_dir)))
# Returning the active checksums lets the backend delete stale items.
return active
if __name__ == "__main__":
with Omniscient() as client:
client.run_sync(sync, name="local-files", description="Local files")
item_exists(source_id=...) / item_exists(checksum=...) query the backend
for a single item without fetching the whole checksum list. See
examples/external_connector/ for a runnable
connector and Dockerfile.
MCP attachments
Upload a file produced by an MCP tool so it can be downloaded from the chat UI, and fetch it back by id:
from omniscient import Omniscient
with Omniscient(resolve_connector=False) as client:
info = client.mcp_upload_attachment("./report.pdf", display_name="Q4 report")
client.mcp_download_attachment(info["attachmentId"], "./downloaded.pdf")
OCR
Run OCR on a single document. By default the structured result is returned as
a dict; pass output_format together with dest to download the rendered
file instead:
from omniscient import Omniscient
with Omniscient(resolve_connector=False) as client:
result = client.ocr_extract("./document.pdf", mode="STRUCTURED")
print(result["markdown"])
# Render and download a file:
client.ocr_extract(
"./document.pdf", output_format="MARKDOWN", dest="./document.md"
)
mode accepts "PLAIN", "STRUCTURED" (default) or "VLM";
output_format accepts "MARKDOWN", "JSON" or "PDF". Result keys are
snake_case (markdown, regions, page_count, …).
Chat (not implemented)
from omniscient import Omniscient
with Omniscient(resolve_connector=False) as client:
# Raises NotImplementedError today.
client.chat_completions({"messages": [{"role": "user", "content": "Hi"}]})
Development
The project uses uv and
ruff (pinned in pyproject.toml).
uv sync
uv run ruff check src tests
uv run ty check
uv run pytest
Versioning & release
The package version lives in [project].version of pyproject.toml (a single
source of truth; omniscient.__version__ is read from the installed package
metadata). Releases are driven by CI:
- pushes to
developpublish a dev build to TestPyPI (the version is suffixed with.devNso each build is unique); - pushes to
mainpublish the exactpyproject.tomlversion to PyPI asomniscient-sdk.
Bump version in pyproject.toml before promoting a release to main.
Metadata
Release files for omniscient-sdk 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| omniscient_sdk-0.2.0.tar.gz | 8.0 kB | Without provenance | Details for omniscient_sdk-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| omniscient_sdk-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for omniscient_sdk-0.2.0-py3-none-any.whl |
Total release size: 17.0 kB
Release files / omniscient_sdk-0.2.0.tar.gz
| Download URL | omniscient_sdk-0.2.0.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
11f917321923e1236df03596070697a87431d8ecea6b5793b08b549ae43e27aa
|
|
BLAKE2b-256 checksum How to use checksums |
39cd624c460b1f1694f1cd2e29f3137e5747d1acb73143bb5e7b092d94a1bb3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / omniscient_sdk-0.2.0-py3-none-any.whl
| Download URL | omniscient_sdk-0.2.0-py3-none-any.whl |
|---|---|
| Size | 9.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f41ff60f0a5fea35ce846394ef2bc2046f9b714eea960d3ea7d8253e350855d3
|
|
BLAKE2b-256 checksum How to use checksums |
5215ca8fd77229de9fa29c7a9df4d1f91fe6a295cea65c432b6df3e5e455f846
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for omniscient-sdk 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.