Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

condicio-0.1.4.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

condicio-0.1.4-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

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

Hashes for condicio-0.1.4.tar.gz
Algorithm Hash digest
SHA256 69515003cb7876ab5f9531ae3222dd49ac15043eb698fee7a2c27e02778e0faf
MD5 46bca3d0da44355597a45d96bb8064b2
BLAKE2b-256 e69a28d87ed717178dacea17a7e9e65915dc68267c41fcb0eb6a5efb18f5de2f

See more details on using hashes here.

Provenance

The following attestation bundles were made for condicio-0.1.4.tar.gz:

Publisher: publish.yml on docfide/condicio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for condicio-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6e9b6aad66c6a449287416be09e623d62d5d244c5cdd3d839367102ed3062433
MD5 e4f563991e0ee94cf8b132b1489699de
BLAKE2b-256 49e32857aedca4ff5543dde5fe68653d5f7bfd658138077811f33a870f620af3

See more details on using hashes here.

Provenance

The following attestation bundles were made for condicio-0.1.4-py3-none-any.whl:

Publisher: publish.yml on docfide/condicio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page