dsviper¶
The dsviper Python runtime is the strongly typed Python API over the
Viper C++ engine. It carries the type system, value system, commit DAG,
database tier, serialization, and RPC, and exposes them as Python classes
and functions. Most user code in the ecosystem imports dsviper and is
built on top of it.
dsviper is the runtime layer of the ecosystem. It consumes typed Python packages produced by Kibo (the static API), or loads DSM models directly at runtime (the dynamic API). See Value Chains for the broader picture and DevKit, dsviper, Viper — what’s what for how dsviper relates to DevKit and the Viper engine.
Place in the ecosystem¶
Depends on — Viper (the C++ engine — see DevKit, dsviper, Viper — what’s what).
Consumed by — dsviper-components (Qt Widgets and QML variants), dsviper-tools (Qt Widgets and QML variants), reference applications (
ge-py,ge-qml,dsviper-blender,web-cdbe).Source repository — the
dsviperPyPI package is built from the Viper source. There is no separatedsviperrepository on GitHub. See DevKit, dsviper, Viper — what’s what for the distinction between distribution names and repository names.Distribution — dsviper on PyPI (
pip install dsviper). Not bundled in the DevKit ZIP — the ZIP carries the toolchain (kibo, dsviper-tools, offline docs), butdsviperitself must be installed separately from PyPI.
Quickstart¶
Install:
pip install dsviper
Open a versioned database, write a typed value, commit:
from dsviper import CommitDatabase, CommitMutableState
import model.attachments as ma
db = CommitDatabase.open("model.cdb")
key = ma.Tuto_UserKey.create()
login = ma.Tuto_Login()
login.nickname = "alice"
state = CommitMutableState(db.initial_state())
ma.tuto_user_login_set(state.attachment_mutating(), key, login)
db.commit_mutations("Add user", state)
The model.attachments module above is a generated package — the
static API produced by Kibo from a DSM
model. For the dynamic API (no code generation, definitions loaded at
runtime), see DSM Processing.
The Metadata Everywhere Principle¶
Viper carries its type information as runtime metadata, and every subsystem
draws on the same source: types, values, functions, serialization, database
persistence, and RPC. You describe your data once — either through the
static API generated from a DSM model, or directly through the dynamic
API — and the runtime handles conversion, validation, and cross-language
interoperability for you. This is why Python natives (list, dict,
tuple) can be passed directly to typed dsviper functions: the
metadata drives the bridge, so there is nothing to register and nothing to
glue by hand.
Topics¶
API reference¶
The complete class reference is in API Reference, organised by domain: types, values, attachments, database, commit, blobs, serialization, DSM introspection, web rendering, and core utilities.
Status¶
Part of DevKit 1.2.x. The runtime is stable; new APIs are added carefully with backward compatibility in mind.