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 DataCoderSDK
# Initialize with your SDK key and server URL
sdk = DataCoderSDK(
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
DataCoderSDK(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 DataCoderSDK
from datacoder.client import (
AuthenticationError,
QuotaExceededError,
ForbiddenError,
NotFoundError,
DataCoderError,
)
sdk = DataCoderSDK(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
- Log in to DataCoder
- Go to Settings → SDK
- Enter a name and click Generate
- 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 = DataCoderSDK(
api_key="dc_sk_...",
base_url="https://datacoder.your-company.com",
)
License
MIT — Clouditia
Metadata
Release files for datacoder 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 |
|---|---|---|---|---|
| datacoder-0.2.0.tar.gz | 5.2 kB | Without provenance | Details for datacoder-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| datacoder-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for datacoder-0.2.0-py3-none-any.whl |
Total release size: 10.8 kB
Release files / datacoder-0.2.0.tar.gz
| Download URL | datacoder-0.2.0.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fa152901a6eff3e97382b6d006962055c7998f882f02b6aedc9b79634e8eb543
|
|
BLAKE2b-256 checksum How to use checksums |
f182f2ac36fb82a0b61ed7ae273c43d7cec5da62d79d25701cf891b603a15ec2
|
| 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.0-py3-none-any.whl
| Download URL | datacoder-0.2.0-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
30023555e9f996dce5a46f3035cdd2da99a15085e507b2bb6a39d033120a7227
|
|
BLAKE2b-256 checksum How to use checksums |
acbaff3f6b746cf8f97109b4e829cbd55a1ff5e0602c32061fe6c11ea54dafe4
|
| 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.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.