Qanuni SDK
Qanuni is an Arabic-first Python SDK for Saudi legal workflows.
It supports two usage styles in one package:
- direct legal tools for focused tasks
- workflows and a deterministic legal agent for harder multi-step matters
Install
python -m pip install --upgrade qanuni-sdk
Optional MCP support:
python -m pip install "qanuni-sdk[mcp]"
Quickstart
from qanuni import LegalClient
client = LegalClient()
result = client.contracts.gap_analysis(
contract_text="""
يلتزم الطرف الثاني بتنفيذ الأعمال،
ويتم السداد لاحقًا وفق ما يراه الطرف الأول مناسبًا،
ويجوز إنهاء العقد عند الحاجة.
""",
contract_type="service_agreement",
)
print(result.summary)
Workflow Example
workflow_result = client.workflow.contract_review(
document_text="""
اتفق الطرف الأول مع الطرف الثاني على تقديم خدمات تقنية،
ويتم السداد بعد الفاتورة، ويجوز إنهاء العقد عند الحاجة.
""",
contract_type="service_agreement",
)
print(workflow_result.executive_summary)
print(workflow_result.risk_level)
Agent Example
agent_result = client.agent.run(
goal="راجع العقد وحدد المخاطر ثم جهز تصورًا لمطالبة قانونية مناسبة.",
documents=[
{
"name": "contract.md",
"text": """
اتفق الطرف الأول مع الطرف الثاني على تقديم خدمات تقنية،
ويتم السداد بعد الفاتورة، ويجوز إنهاء العقد عند الحاجة.
""",
}
],
)
print(agent_result.status)
print(agent_result.answer_text)
Included Surfaces
- tools:
labor,legal,contracts,compliance,drafting,policies - workflows:
client.workflow - agent runtime:
client.agent - optional signed-license operations:
client.license - acceptance CLI and human-testing examples
- optional MCP server
Built-in Operational Features
- structured outputs
- cost estimation
- selective caching
- observability events
- dated agent logs
Optional Commands
qanuni-examples --list
qanuni-acceptance --list
qanuni-mcp-smoke --mode mocked
qanuni-mcp-server serve --host 127.0.0.1 --port 8088
Metadata
Release files for qanuni-sdk 0.3.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 |
|---|---|---|---|---|
| qanuni_sdk-0.3.0.tar.gz | 297.8 kB | Without provenance | Details for qanuni_sdk-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| qanuni_sdk-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for qanuni_sdk-0.3.0-py3-none-any.whl |
Total release size: 740.8 kB
Release files / qanuni_sdk-0.3.0.tar.gz
| Download URL | qanuni_sdk-0.3.0.tar.gz |
|---|---|
| Size | 297.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
55a368d034074ec70825701c4bb33ccdfdacdac7ab4fcf1fad837f070accbe59
|
|
BLAKE2b-256 checksum How to use checksums |
dd8c8712f1de15744593d2c40d538193d0a8fa328fc31fe5628431ac44dd261f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.5
|
Release files / qanuni_sdk-0.3.0-py3-none-any.whl
| Download URL | qanuni_sdk-0.3.0-py3-none-any.whl |
|---|---|
| Size | 443.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
71d81ef7b4246859cba0f121469980ac8d11b9562edf87209e9356c45676861f
|
|
BLAKE2b-256 checksum How to use checksums |
ef6ea4d61b2eb7c9a85b65d1ee94395621246323fc430e98592b0e5573e1ad51
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.5
|
Security for qanuni-sdk 0.3.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.