dsviper: Your Python Gateway to Viper
Strong-typed Python API over the Viper C++ runtime.
Strong Typing
Unlike Python's permissiveness, dsviper raises exceptions immediately on type mismatch. No silent failures.
# Type checking at construction
Value.create(Type.BOOL, 4)
# ViperError: expected type 'bool', got 'int'
# Range validation
Value.create(Type.INT8, 256)
# ViperError: value is not in the range of 'int8' Native Integration
Python natives (lists, dicts, tuples) are accepted as input. Metadata drives the conversion automatically.
# Python list → Viper Vector
Value.create(TypeVector(Type.INT64), [1, 2, 3])
# Let Viper infer the type
Value.deduce([1, 2, 3]) # → Vector<int64> What's Included
238 Classes
20 Domains
100% Type Hints
Types & Values
Complete type system: primitives, containers, structures, enums, variants.
Database
SQLite-backed persistence with transactions and schema migration.
Commit Engine
Version control for data. Branch, merge, history traversal.
Serialization
Binary and JSON codecs. Streaming support for large data.
Blobs
Binary large objects up to 2GB with content-addressed storage.
DSM Introspection
Runtime access to model metadata. Parse, assemble, introspect.
Quick Start
Installation
# Install from wheel
pip install dsviper-1.2.0-*.whl
# Verify installation
python3 -c "import dsviper; print(dsviper.version())"
# Output: (1, 2, 0) Basic Usage
from dsviper import *
# Create typed values
Value.create(Type.STRING, "hello")
Value.create(Type.INT64, 42)
Value.create(TypeVector(Type.INT64), [1, 2, 3])
# Open a CommitDatabase
db = CommitDatabase.open("model.cdb")
db.definitions().inject() # Inject type constants Start Building
Install dsviper and follow the tutorial to build your first application.