Skip to main content

kaiv — Python bindings

Python bindings for kaiv, an immutable structural type system for data at rest. The same Rust core the CLI and the playground wrap, surfaced pythonically: strings in, strings (or bytes) out, exceptions instead of error envelopes.

pip install kaiv

The pipeline

import kaiv

# Authored .kaiv -> canonical .daiv (compile + denormalize).
daiv = kaiv.build("host=api.example.com\n!int\nport=8080\n")

# Schema-aware build: defaults materialize, head types lift,
# authored units convert (exactly, or the build fails).
daiv = kaiv.build(
    "!float:km\n/trip::dist=42\n",
    schema=".!saiv acme/trip\n\n!float:m\n/trip::dist=\n",
)
assert "/trip::dist=42000" in daiv

# Validation: None on pass, kaiv.ValidationError on a verdict.
schema = ".!saiv demo/server\n.!types std/net\n\n&port\nport=\n"
kaiv.validate(kaiv.build("port=8080\n"), schema)

# Schema inference: a document to its authored .saiv.
saiv = kaiv.infer("host=x\nport=8080\n", "demo/server")

# The standard formatter.
canonical = kaiv.fmt("a  =  1\n")

The format hub

# Foreign text formats -> authored .kaiv.
k = kaiv.import_from("json", '{"host": "x", "port": 8080}')

# Canonical .daiv -> foreign formats. Text formats return str,
# binary formats (cbor, avro, asn1) return bytes.
j = kaiv.export_to("json", kaiv.build(k))
b = kaiv.export_to("cbor", kaiv.build(k))

# Foreign schemas -> authored .saiv (sound weakening):
# jsonschema | xsd | proto | avsc | graphql.
s = kaiv.import_schema("jsonschema", open("api.schema.json").read(),
                       "acme/api")

Individual pipeline stages

raiv = kaiv.compile(text)        # .kaiv -> .raiv (relational)
daiv = kaiv.denormalize(raiv)    # .raiv -> .daiv (canonical)
csaiv = kaiv.compile_schema(s)   # .saiv -> .csaiv (contract)

Errors raise kaiv.KaivError; validation verdicts raise kaiv.ValidationError (a subclass). kaiv.version() reports the bindings/core version.

The format is specified at kaiv.io/kaiv/spec/latest; resolution here is offline (the std/* libraries are embedded — registry-resolving builds belong to the CLI and kaiv db-class tooling).

License

MIT or Apache-2.0, at your option.

Download files

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

Source Distribution

kaiv-0.10.0.tar.gz (18.4 kB view details)

Uploaded Source

Built Distributions

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

kaiv-0.10.0-cp39-abi3-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.9+Windows x86-64

kaiv-0.10.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

kaiv-0.10.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.4 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

kaiv-0.10.0-cp39-abi3-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

kaiv-0.10.0-cp39-abi3-macosx_10_12_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file kaiv-0.10.0.tar.gz.

File metadata

  • Download URL: kaiv-0.10.0.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for kaiv-0.10.0.tar.gz
Algorithm Hash digest
SHA256 6186c629a6828828f830ef725fe6b0e037d28a8e409b963eaf92dc685dcb6316
MD5 5aed75f548f7685d7fe820b38f5c054a
BLAKE2b-256 05c0a212c5bec449da28d37b969048dd0ef0c34fc8c7d8da982974a348b37297

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaiv-0.10.0.tar.gz:

Publisher: publish-pypi.yml on deyanovich/kaiv-py

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

File details

Details for the file kaiv-0.10.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: kaiv-0.10.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for kaiv-0.10.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 af83a5797e176cd0f1550a6e91d6fb6f3a454232c74d3915b52f748d93c1de0d
MD5 63c830f0cdb7b8c9a272f8dda95beb1b
BLAKE2b-256 2e9ab9a5d22efb3e179d4bb9cb817662ac584d6addcb81124000ade8337d805b

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaiv-0.10.0-cp39-abi3-win_amd64.whl:

Publisher: publish-pypi.yml on deyanovich/kaiv-py

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

File details

Details for the file kaiv-0.10.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for kaiv-0.10.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7825c2c4289b82bb3de1836db4d8b6abd1af704a2b8d255b353b99d4197bc734
MD5 1b0e099e677c46e3b77e6de7a5691c2e
BLAKE2b-256 afac4a6d7fa0c99f5f308f1c7a8d5583d11779e57880dcb68af0790489287c24

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaiv-0.10.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish-pypi.yml on deyanovich/kaiv-py

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

File details

Details for the file kaiv-0.10.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for kaiv-0.10.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b1b3b426f6cdf1b6a1ec1dfe39a1b7e1e034f771e0de60d4d6df4c01bf8cf489
MD5 f45b0a72a92778029e458b4fbb4c2d6e
BLAKE2b-256 70c215f2b78324f36ae70e07cc283fc10bd3c7ccd6377f0ba07927ced4733f64

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaiv-0.10.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish-pypi.yml on deyanovich/kaiv-py

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

File details

Details for the file kaiv-0.10.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: kaiv-0.10.0-cp39-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 2.3 MB
  • Tags: CPython 3.9+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for kaiv-0.10.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e286c2060f3bc5a0bc1e0be32d0ed7cba99485e5e13df66708fd9a3dcc2d6663
MD5 c3c049eb602bbcf8dfe7548532acb34a
BLAKE2b-256 8caeffe2a2f8677fd14488bef5641d931afa47fbe3b66cd9b95bd8f91867f426

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaiv-0.10.0-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: publish-pypi.yml on deyanovich/kaiv-py

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

File details

Details for the file kaiv-0.10.0-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for kaiv-0.10.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 88a9ee95a7d07e67fb202120ba39e6d413c7cee5689524717fd59a42fa83a911
MD5 524092a00479476e39961ffdeb705c24
BLAKE2b-256 a595286951b9fbbbbfb0584473f896a83f40f9fd1615595145ae00062197efe7

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaiv-0.10.0-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: publish-pypi.yml on deyanovich/kaiv-py

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

Release history Release notifications | RSS feed

0.13.0

6 files

0.11.0

6 files

This release

0.10.0 This release

6 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page