Core Utilities¶
Core classes for definitions, namespaces, paths, and utilities.
When to use: Use Definitions to register custom types, Path to
navigate nested structures, and Logging for debug output.
Quick Start¶
from dsviper import Definitions, NameSpace, ValueUUId, Path, LoggerConsole, Logging
# Create namespace for your types
ns = NameSpace(ValueUUId("f529bc42-0618-4f54-a3fb-d55f95c5ad03"), "MyApp")
# Create and register definitions
defs = Definitions()
# Paths navigate nested structures
path = Path.from_field("user").field("address").field("city").const()
city = path.at(document) # Get value at path
path.set(document, "Paris") # Set value at path
# Logging for debugging
logger = LoggerConsole(Logging.LEVEL_DEBUG)
log = logger.logging()
log.info("Application started")
log.error("Something went wrong")
Key Classes¶
Class |
Purpose |
Example |
|---|---|---|
|
Register custom types |
|
|
Group types by namespace |
|
|
Navigate nested data |
|
|
Debug output |
|
|
Parse error messages |
|
Definitions¶
A class used to register concept, club, enumeration, structure and attachment. |
|
A class used to retreive registered concepts, clubs, enumerations, structures and attachments. |
|
A class used to collect referenced types. |
|
DefinitionsInspector(definitions). |
|
A class use for INTERNAL DEVELOPMENT. |
|
A class used to represent the types exchanged during the synchronization of two databases. |
Namespace¶
A class used to describe a namespace. |
Paths¶
A class used to construct the location of a portion of a value. |
|
A class used to retreive a value from a Path. |
|
A class used to represent a component of a Path. |
|
A class used to represent the various information for an element of a set. |
|
A class used to represent various information for an entry of a map. |
Function Pools¶
A class used to call a C++ function. |
|
A class used to register and retreive C++ functions. |
|
A class used to represent the functions of a pool. |
|
A class used to represent the prototype of a function. |
Hashing¶
An interface to abstract a hasher. |
|
A class used to hash data with CRC32. |
|
A class used to hash data with MD5. |
|
A class used to hash data with SHA1. |
|
A class used to hash data with SHA256. |
|
A class used to hash a data with SHA3. |
Logging¶
An interface to emit a message. |
|
A class used to display a message on the console. |
|
A class used to display a message on the Python stdout. |
|
A class used to collect messages. |
|
A class used to discard messages. |
Remote Services¶
A class used to connect to a remote service. |
|
A class used to call a remote function. |
|
A class used to represent a remote function pool. |
|
A class used to represent a remote function. |
|
A class used to represent the functions of a pool. |
|
A class used to represent the remote function pools. |
|
A class used to call a remote attachment function. |
|
A class used to represent a remote attachment function pool. |
|
A class used to represent a remote attachment function. |
|
A class used to represent the remote attachment functions. |
|
A class used to represent the remote attachment pools. |
Utilities¶
A class used to represent an error raised by Viper. |
|
A class used to request a cancelation. |
|
A class used to represent a semaphore. |
|
A class used to represent a shared memory region. |
|
A class used to represent a shared memory region. |
|
A class used to handle float16 representation. |
|
A class used to generate a random value. |
|
A class used to collect keys, attachments and missing attachments for a key. |
|
A class used to get a name for a key from available attachments. |