Python tools for the Condicio contract intelligence schema
Project description
Condicio Python
Python tools for the Condicio contract intelligence schema.
- Validate Condicio documents against the JSON Schema
- Work with typed models — dataclasses for every schema type
- Serialize/deserialize to/from JSON and YAML
- CLI for validation and inspection
Install
pip install condicio
Usage
CLI
# Validate a Condicio document
condicio validate document.json
# Validate with verbose output
condicio validate document.json --verbose
# Load from YAML
condicio validate document.yaml
Python
from condicio.validator import validate_document
from condicio.models import CondicioDocument, Party, Obligation
# Validate a raw dict
with open("document.json") as f:
import json
data = json.load(f)
errors = validate_document(data)
if errors:
for err in errors:
print(f" {err.path}: {err.message}")
else:
print("Valid Condicio document")
# Deserialize to typed models
from condicio.models import document_from_dict
doc = document_from_dict(data)
print(f"Contract: {doc.contract.title}")
for party in doc.parties:
print(f" Party: {party.name} ({party.role})")
Schema URL
By default, the validator fetches the latest schema from:
https://raw.githubusercontent.com/docfide/condicio/main/schema/condicio.schema.json
You can pass a custom schema path or URL:
from condicio.validator import CondicioValidator
v = CondicioValidator(schema_path="path/to/condicio.schema.json")
errors = v.validate(data)
License
Apache 2.0
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 condicio-0.1.4.tar.gz.
File metadata
- Download URL: condicio-0.1.4.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69515003cb7876ab5f9531ae3222dd49ac15043eb698fee7a2c27e02778e0faf
|
|
| MD5 |
46bca3d0da44355597a45d96bb8064b2
|
|
| BLAKE2b-256 |
e69a28d87ed717178dacea17a7e9e65915dc68267c41fcb0eb6a5efb18f5de2f
|
Provenance
The following attestation bundles were made for condicio-0.1.4.tar.gz:
Publisher:
publish.yml on docfide/condicio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
condicio-0.1.4.tar.gz -
Subject digest:
69515003cb7876ab5f9531ae3222dd49ac15043eb698fee7a2c27e02778e0faf - Sigstore transparency entry: 1659743602
- Sigstore integration time:
-
Permalink:
docfide/condicio@ce02d4a7e005a70e46ff0fef5568d3c07d05b5fe -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/docfide
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ce02d4a7e005a70e46ff0fef5568d3c07d05b5fe -
Trigger Event:
push
-
Statement type:
File details
Details for the file condicio-0.1.4-py3-none-any.whl.
File metadata
- Download URL: condicio-0.1.4-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e9b6aad66c6a449287416be09e623d62d5d244c5cdd3d839367102ed3062433
|
|
| MD5 |
e4f563991e0ee94cf8b132b1489699de
|
|
| BLAKE2b-256 |
49e32857aedca4ff5543dde5fe68653d5f7bfd658138077811f33a870f620af3
|
Provenance
The following attestation bundles were made for condicio-0.1.4-py3-none-any.whl:
Publisher:
publish.yml on docfide/condicio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
condicio-0.1.4-py3-none-any.whl -
Subject digest:
6e9b6aad66c6a449287416be09e623d62d5d244c5cdd3d839367102ed3062433 - Sigstore transparency entry: 1659743680
- Sigstore integration time:
-
Permalink:
docfide/condicio@ce02d4a7e005a70e46ff0fef5568d3c07d05b5fe -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/docfide
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ce02d4a7e005a70e46ff0fef5568d3c07d05b5fe -
Trigger Event:
push
-
Statement type: