Python bindings for Prism — a structured file format your tools and agents can edit.
Project description
kinogaki — Python bindings for Prism
kinogaki is the Python binding for Prism, a structured file format your tools and agents can
edit. It is a thin, native layer over KinogakiCore (the C++ library) through its C ABI — the model
mirrors the C++ API one-to-one.
import kinogaki as kg
doc = kg.Document()
doc.append("/world", "group")
doc.append("/world/red", "material").set("out", (0.9, 0.15, 0.15))
doc.append("/world/ball", "object") \
.set("radius", 1.5) \
.set("albedo", (1, 1, 1))
doc.connect("/world/red.out", "/world/ball.albedo") # source output drives target input
text = kg.serialize(doc) # the .prisma (ASCII) bytes
again = kg.deserialize(text) # parse text or binary back
print(kg.evaluate(again, "/world/ball.albedo")) # (0.9, 0.15, 0.15) — through the connection
The API at a glance
kg.Document()— an ordered tree of typed prims plus the connections between their slots.doc.append(path, type) -> Handle— add a prim (its parent must exist); returns a chainable cursor.Handle.set(key, value)— author a typed property. The Prism type is inferred from the native value:bool/int/float/str, or a 2/3/6/32-length number sequence → float2/float3/matrix/spectrum.Handle.set_meta(key, value)— string metadata (non-animatable, separate from properties).doc.edit(path) -> Handle— a cursor for reading:get_float,get_int,get_bool,get_float2/3,get_str,get_meta(permissive, with defaults) andrequire_float,require_float3,require_str(strict — raisePrismError).doc.connect(source, target)— wire an output slot to an input slot (one source per target).doc.remove(path)·doc.rename(from, to)·doc.has(path)·doc.prim(path)·doc.prims().kg.serialize(doc, binary=False)·kg.deserialize(data)·kg.evaluate(doc, slot, time=0).
Values are native both ways — no wrapper objects.
Installing
The package ships a universal (arm64 + x86_64) native library, so there is nothing to compile:
pip install kinogaki
Building from source
Clone kinogaki/kinogaki-core as a sibling of this repo, then:
./build.sh # compiles KinogakiCore → kinogaki/_native/libkinogaki_core.dylib
python -m pip install -e . # editable install
python tests/test_kinogaki.py
KINOGAKI_CORE_LIB overrides which native library is loaded, if you keep it elsewhere.
License
The Prism file format is open and free to implement. The code in this repository is licensed under the Apache License 2.0; see LICENSE. "Kinogaki" is a trademark of Kinogaki LLC; see TRADEMARKS.md. Contributions are accepted under the Developer Certificate of Origin; see CONTRIBUTING.md.
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 Distributions
Built Distributions
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 kinogaki-0.1.0-py3-none-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: kinogaki-0.1.0-py3-none-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.1 MB
- Tags: Python 3, manylinux: glibc 2.26+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fbd4551062aa605f2abf341069f43f47bf673108d5cbf57912db217995360e87
|
|
| MD5 |
7f49f5a92fa0265745ce2fa90cd8f4d4
|
|
| BLAKE2b-256 |
db87af1fa14e305838f63a7fcc309c51a5fab9c18d86b8cc4309ff125fb5ddc2
|
File details
Details for the file kinogaki-0.1.0-py3-none-macosx_11_0_universal2.whl.
File metadata
- Download URL: kinogaki-0.1.0-py3-none-macosx_11_0_universal2.whl
- Upload date:
- Size: 515.7 kB
- Tags: Python 3, macOS 11.0+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53a0de1f80114fee0285b6a375e8a734c05b66f2b85670a6b2f7ca303ff00f53
|
|
| MD5 |
0f43622dce66311284109547adbf22bb
|
|
| BLAKE2b-256 |
a9c0cc9bc0db8de17edb33e25de5b7e560e1e8ad5ae31dfae045bced9b8b07ab
|