Skip to main content

Python SDK for the Qanatix API — ingest, search, and manage structured data for AI agents.

Project description

Qanatix Python SDK

The official Python SDK for Qanatix — ingest, search, and manage structured data for AI agents.

Install

pip install qanatix

With pandas support:

pip install qanatix[pandas]

Quick start

import qanatix

qx = qanatix.Qanatix("sk_live_...")

# Search
results = qx.search("parts_catalog", "stainless M8 bolt")
for r in results.results:
    print(r.name, r.score)

# Ingest
result = qx.ingest.batch("parts_catalog", "fastener", [
    {"name": "Hex Bolt M8x40", "material": "stainless", "price_eur": 0.12},
    {"name": "Hex Nut M8", "material": "carbon steel", "price_eur": 0.04},
])
print(f"Accepted: {result.summary.accepted}")

# Records
rec = qx.records.create("parts_catalog", "fastener", "New Part", {"price_eur": 1.50})
print(rec.record_id)

Public data (no API key)

import qanatix

qx = qanatix.QanatixOpen()

results = qx.search("suppliers", "ISO 9001 certified Germany")
collections = qx.collections.list()

Async

import qanatix

# Private
async with qanatix.AsyncQanatix("sk_live_...") as qx:
    results = await qx.search("parts_catalog", "stainless bolt")

# Open
async with qanatix.AsyncQanatixOpen() as qx:
    results = await qx.search("suppliers", "CNC machining Germany")

Clients

Client Auth Resources
Qanatix("sk_live_...") API key All resources
QanatixOpen() None search, collections
AsyncQanatix("sk_live_...") API key All resources, async
AsyncQanatixOpen() None search, collections, async

Features

  • Search — full-text + filters, auto-paginating iterator via qx.search.iter()
  • Ingest — batch JSON, file upload (CSV/JSON/XML), DataFrame support
  • Auto-chunking — batches >5,000 records split automatically
  • Retry — exponential backoff on 429/502/503/504
  • Records — CRUD + bulk update/delete
  • Connectors — pull from PostgreSQL, MySQL, MongoDB, Neo4j
  • Collections — list and update collection metadata
  • API Keys — create, list, revoke, rotate
  • Webhooks — create, list, test, and delete webhook subscriptions + verify_signature() for incoming payloads
  • Sync + AsyncQanatix / AsyncQanatix + QanatixOpen / AsyncQanatixOpen

All methods

Method Description
qx.search(col, query, ...) Search a collection
qx.search.iter(col, query, ...) Auto-paginate search results
qx.records.create(...) Create a record
qx.records.get(id) Get a record by ID
qx.records.list(...) List records
qx.records.update(id, ...) Update a record
qx.records.delete(id) Delete a record
qx.records.bulk_update(ids, ...) Bulk update records
qx.records.bulk_delete(ids) Bulk delete records
qx.ingest.batch(col, type, records) Ingest JSON batch
qx.ingest.upload(col, type, path) Upload file
qx.ingest.from_dataframe(col, type, df) Ingest from DataFrame
qx.ingest.status(upload_id) Check upload status
qx.ingest.errors(upload_id) Get upload errors
qx.connectors.create(...) Create a connector
qx.connectors.list() List connectors
qx.connectors.pull(id) Trigger a pull
qx.connectors.delete(id) Delete a connector
qx.collections.list() List collections
qx.collections.update(name, ...) Update collection metadata
qx.keys.create(name, scopes) Create an API key
qx.keys.list() List API keys
qx.keys.revoke(id) Revoke an API key
qx.keys.rotate(id) Rotate an API key
qx.webhooks.create(url, events, ...) Create a webhook subscription
qx.webhooks.list() List webhooks
qx.webhooks.delete(id) Delete a webhook
qx.webhooks.test(id) Send a test event
qx.webhooks.deliveries(id) View delivery history
qx.chat(message, history) Ask questions about your data in natural language
qx.export(col, format) Stream export

Chat

Ask questions about your data in natural language — Qanatix handles the rest:

answer = qx.chat("Show me ETFs with fees under 0.1%")
print(answer)

# With conversation history
answer = qx.chat("Compare them by AUM", history=[
    {"role": "user", "content": "Show me ETFs with fees under 0.1%"},
    {"role": "assistant", "content": "...previous answer..."},
])

Each chat message counts as 1 search against your quota.

Docs

Full documentation at qanatix.dev/docs/getting-started/python-sdk

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qanatix-1.0.0.tar.gz (19.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qanatix-1.0.0-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file qanatix-1.0.0.tar.gz.

File metadata

  • Download URL: qanatix-1.0.0.tar.gz
  • Upload date:
  • Size: 19.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for qanatix-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a59ebd820f60a6903aa377a33ae554854eb1fdb9fe39fd8457bb0c1f7a0b2869
MD5 a987d83901a83b3af926d6285108dcd2
BLAKE2b-256 2881c0eb5634925013339948bf16967a78dd53548dec8c9120b7f4d1e11d9508

See more details on using hashes here.

Provenance

The following attestation bundles were made for qanatix-1.0.0.tar.gz:

Publisher: publish.yml on qanatix/qanatix-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qanatix-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: qanatix-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for qanatix-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 062b5b2ad5f6786edb28eae34605861e5e732dc9930f2ef5c6f702bc96c07e49
MD5 14c461b00a41dbb60e5340b7c062041d
BLAKE2b-256 ce65808750b94c1607d30828bc617e31d2aac0f586448588a8f2df97e6d28e43

See more details on using hashes here.

Provenance

The following attestation bundles were made for qanatix-1.0.0-py3-none-any.whl:

Publisher: publish.yml on qanatix/qanatix-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page