Skip to main content

DataCoder SDK

Python SDK for DataCoder — AI Data Analyst Platform.

Query your RAG knowledge bases programmatically.

Installation

pip install datacoder

Quick Start

from datacoder import DataCoder

# Initialize with your SDK key and server URL
sdk = DataCoder(
    api_key="dc_sk_your_key_here",
    base_url="https://datacoder.clouditia.com",
)

# Test connectivity
if sdk.ping():
    print("Connected!")

# Query a knowledge base
result = sdk.query(
    folder_id="your-folder-uuid",
    query="Quels sont les risques de crédit dans Bâle III ?",
)

print(result.answer)    # Combined text from all matching chunks
print(result.sources)   # List of source document names
print(result.count)     # Number of results

# Check your quota
quota = sdk.quota()
print(f"Plan: {quota.plan}")
print(f"SDK remaining today: {quota.sdk_remaining}")

API Reference

DataCoder(api_key, base_url, timeout=30)

Initialize the SDK client.

Parameter Type Default Description
api_key str — Your SDK key (starts with dc_sk_)
base_url str https://datacoder.clouditia.com DataCoder server URL
timeout int 30 Request timeout in seconds

sdk.query(folder_id, query, top_k=10) → RAGResult

Query a RAG knowledge base.

Parameter Type Default Description
folder_id str — UUID of the knowledge folder
query str — Natural language question
top_k int 10 Max results (1-20)

Returns: RAGResult

Property Type Description
result.answer str Concatenated content from all matching chunks
result.sources list[str] Source document names
result.count int Number of results
result.results list[dict] Raw results with content, source, page, score
result.query str Original query
result.folder_id str Folder queried

sdk.quota() → QuotaInfo

Check current usage and limits.

Property Type Description
quota.plan str Current plan (free, pro, enterprise)
quota.sdk_used_today int SDK requests used today
quota.sdk_limit int Daily SDK limit (-1 = unlimited)
quota.sdk_remaining int Remaining SDK requests (-1 = unlimited)
quota.sdk_rate_limit int Max requests per minute
quota.chat_used_today int Chat messages used today
quota.chat_limit int Daily chat limit
quota.chat_rate_limit int Chat rate limit per minute

sdk.ping() → bool

Test if the API is reachable and the key is valid. Returns True or False.

Plans & Quotas

Free Pro (29€/mo) Enterprise (99€/mo)
SDK requests/day 10 1,000 100,000
SDK rate limit 5/min 100/min 1,000/min
Chat messages/day 20 200 50,000

Error Handling

from datacoder import DataCoder
from datacoder.client import (
    AuthenticationError,
    QuotaExceededError,
    ForbiddenError,
    NotFoundError,
    DataCoderError,
)

sdk = DataCoder(api_key="dc_sk_...", base_url="https://...")

try:
    result = sdk.query(folder_id="...", query="...")
except AuthenticationError:
    print("Invalid or expired API key")
except QuotaExceededError as e:
    print(f"Quota exceeded. Retry after {e.retry_after}s")
except ForbiddenError:
    print("No access to this folder with this SDK key")
except NotFoundError:
    print("Folder not found or not owned by this user")
except DataCoderError as e:
    print(f"API error: {e} (HTTP {e.status_code})")

Get your SDK Key

  1. Log in to DataCoder
  2. Go to Settings → SDK
  3. Enter a name and click Generate
  4. Copy your key (shown only once)

On-Premise

DataCoder can be deployed on your own infrastructure. Point base_url to your self-hosted instance:

sdk = DataCoder(
    api_key="dc_sk_...",
    base_url="https://datacoder.your-company.com",
)

License

MIT — Clouditia

Metadata

Release files for datacoder 0.2.1

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

Source distribution (sdist)

Source distribution for datacoder 0.2.1
File Size Uploaded Provenance Actions
datacoder-0.2.1.tar.gz 5.2 kB Without provenance Details for datacoder-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for datacoder 0.2.1
File Interpreter ABI Platform Actions
datacoder-0.2.1-py3-none-any.whl Python 3 none any Details for datacoder-0.2.1-py3-none-any.whl

Total release size: 10.8 kB

Release files / datacoder-0.2.1.tar.gz

Download URL datacoder-0.2.1.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f3203cb1a00ebccf55f3ce095d0799c7afc0a313f44daa0f8a0a42b2009729af
BLAKE2b-256 checksum
How to use checksums
4634c0f22ce5298b62dc4188d5da898c0a3a574f7544f8f162313d24540b1941
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / datacoder-0.2.1-py3-none-any.whl

Download URL datacoder-0.2.1-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0808ee7bbcafdb068dc7387f8b8a6e77e21b002e31b7941b3097885ff0e744bf
BLAKE2b-256 checksum
How to use checksums
7a69407b4feef45ca5f0e84e184d70f5e94f0744f6dd5fe10497060e0915a9d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for datacoder 0.2.1

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.

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