Official Python SDK for Koncile API
Project description
Koncile Python SDK
The official Python SDK for Koncile, providing a seamless interface to interact with the Koncile API.
Features
- Authentication and API key management
- File operations (upload, download, manage)
- Task management and status tracking
- Folder organization
- Template handling
- Field configuration
- Instruction management
- Document operations
Installation
You can install the Koncile SDK using pip:
pip install koncile
For development installation, we recommend using a virtual environment (optional but recommended to avoid dependency conflicts):
# Create and activate virtual environment (recommended)
python -m venv venv
source venv/bin/activate # On Windows use: .\venv\Scripts\activate
# Install the package
pip install koncile
Quick Start
import time
from typing import List
from koncile_sdk.client import KoncileAPIClient
from koncile_sdk.clients.tasks import TaskStatus
# Initialize the client
client = KoncileAPIClient(
api_key="your_api_key"
)
# Upload multiple files and get task IDs
files = [
"./invoices/invoice1.pdf",
"./invoices/invoice2.pdf"
]
upload_response = client.files.upload(
folder_id="folder_id",
template_id="template_id",
file_paths=files
)
# Get task IDs from the upload response
task_ids: List[str] = upload_response['task_ids']
# Poll for task completion
completed_tasks = []
while len(task_ids) != len(completed_tasks):
for i, task_id in enumerate(task_ids):
if i not in completed_tasks:
response = client.tasks.fetch_tasks_results(task_id)
# Check if task is complete
if response["status"] != TaskStatus.IN_PROGRESS.value:
completed_tasks.append(i)
if response["status"] == TaskStatus.DONE.value:
print(f"Task {task_id} completed successfully")
print("Results:", response["results"])
elif response["status"] == TaskStatus.FAILED.value:
print(f"Task {task_id} failed")
elif response["status"] == TaskStatus.DUPLICATE.value:
print(f"Task {task_id} detected as duplicate")
if len(task_ids) != len(completed_tasks):
time.sleep(1) # Wait before next polling iteration
Documentation
For detailed API documentation and guides, visit docs.koncile.ai.
Support
For support inquiries, please contact support@koncile.ai.
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
© 2025 Koncile. All rights reserved.
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 koncile-0.1.0.tar.gz.
File metadata
- Download URL: koncile-0.1.0.tar.gz
- Upload date:
- Size: 17.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90b570e308fbee1508854cafcd6b587975d03b9e51f17ce32f1857439ae60e1b
|
|
| MD5 |
61a65ded3027a24c3537b9201be87d5d
|
|
| BLAKE2b-256 |
a2640497d2fd97962b885928080be2ba582ae25654638e48a65b3e983b13e336
|
File details
Details for the file koncile-0.1.0-py3-none-any.whl.
File metadata
- Download URL: koncile-0.1.0-py3-none-any.whl
- Upload date:
- Size: 25.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94e4c08842819f84e2866e44193ab06a18b2a8021102128c0225ae1105edc55e
|
|
| MD5 |
345fcb15bdb0159d4e936f5fa0e7a8d8
|
|
| BLAKE2b-256 |
cf9abbab8f665add3aefeb06c1b43a2587a3a1c68a2876d704ed683cffb1b023
|