API

class dsviper.Attachment

Not instantiable. A class used to represent an attachment.

create_document()

Return a new document.

create_key(instance_id=None)

Return a new key.

create_structure()

Create a new structure and may initialize it or raise.

description(namespace=None)

Return the description.

document_type()

Return the type of the document.

documentation()

Return the documentation.

identifier()

Return the identifier.

key_type()

Return the type of the key.

key_type_name()

Return the key’s TypeName.

keys_type()

Return the type of the key.

optional_document_type()

Return the type of the optional document.

representation(namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_key()

Return the type key<element_type>.

type_name()

Return the TypeName.

class dsviper.BlobArray(blob_layout, size)

A class used to reinterpret the blob of the internal BlobView as an array<blob_layout.data_type>.

blob()

Return the blob.

blob_layout()

Return the blob layout.

blob_view()

Return the BlobView.

static from_blob(module, /, blob_layout, blob)

Return a BlobBuffer from a layout and a blob.

class dsviper.BlobData

Not instantiable. A class used to represent the data associated with a blob during the synchronization of two databases.

blob()

Return the blob.

blob_id()

Return the identifier the blob.

blob_layout()

Return the layout of the blob.

size()

Return the size of the blob.

class dsviper.BlobEncoder(blob_layout)

A class used to encode a blob.

blob_layout()

Return the layout of the blob.

encoder_layout()

Return the encoder layout.

end_encoding()

Return the encoded blob.

write(value)

Write a value at the end of the blob. The parameter value is an int, a real or a tuple compatible with the layout.

class dsviper.BlobEncoderLayout

Not instantiable. A class used to represent the layout of one element. The blob is interpreted as an immutable vector<blob_layout>.

blob_layout()

Return the layout.

element_type()

Return the type of the element.

type()

Return the type of the value for an element.

class dsviper.BlobGetting

Not instantiable. An interface used to retreive blobs from a persistence layer.

blob(blob_id)

Return a blob or None.

blob_ids()

Return the set of blob_id.

blob_info(blob_id)

Return the info for the blob.

blob_infos(blob_ids)

Return a list of BlobInfo.

blob_statistics()

Return the statistics for blobs.

class dsviper.BlobIdMapper(definitions)

a class used for INTERNAL DEVELOPMENT.

has_key(key)

Return True if the key is present.

has_value(key)

Return True if the value is present.

set(key, value)

Set the mapping for a key to value.

value(value)

Return the mapped value.

class dsviper.BlobInfo

Not instantiable. A class used to represent various information of a blob in the persistence layer.

blob_id()

Return the identifier.

blob_layout()

Return the layout.

chunked()

Return True if the blob is greater than 2GB and requires the BlobIO API.

row_id()

Return the SQLite3 rowid.

size()

Return the size.

class dsviper.BlobLayout(data_type='uchar', components=1)

A class used to describe the layout of the element in a blob. data_type is ‘uchar’, ‘ushort’, ‘uint’, ‘ulong’, ‘char’, ‘short’, ‘int’, ‘long’, ‘half’, ‘float’ or ‘double’, and components is limited to 255. The default layout is ‘uchar-1’ (aka a BLOB).

byte_count()

Return the size of an element in bytes.

components()

Return the number of packed values in an element.

data_type()

Return the data type.

data_type_byte_count()

Return the size of the data type in bytes.

data_type_representation()

Return the data_type representation.

static parse(module, /, representation)

Return a BlobLayout by parsing the string ‘<data_type>-<components>’ ex: ‘uchar-1’, ‘float-2’, ‘float-3’, ‘half-4’, ‘double-16’.

representation()

Return a string representation.

class dsviper.BlobPack(descriptor)

A class used to implements memory regions in one blob.

blob()

Return the blob used to encode the blob pack.

check(name)

Return the BlobPackItem or raise.

static from_blob(module, /, blob)

Return a BlobPack from a blob or raise.

query(name)

Return the BlobPackItem or None.

regions()

Return a list of BlobPackItem.

class dsviper.BlobPackDescriptor

A class used to describe binary regions.

add_region(name, blob_layout, count)

Add and named region, where count is the number of elements defined by blob_layout type.

class dsviper.BlobPackRegion

Not instantiable. A class used for a region that implement the buffer protocol.

blob()

Return the blob used by the BlobPack.

blob_layout()

Return the blob layout.

byte_count()

Return the number of byte.

copy(buffer)

Copy the content of the buffer to the region.

count()

Return the number of element.

data_count()

Return the number of data.

name()

Return the name.

offset()

Return the offset in the blob.

class dsviper.BlobStatistics

Not instantiable. A class used to represent the statistics about blobs.

count()

Return the number of blobs.

max_size()

Return the size of the biggest blob in bytes.

min_size()

Return the size of the smallest blob in bytes.

total_size()

Return the total size in bytes.

class dsviper.BlobStream

Not instantiable. A class used to copy a huge blob (> 2GB) to a database.

Use the method database.blob_stream_create(blob_layout, size) to create a BlobStream, then the method database.blob_stream_append(…) to incrementally fill the content and finally the method database.blob_stream_close(…) to get the blob_id computed from the immutable content of the blob and its layout.

blob_id()

Return the identifier of the blob.

is_closed()

Return True if the stream is closed.

offset()

Return the current offset.

remaining()

Return the remaining bytes count to fill the blob.

class dsviper.BlobView(blob_layout, blob)

A class used to interpret the bytes of a blob from the layout.

blob()

Return the blob.

blob_layout()

Return the blob_layout.

count()

Return the number of elements in the blob.

data_count()

Return the number of data in the blob.

encoder_layout()

Return the encoder layout.

class dsviper.Cancelation

A class used to request a cancelation.

cancel()

request a cancelation.

requested()

Return True if a cancelation is requested.

class dsviper.Codec

Not instantiable. A class used to instantiate a codec.

Use the static factory method check(…) and query(…).

static check(module, /, name)

Return the StreamCodecInstancing interface of the codec or raise.

static query(module, /, name)

Return the StreamCodecInstancing interface of the codec or None.

class dsviper.Commit

Not instantiable. A class used to represent a commit.

action()

Return the action.

header()

Return the header.

class dsviper.CommitAction

Not instantiable. A class used to represent a commit for the evaluator.

commands()

Return the associated commands or None.

target_commit_id()

Return the commit_id of the target commit.

type()

Return the type.

class dsviper.CommitCommandDocumentSet

Not instantiable. A class used to represent the type and the arguments of a command.

arguments(definitions)

Return the tuple(attachment, key, value).

key()

Return the key.

type()

Return the type.

value()

Return the value.

class dsviper.CommitCommandDocumentUpdate

Not instantiable. A class used to represent the type and the arguments of a command.

arguments(definitions)

Return the tuple(attachment, key, path, value).

key()

Return the key.

path()

Return the path.

type()

Return the type.

value()

Return the value.

class dsviper.CommitCommandKey

Not instantiable. A class used to retreive the mutation commands for an instance of a concept for an attachment. Only used by the evaluator.

attachment_runtime_id()

Return the uuid assigned by the runtime.

concept_runtime_id()

Return the uuid assigned by the runtime for the concept’s type.

instance_id()

Return the uuid of the instance of the concept.

class dsviper.CommitCommandMapSubtract

Not instantiable. A class used to represent the type and the arguments of a command.

arguments(definitions)

Return the tuple(attachment, key, path, value).

key()

Return the key.

path()

Return the path.

type()

Return the type.

value()

Return the value.

class dsviper.CommitCommandMapUnion

Not instantiable. A class used to represent the type and the arguments of a command.

arguments(definitions)

Return the tuple(attachment, key, path, value).

key()

Return the key.

path()

Return the path.

type()

Return the type.

value()

Return the value.

class dsviper.CommitCommandMapUpdate

Not instantiable. A class used to represent the type and the arguments of a command.

arguments(definitions)

Return the tuple(attachment, key, path, value).

key()

Return the key.

path()

Return the path.

type()

Return the type.

value()

Return the value.

class dsviper.CommitCommandSetSubtract

Not instantiable. A class used to represent the type and the arguments of a command.

arguments(definitions)

Return the tuple(attachment, key, path, value).

key()

Return the key.

path()

Return the path.

type()

Return the type.

value()

Return the value.

class dsviper.CommitCommandSetUnion

Not instantiable. A class used to represent the type and the arguments of a command.

arguments(definitions)

Return the tuple(attachment, key, path, value).

key()

Return the key.

path()

Return the path.

type()

Return the type.

value()

Return the value.

class dsviper.CommitCommandXArrayInsert

Not instantiable. A class used to represent the type and the arguments of a command.

arguments(definitions)

Return the tuple(attachment, key, value, before_position, new_position).

before_position()

Return the before position.

key()

Return the key.

path()

Return the path.

position()

Return the position.

type()

Return the type.

class dsviper.CommitCommandXArrayRemove

Not instantiable. A class used to represent the type and the arguments of a command.

arguments(definitions)

Return the tuple(attachment, key, value, position).

key()

Return the key.

path()

Return the path.

position()

Return the position.

type()

Return the type.

class dsviper.CommitCommandXArrayUpdate

Not instantiable. A class used to represent the type and the arguments of a command.

arguments(definitions)

Return the tuple(attachment, key, path, position, value).

key()

Return the key.

path()

Return the path.

position()

Return the position.

type()

Return the type.

value()

Return the value.

class dsviper.CommitCommands

Not instantiable. A class used to retreive commands.

all_commands()

Return the list of all commands.

commands(attachment_runtime_id, key)

Return the list of commands associated with attachment_runtime_id and the key.

document_set_keys(attachment_runtime_id)

Return the set of CommitCommandKey of type ‘Document_Set’ associated with the attachment_runtime_id.

has_document_set(commit_command_key)

Return True if a command ‘Document_Set’ is associated with the commit_command_key.

class dsviper.CommitData

Not instantiable. A class used to represent data associated with a commit during the synchronization of two databases.

blob_ids(stream_codec_instancing, definitions)

Return the set of blob_id referenced by the commands.

commands(stream_codec_instancing, definitions)

Return the list of commands.

data()

Return the blob of the encoded commands.

header()

Return the header.

static sort(module, /, commit_datas)

Return the list of CommitDatas topologically sorted.

class dsviper.CommitDatabase(commit_databasing)

A Commit database keeps the history of mutations in a DAG of commit.

Use the static factory method create_in_memory(), create(…), open(…), connect(…) or connect_local(…).

all_commit_ids()

commit_all_ids($self) –

Return a set of commit_id for all commits.

blob(blob_id)

Return a blob or None.

blob_getting()

Return the BlobGetting interface.

blob_ids()

Return the set of blob_id of all available blobs.

blob_info(blob_id)

Return the information of the blob.

blob_infos(blob_ids)

Return a list of BlobInfo.

blob_statistics()

Return the statistics for blobs.

blob_stream_append(blob_stream, blob)

Append the blob to the stream.

blob_stream_close(blob_stream)

Return the computed blob_id and close the stream.

blob_stream_create(blob_layout, size)

Return a stream to fill a blob.

children_commit_ids(commit_id)

Return a set of commit_id for the children of the commit.

close()

Close the database.

codec_name()

Return the name of the codec.

commit(commit_id)

Return the commit.

commit_databasing()

Return the CommitDatabasing interface.

commit_exists(commit_id)

Return True if the commit exists.

commit_header(commit_id)

Return the header associated with the commit.

commit_ids(space_id)

Return a set of commit_id for all available commits.

commit_mutations(label, commit_mutable_state)

Create a new commit and return the commit_id.

static connect(module, /, host, service='54321')

Connect to a remote commit server.

static connect_local(module, /, socket_path)

Connect to a socket located at socket_path.

static create(module, /, file_path, *, documentation=None)

Create a database.

create_blob(blob_layout, blob)

Compute and return the blob_id for a blob and the layout.

create_blob_from_buffer()

create_blob_buffer($self, buffer) –

Compute and return the blob_id for a object implementing the buffer protocol.

static create_in_memory(module, /)

Create a database in memory.

definitions()

Return the definitions.

definitions_hexdigest()

Return the hexdigest of the definitions.

delete_commit(commit_id)

Delete a commit.

WARNING: It’s not a feature!, it’s a trick used during interactive presentation.

disable_commit(label, parent_commit_id, disabled_commit_id)

Return the commit_id of a new commit that disables another commit.

documentation()

Return the documentation.

enable_commit(label, parent_commit_id, enabled_commit_id)

Return the commit_id of the new commit that enables another commit.

enabled_by_commit_id(commit_id)

Return a dict[ValueCommitId, bool].

extend_definitions(other)

Extend the definitions.

fast_forward(commit_id)

Return the commit_id of the most plausible head.

first_commit_id(space_id)

Return the commit_id of the first commit or None.

forward(commit_id)

Return the commit_id of the uniq head or fast_forward.

head_commit_ids(space_id)

Return a set of commit_id for the available heads.

in_memory()

Return True if the database is in memory.

initial_state()

Return the initial state without any mutations.

is_ancestor(commit_id, descendant_id)

Return True if commit_id is a descendant of descendant_id.

is_closed()

Return True is the database is closed.

static is_compatible(module, /, file_path)

Return True if the SQL schema contains the required tables.

is_mergeable(parent_commit_id, merged_commit_id)

Return True if a merge is valid.

last_commit_id(space_id)

Return the commit_id of the last commit or None.

merge_commit(label, parent_commit_id, merged_commit_id)

Return the commit_id of the new commit that merges another commit.

nephew_commit_ids(commit_id)

Return a set of commit_id for the nephew of the commit.

static open(module, /, file_path, readonly=False)

Open a database.

path()

Return the path.

read_blob(blob_id, size, offset)

Return a region of the blob.

reduce_heads(space_id)

Reduce to a single head by iteratively merging heads, starting from the last_commit_id and return the new commit_id or None.

reset_commits(space_id)

Remove all commits except the first one.

WARNING: It’s not a feature!, it’s a trick used during interactive presentation.

space_id(commit_id)

Return a space ID of the commit or None.

space_ids()

Return a set of uuid for all available Commit Space.

state(commit_id)

Return a new state for a commit.

stream_codec_instancing()

Return the StreamCodecInstancing interface used to encode the binary data.

uuid()

Return the uuid.

class dsviper.CommitDatabaseRemote

Not instantiable. A low-level class used to represent a remote Commit database through the CommitDatabasing interface.

Use the high-level static factory method CommitDatabase.connect(…) or CommitDatabase.connect_local(…).

close()

Close the connection.

commit_databasing()

Return the CommitDatabasing interface.

static connect(module, /, host, service='54321')

Connect to a remote commit server.

static connect_local(module, /, socket_path)

Connect to the socket located at socket_path.

download_speed(size=1)

Return the download speed in MBps (Mega Bytes per second) The size is expressed in Mega Bytes [1-1000].

is_closed()

Return True if the server is closed.

ping()

Ping (latency is the technically more correct term) means the time it takes for a small data set to be transmitted from your device to a server and back to your device again. The ping time is measured in milliseconds (ms).

upload_speed(size=1)

Return the upload speed in MBps (Mega Bytes per second) The size is expressed in Mega Bytes [1-1000].

class dsviper.CommitDatabaseSQLite

Not instantiable. A low-level class used to represent the database based on SQLite3 through the CommitDatabasing interface.

Use the high-level static factory method CommitDatabase.create(…) or CommitDatabase.open(…).

begin_transaction()

Create a transaction to boost the creation of many blobs.

close()

Close the database.

commit()

Commit the transaction.

commit_databasing()

Return the CommitDatabasing interface.

static create(module, /, file_path, *, documentation=None)

Create a database.

static create_in_memory(module, /)

Create a database in memory.

in_transaction()

Return True if a transaction is running.

is_closed()

Return True if the database is closed.

static is_compatible(module, /, file_path)

Return True if the SQL schema contains the required tables.

static open(module, /, file_path, readonly=False)

Open a database.

rollback()

Roll back the transaction.

sqlite()

Return a SQLite.

class dsviper.CommitDatabaseServer(database_path, socket, logging, cancelation)

A CommitDatabaseServer provide network access to a CommitDatabase.

finish()

block until all client thread handle the cancelation request.

start()

Open a database.

step(timeout_in_sec=1)

accept new connection in a non blocking way.

class dsviper.CommitDatabasing

Not instantiable. An interface used to abstract the implementation of the persistence layer for a Commit database. This is a low-level interface (a driver) and requires a deep understanding of Commit to be used correctly.

all_commit_ids()

commit_all_ids($self) –

Return a set of commit_id for all commits.

begin_transaction(mode='Deferred')

Begin a transaction where the mode is ‘Deferred’, ‘Immediate’ or ‘Exclusive’.

blob(blob_id)

Return a blob or None.

blob_datas(blob_ids)

Return a list of BlobData.

blob_ids()

Return a set of blob_id for all available blobs.

blob_info(blob_id)

Return the information of a blob.

blob_infos(blob_ids)

Return a list of BlobInfo.

blob_statistics()

Return the statistics for blobs.

blob_stream_close(stream_id, blob_id)

Close the stream.

blob_stream_create(blob_layout, size)

Return the uuid of the stream.

blob_stream_delete(stream_id)

Delete the stream.

blob_stream_write(stream_id, blob, offset)

Write a region of the blob.

children_commit_ids(commit_id)

Return the set of commit_id for the children of the commit.

close()

Close the connection.

codec_name()

Return the name of the codec.

commit()

Commit the transaction.

commit_data(commit_id)

Return a CommitData or None.

commit_datas(commit_ids=None)

Return the list of CommitData.

commit_exists(commit_id)

Return True if the commit exists.

commit_header(commit_id)

Return the header of the commit associated with the commit_id.

commit_ids(space_id)

Return the set of commit_ids for the space.

create_blob(blob_id, blob_layout, blob)

Create a blob.

create_blobs(blob_datas)

Create blobs from a list of BlobDatas and return a set of blob_id.

create_commit_data(commit_data)

Create a commit if not present or return False.

create_zero_blob(blob_id, blob_layout, size)

Return the True if the blob was created.

data_version()

Return the data version.

definitions()

Return the definitions.

definitions_hexdigest()

Return the hexdigest of the definitions.

delete_commit(commit_id)

Delete a commit.

WARNING: It’s not a feature!, it’s a trick used during interactive presentation.

documentation()

Return the documentation.

extend_definitions(other)

Extend the definitions.

first_commit_id(space_id)

Return the commit_id of the first commit or None.

freeze_blob(blob_id)

Return True if the blob was frozen.

head_commit_ids(space_id)

Return the set of commit_id for the heads.

in_transaction()

Return True if a transaction is running.

is_closed()

Return True is the connection to the database is closed.

last_commit_id(space_id)

Return the commit_id of the last commit or None.

nephew_commit_ids(commit_id)

Return the set of commit_id for the nephew of the commit.

path()

Return the path.

read_blob(blob_id, size, offset)

Return the blob at offset.

reset_commits(space_id)

Remove all commits except the first one.

WARNING: It’s not a feature!, it’s a trick used during interactive presentation.

rollback()

Roll back the transaction.

space_id(commit_id)

Return a space ID of the commit or None.

space_ids()

Return a set of uuid for all available Commit Space.

sync_data(commit_ids)

Return a CommitSyncData.

unknown_blob_ids(blob_ids)

Return a set of blob_id for all unknown blobId found in blob_ids.

uuid()

Return the uuid.

write_blob(blob_id, blob, offset)

Write a blob at offset.

class dsviper.CommitEvalAction

Not instantiable. A class used by the evaluator to reconstruct a value by executing mutation commands.

commands()

Return the commands.

enabled()

Return True if the commit is enabled.

header()

Return the header of the commit.

class dsviper.CommitFunctionPool

Not instantiable. A class used to register and retreive C++ commit function.

check(func_name)

Return the function or raise.

documentation()

Return the documentation.

funcs

all functions.

name()

Return the name.

query(func_name)

Return the function or None.

uuid()

Return the uuid.

class dsviper.CommitFunctionPoolFunctions

Not instantiable. A class used to represent the functions of a pool.

class dsviper.CommitGetting

Not instantiable. An interface used to retreive a value (aka document) from a state or a mutable state.

attachment(attachment_runtime_id)

Return the attachment or raise.

definitions()

Return the definitions.

static diff_keys(self, /, current_commit_getting, other_commit_getting, attachment)

Return the tuple (added_keys, removed_keys, different_keys, same_keys). - added_keys: keys present in ‘other’ and not in ‘current’. - removed_keys: keys present in ‘current’ and not in ‘other’. - different_keys: reflects documents present in ‘current’ and in

‘other’ but are not equals.

  • same_keys: reflects documents present in ‘current’ and in ‘other’ that are equals.

document_getting()

Return the DocumentGetting interface.

enumerate(attachment, *, encoded=True)

Return a list of (key, document).

get(attachment, key)

Return an optional<document_type> associated with the key in the attachment.

has(attachment, key)

Return True if a document is present for the key.

keys(attachment)

Return all keys.

class dsviper.CommitGettingFunction

Not instantiable. A class used to call a C++ commit function.

documentation()

Return the documentation.

prototype()

Return the prototype.

class dsviper.CommitHeader

Not instantiable. A class used to represent the header of a commit.

commit_id()

Return the commit_id of the commit.

commit_type()

Return the type (‘Mutations’, ‘Disable’, ‘Enable’ or ‘Merge’).

label()

Return the label.

parent_commit_id()

Return the commit_id of the parent commit.

space_id()

Return the space_id.

target_commit_id()

Return the commit_id of the target commit.

timestamp()

Return the timestamp.

class dsviper.CommitMutableState(commit_state)

A class used to register the mutations of a value executed through the CommitMutating interface.

commit_getting()

Return the CommitGetting interface.

commit_mutating()

Return the CommitMutating interface.

commit_state()

Return the CommitState.

document_getting()

Return the DocumentGetting interface.

mutations()

Return the commands for the current mutations.

class dsviper.CommitMutating

Not instantiable. An interface used to express fine-grained mutations of a value.

attachment(attachment_runtime_id)

Return the attachment or raise.

definitions()

Return the definition.

diff(attachment, key, value, *, recursive=False)

Applies the mutation commands from the calculation of the difference between the value passed in parameter and the current value in the state. If recursive is True, the difference is recursively computed by structure’s field.

enumerate(attachment, *, encoded=True)

Return the list (key, document).

get(attachment, key)

Return an optional<document_type> associated with the key.

has(attachment, key)

Return True if a document is associated with the key.

insert_in_xarray(attachment, key, path, before_position, new_position, value)

Insert a value by creating a new_position before before_position.

keys(attachment)

Return all keys.

remove_in_xarray(attachment, key, path, position)

Remove the position.

set(attachment, key, value)

Associate the document with the key.

subtract_in_map(attachment, key, path, value)

Form the subtraction between the map located at path in the document associated with the key and the value.

subtract_in_set(attachment, key, path, value)

Form the subtraction between the set at path in the document associated with the key and the value.

union_in_map(attachment, key, path, value)

Form the union between the map located at path in the document associated with the key and the value.

union_in_set(attachment, key, path, value)

Form the union between the set at path in the document associated with key and the value.

update(attachment, key, path, value)

Update the value located at path in the document associated with the key.

update_in_map(attachment, key, path, value)

Form the subtraction between the map located at path in the document associated with the key and the value.

update_in_xarray(attachment, key, path, position, value)

Update the value at position.

class dsviper.CommitMutatingFunction

Not instantiable. A class used to call a mutable C++ commit function.

documentation()

Return the documentation.

prototype()

Return the prototype.

class dsviper.CommitNode

Not instantiable. A class used to represent a node in the commit DAG.

static build(module, /, commit_database)

Create and return the DAG of commit.

children()

Return the list of childs.

header()

Return the header.

class dsviper.CommitNodeGrid

Not instantiable. A class used to represent the location of a commit node in the grid.

child_count()

Return the number of children.

children()

Return the list of childs.

column()

Return the column.

commit_id()

Return the commitId.

has_children()

Return true if the node have children.

header()

Return the header.

parent()

Return the parent or None.

row()

Return the row.

class dsviper.CommitNodeGridBuilder

Not instantiable. A class used to build the grid layout of the commit DAG.

static build(module, /, commit_node)

Create and return the builder.

column_max()

Return the max index for a column.

nodes()

Return a dict[uuid, CommitNodeGrid].

root()

Return the root node or None.

row_max()

Return the max index for row.

class dsviper.CommitSpace

Not instantiable. A utility class to handle Commit Space.

class dsviper.CommitState

Not instantiable. A class used to represent data at a specific commit.

Use the CommitGetting interface to retrieve value by key from attachments.

cache_hit_rate()

Return the cache hit rate.

cache_hits()

Return the count of value return from the cache.

cache_preload()

Return the tuple time to get all documents.

cache_requests()

Return the count of value requested.

commit_getting()

Return the CommitGetting interface.

commit_id()

Return the identifier of the commit.

definitions()

Return the definitions.

document_getting()

Return the DocumentGetting interface.

enabled_commands()

Return the list of enabled commands.

eval_actions()

Return a list of CommitEvalAction.

class dsviper.CommitStore

A high-level application class used to implement the store, dispatch, undo/redo and notification concepts inspired by the redux approach.

The implementation used a Commit database for the persistence layer.

can_redo()

Return True if the store can redo.

can_undo()

Return True if the store can undo.

clear_undo_redo()

clear the undo redo stack.

close()

Close the database.

commit_getting()

Return the CommitGetting interface of the current state or raise.

commit_mutations(label, commit_mutable_state)

Commit the mutations tracked by the mutable state.

database()

Return the Commit database.

definitions()

Return the definitions.

delete_commit(commit_id)

Delete a commit.

WARNING: It’s not a feature!, it’s a trick used during interactive presentation.

disable_commit(commit_id)

Disable a commit.

dispatch(label, callable, *args)

Dispatch a callable.

dispatch_diff(label, attachment, key, value, *, recursive=False)

Dispatch a mutating command diff(…).

dispatch_enable_commit(commit_id, enabled)

Dispatch the act of enabling/disabling a commit.

dispatch_set(label, attachment, key, value)

Dispatch a mutating command set(…).

dispatch_update(label, attachment, key, path, value)

Dispatch a mutating command update(…).

enable_commit(commit_id)

Enable a commit.

extend_definitions(definitions)

Extend the database definitions and notify.

forward()

Move to the most plausible head.

has_database()

Return True if the store uses a database.

static instance(module, /)

Return the singleton.

merge_commit(commit_id)

Merge a commit.

mutable_state()

Return a new mutable state for the current state.

notifier()

Return the notifier or None.

notify_database_did_close()

Send a notification to inform that the database was closed.

notify_database_did_open()

Send a notification to inform that the database was opened.

notify_definitions_did_change()

Send a notification to inform that the definitions has changed.

notify_dispatch_error(error)

Send a notification to inform that an error occurred during a dispatch.

notify_state_did_change()

Send a notification to inform that the current state has changed.

notify_stop_live()

Send a notification to stop the live mode.

redo()

Implement the undo idiom for a Commit database.

reduce_heads()

Reduce to a single head by iteratively merging heads, starting from the last_commit_id.

reset()

Remove all commits except the first one.

WARNING: It’s not a feature!, it’s a trick used during interactive presentation.

reset_undo_redo()

Reset the undo redo stack.

set_notifier(notifier)

Set the notifier.

state()

Return the current state or raise.

undo()

Implement the undo idiom for a Commit database.

undo_stack_ids()

Return (commit_ids, current_commit_id).

use(commit_database)

Use a Commit database.

use_commit(commit_id)

Use a commit.

class dsviper.CommitStoreBaseNotifying

Not instantiable. An interface used to represent the notification emitted by a store.

static create(module, /, object)

Return a new CommitStoreStoringBaseNotifying if the Python object responds to the interface or raise.

notify_database_did_close()

Send a notification to inform that the database was closed.

notify_database_did_open()

Send a notification to inform that the database was opened.

notify_database_will_reset()

Send a notification to inform that the database will be reset.

notify_definitions_did_change()

Send a notification to inform that the definitions have changed.

notify_dispatch_error(error)

Send a notification to inform that an error occurred during a dispatch.

notify_state_did_change()

Send a notification to inform that the current state has changed.

notify_stop_live()

Send a notification to inform that the definitions have changed.

class dsviper.CommitSyncData

Not instantiable. A class used to represent data exchanged during the synchronization of two databases.

codec_name()

Return the name of the codec.

commit_datas()

Return the list of CommitData.

definitions_hexdigest()

Return the hexdigest of the definitions.

class dsviper.CommitSynchronizer(source, target, mode='Sync', size_of_packed_blobs=25_000_000)

A class used to synchronize two concrete databases through the CommitDatabasing interface (low-level driver interface).

mode()

Return the mode.

size_of_packed_blobs()

Return the size of the blob used to pack smaller blobs together.

source()

Return the CommitDatabasing interface for the source.

sync(logging=None)

Synchronize the content of the source and the target.

target()

Return the CommitDatabasing interface for the target.

class dsviper.CommitSynchronizerInfo

Not instantiable. A class used to represent data exchanged during the synchronization of two databases.

fetch()

Return information for fetched resources.

need_transmit()

Return True if the synchronization requires exchanging data.

push()

Return information for pushed resources.

updated_definitions()

Return True if the definitions has updated.

class dsviper.CommitSynchronizerInfoTransmit

Not instantiable. A class used to represent statistics of data exchanged during the synchronization of two databases.

blob_bytes()

Return the number of bytes for blobs.

blobs()

Return the number of blobs.

commit_bytes()

Return the number of commit bytes fetched.

commits()

Return the number of commits fetched.

extend_info()

Return the information to extend.

class dsviper.DSMAttachment

Not instantiable. A class used to represent the definition of an attachment.

document_type()

Return the type reference of the document.

documentation()

Return the documentation.

identifier()

Return the identifier.

key_type()

Return the type reference of the key.

representation()

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_name()

Return the TypeName.

class dsviper.DSMBuilder

A class used to assemble a collection of DSM Definitions from various sources.

append(source, content)

Append a content from a source.

static assemble(module, /, path)

Return a DSMBuilder with the concatenated content of the DSM files found at the path where the path is a file or a folder.

content()

Return the content.

line_offset()

Return the line offset.

parse()

Parse and return (DSMParseReport, DSMDefinitions, Definitions).

part(line)

Return the part associated with the line number.

parts()

Return the list of parts.

class dsviper.DSMBuilderPart

Not instantiable. A class used to represent a part of the assembled definitions.

line_end()

Return the line end.

line_start()

Return the line start.

source()

Return the source.

class dsviper.DSMClub

Not instantiable. A class used to represent the definition of a club.

documentation()

Return the documentation.

members()

Return the list of members.

runtime_id()

Return the uuid assigned by the runtime.

type_name()

Return the TypeName.

type_reference()

Return the type reference.

class dsviper.DSMCommitFunction

Not instantiable. A class used to represent the definition of a commit function.

documentation()

Return the documentation.

is_mutable()

Return True if the function is mutable.

prototype()

Return the prototype.

class dsviper.DSMCommitFunctionPool

Not instantiable. A class used to represent the definition of a commit function pool.

documentation()

Return the documentation.

functions()

Return the list of functions.

name()

Return the name.

uuid()

Return the uuid.

class dsviper.DSMConcept

Not instantiable. A class used to represent the definition of a concept.

documentation()

Return the documentation.

parent()

Return the type reference of the parent concept or None.

runtime_id()

Return the uuid assigned by the runtime.

type_name()

Return the TypeName.

type_reference()

Return the type reference.

class dsviper.DSMDefinitions

Not instantiable. A class used to represent DSM definitions. Available representations are plain-text, HTML, JSON, Bson, binary.

Use the static factory method to get the definitions from various representation.

attachments()

Return the list of attachments.

static bson_decode(module, /, blob)

Return a DSMDefinitions from a bson encoded blob.

bson_encode()

Return the definitions in bson.

clubs()

Return the list of clubs.

commit_function_pools()

Return the list of commit function pools.

concepts()

Return the list of concepts.

static decode(module, /, blob, *, stream_codec_instancing=None)

Return the decoded DSMDefinitions with a StreamTokenBinaryCodec if not specified.

encode(*, stream_codec_instancing=None)

Return the blob that encodes the definitions with a StreamTokenBinaryCodec if not specified.

enumerations()

Return the list of enumerations.

static from_commit_function_pool(module, /, commit_function_pool, definitions)

Convert to DSM Definitions.

static from_definitions(module, /, definitions)

Convert to DSM Definitions.

static from_function_pool(module, /, function_pool, definitions)

Convert to DSM Definitions.

function_pools()

Return the list of function pools.

static json_decode(module, /, json_string)

Return a DSMDefinitions from a JSON encoded string.

json_encode(indent=None)

Encode and return the definitions in a JSON encoded string. If indent is specified, the string is pretty printed.

static read(module, /, stream_reading)

Return a DSMDefinitions.

structures()

Return the list of structures.

to_definitions()

Return a Definitions by converting all DSM definitions.

to_dsm(show_documentation=True, show_runtime_id=False, html=False, attachments=None)

Return the definitions in the DSM language (DSL) sorted by attachment dependencies. All attachments are used, if the parameter attachments is not specified or empty.

write(stream_writing)

Write the definitions with the StreamWriting interface.

class dsviper.DSMDefinitionsInspector

DSMDefinitionsInspector(definitions). A class used to retrieve registered concepts, clubs, enumerations, structures from TypeName and attachments from identifier.

attachment_identifiers()

Return the set of identifiers for all attachments.

check_attachment(identifier)

Return the attachment or raise.

check_club(type_name)

Return the club or raise.

check_commit_function_pool(uuid)

Return the commit function pool or raise.

check_concept(type_name)

Return the concept or raise.

check_enumeration(type_name)

Return the enum or raise.

check_function_pool(uuid)

Return the function pool or raise.

check_structure(type_name)

Return a struct or raise.

club_type_names()

Return the set of TypeName for all clubs.

commit_function_pool_ids()

Return the set of uuid for all function pools.

concept_type_names()

Return the set of TypeName for all concepts.

enumeration_type_names()

Return the set of TypeName for all enums.

function_pool_ids()

Return the set of uuid for all function pools.

name_spaces()

Return the set of NameSpace for all TypNames.

query_attachment(identifier)

Return the attachment or None.

query_club(type_name)

Return the club or None.

query_commit_function_pool(uuid)

Return the commit function pool or None.

query_concept(type_name)

Return the concept or None.

query_enumeration(type_name)

Return the enum or None.

query_function_pool(uuid)

Return the function pool or None.

query_structure(type_name)

Return a struct or None.

representation(type_name)

Return the shortest representation of the TypeName.

structure_type_names()

Return the set of TypeName for all structs.

class dsviper.DSMEnumeration

Not instantiable. A class used to represent the definition of an enum.

documentation()

Return the documentation.

members()

Return the list of members.

runtime_id()

Return the uuid assigned by the runtime.

type_name()

Return the TypeName.

type_reference()

Return the type reference.

class dsviper.DSMEnumerationCase

Not instantiable. A class used to represent the definition of a case for an enum.

documentation()

Return the documentation.

name()

Return the name.

class dsviper.DSMFunction

Not instantiable. A class used to represent the definition of a function.

documentation()

Return the documentation.

prototype()

Return the prototype.

class dsviper.DSMFunctionPool

Not instantiable. A class used to represent the definition of a function pool.

documentation()

Return the documentation.

functions()

Return the list of functions.

name()

Return the name.

uuid()

Return the uuid.

class dsviper.DSMFunctionPrototype

Not instantiable. A class used to represent the definition of a function prototype.

name()

Return the name.

parameters()

Return the list of parameters.

return_type()

Return the type of the returned value.

class dsviper.DSMLiteralList

Not instantiable. A class used to represent the definition of a literal list.

members()

Return the list of members.

class dsviper.DSMLiteralValue

Not instantiable. A class used to represent the definition of a literal value.

domain()

Return the domain.

value()

Return the value.

class dsviper.DSMParseError

Not instantiable. A class used to represent a parse error.

line()

Return the line number.

message()

Return the message.

pos()

Return the position in the line.

source()

Return the source.

class dsviper.DSMParseReport

Not instantiable. A class used to collect the error occurred while parsing the assembled definitions.

errors()

Return the list of errors.

has_error()

Return True if errors were occurred.

class dsviper.DSMStructure

Not instantiable. A class used to represent the definition of a struct.

documentation()

Return the documentation.

fields()

Return the list of fields.

runtime_id()

Return the uuid assigned by the runtime.

type_name()

Return a TypeName.

type_reference()

Return the type reference.

class dsviper.DSMStructureField

Not instantiable. A class used to represent the definition of a field for a struct.

default_value()

Return the default value.

documentation()

Return the documentation.

name()

Return the name.

type()

Return the type.

class dsviper.DSMTypeKey

Not instantiable. A class used to represent the type key<element_type>.

element_type()

Return type the element.

class dsviper.DSMTypeMap

Not instantiable. A class used to represent the type map<key_type, element_type>.

element_type()

Return the type of the element.

key_type()

Return the type of the key.

class dsviper.DSMTypeMat

Not instantiable. A class used to represent the type vec<element_type, columns, rows>.

columns()

Return the number of columns.

element_type()

Return the type of element.

rows()

Return the number of rows.

class dsviper.DSMTypeOptional

Not instantiable. A class used to represent the type optional<element_type>.

element_type()

Return the type of the element.

class dsviper.DSMTypeReference

Not instantiable. A class used to represent a reference to a type.

domain()

Return the domain.

type_name()

Return a TypeName.

class dsviper.DSMTypeSet

Not instantiable. A class used to represent the type set<element_type>.

element_type()

Return the type of element.

class dsviper.DSMTypeTuple

Not instantiable. A class used to represent the type tuple<T0, …>.

types()

Return the list of types.

class dsviper.DSMTypeVariant

Not instantiable. A class used to represent the type variant<T0, …>.

types()

Return the list of types.

class dsviper.DSMTypeVec

Not instantiable. A class used to represent the type vec<element_type, size>.

element_type()

Return the type of element.

size()

Return the size.

class dsviper.DSMTypeVector

Not instantiable. A class used to represent the type vector<element_type>.

element_type()

Return type of element.

class dsviper.DSMTypeXArray

Not instantiable. A class used to represent the type xarray<element_type>.

element_type()

Return type of element.

class dsviper.Database

Not instantiable. A Database is a CRUD like transactional database.

Use the static factory method create_in_memory(), create(…), open(…), connect(…) or connect_local(…).

begin_transaction(mode='Deferred')

Begin a transaction where the mode is ‘Deferred’, ‘Immediate’ or ‘Exclusive’.

blob(blob_id)

Return a blob or None.

blob_getting()

Return the BlobGetting interface.

blob_ids()

Return the set of blob_id.

blob_info(blob_id)

Return the information for the blob or None.

blob_infos(blob_ids)

Return a list of BlobInfo.

blob_statistics()

Return the statistics for blobs.

blob_stream_append(blob_stream, blob)

Append a blob to the stream.

blob_stream_close(blob_stream)

Return the computed blob_id and close the stream.

blob_stream_create(blob_layout, size)

Return a stream to fill a blob.

close()

Close the database.

codec_name()

Return the name of the codec.

commit()

Commit the transaction.

static connect(module, /, database, host, service='54322')

Connect to a server and use the database.

static connect_local(module, /, database, socket_path)

Connect to socket_path and use the database.

static create(module, /, file_path, *, documentation=None)

Create and return a database.

create_blob(blob_layout, blob)

Create the blob and return the blob_id.

create_blob_from_buffer()

create_blob_buffer($self, buffer) –

Compute and return the blob_id for a object implementing protocol buffer.

static create_in_memory(module, /)

Create and return a database in memory.

static databases(module, /, host, service='54322')

Connect to a server and return the list of databases.

static databases_local(module, /, socket_path)

Connect to a server and return the list of databases.

databasing()

Return the Databasing interface.

definitions()

Return the definitions.

definitions_hexdigest()

Return the hexdigest of the definitions.

del_blob(blob_id)

Return True if the blob was deleted.

delete(attachment, key)

Return True if the value was deleted.

document_getting()

Return the DocumentGetting interface.

documentation()

Return the documentation.

extend_definitions(definitions)

Extend the definitions.

get(attachment, key)

Return and optional<document_type> associated with the key.

has(attachment, key)

Return True if a document is present for the key.

in_memory()

Return True if the database is in memory.

in_transaction()

Return True if a transaction is running.

is_closed()

Return True if the database is closed.

static is_compatible(module, /, file_path)

Return True if the SQL schema contains required tables.

keys(attachment)

Return the set of all keys.

static open(module, /, file_path, readonly=False)

Open and return a database.

path()

Return the path.

read_blob(blob_id, size, offset)

Return the blob at offset.

rollback()

Roll back the transaction.

set(attachment, key, value)

Assigns the value to the key.

uuid()

Return the uuid.

class dsviper.DatabaseRemote

Not instantiable. A low-level class used to access a CRUD like database from a remote repository through the Databasing interface.

Use the high-level static factory method Database.connect(…) or Database.connect_local(…).

Use the high-level static method Database.databases(…) or Database.databases_local(…) to retrieve the list of the databases from a server.

close()

Close the database.

static connect(module, /, database, host, service='54322')

Connect to a server and use the database.

static connect_local(module, /, database, socket_path)

Connect to socket_path and use the database.

databases(host, service='54322')

Connect to a server and return the list of databases.

databases_local(socket_path)

Connect to a server and return the list of databases.

databasing()

Return the Databasing interface.

is_closed()

Return True the connection is closed.

class dsviper.DatabaseSQLite

Not instantiable. A low-level class used to represent a CRUD like database based on SQLite3 through the Databasing interface.

Use the high-level static factory method Database.create_in_memory(), Database.create(…) or Database.open(…).

close()

Close the database.

static create(module, /, file_path, *, documentation=None)

Create and return a database.

static create_in_memory(module, /)

Create and return a database in memory.

databasing()

Return the Databasing interface.

is_closed()

Return True if the database is closed.

static is_compatible(module, /, file_path)

Return True the SQL schema contains required tables.

static open(module, /, file_path, readonly=False)

Open and return a database.

sqlite()

Return the sqlite api.

class dsviper.Databasing

Not instantiable. An interface used to abstract the implementation of the persistence layer for a CRUD like database.

begin_transaction(mode='Deferred')

Begin a transaction where the mode is ‘Deferred’, ‘Immediate’ or ‘Exclusive’.

blob(blob_id)

Return a blob or None.

blob_ids()

Return the set of blob_id of all blobs.

blob_info(blob_id)

Return the information for the blob or None.

blob_infos(blob_ids)

Return a list of BlobInfo.

blob_statistics()

Return the statistics for blobs.

blob_stream_close(stream_id, blob_id)

Close the stream.

blob_stream_create(blob_layout, size)

Return the uuid of the stream.

blob_stream_delete(stream_id)

Delete the stream.

blob_stream_write(stream_id, blob, offset)

write a region of the blob.

close()

Close the database.

codec_name()

Return the name of the codec.

commit()

Commit the transaction.

create_blob(blob_layout, blob)

Create the blob and return the blob_id.

create_zero_blob(blob_id, blob_layout, size)

Return the True if the blob was created.

data_version()

Return the data version.

definitions()

Return the definitions.

definitions_hexdigest()

Return the definitions.

del_blob(blob_id)

Return True if the blob was deleted.

delete(attachment, key)

Return True if the value was deleted.

documentation()

Return the documentation.

extend_definitions(other)

Extend the definitions.

freeze_blob(blob_id)

Return True if the blob was frozen.

get(attachment, key)

Return an optional<document_type> associated with the key.

has(attachment, key)

Return True if a value is present for the key.

in_transaction()

Return True if a transaction is running.

is_closed()

Return True if the database is closed.

keys(attachment)

Return the set of all keys.

path()

Return the path.

read_blob(blob_id, size, offset)

Return the blob at offset.

rollback()

Roll back the transaction.

set(attachment, key, value)

Assigns the value to the key.

uuid()

Return the uuid.

write_blob(blob_id, blob, offset)

Write a region of the blob at offset.

class dsviper.Definitions

A class used to register concept, club, enumeration, structure and attachment.

const()

Return the DefinitionsConst interface.

create_attachment(namespace, name, key_type, document_type, *, documentation=None)

Create an attachment.

create_club(namespace, name, *, documentation=None)

Create and return a club.

create_concept(namespace, name, *, documentation=None, parent=None)

Create and return a concept.

create_enumeration(namespace, enumeration_descriptor)

Create and return an enum from a descriptor.

create_membership(type_club, type_concept)

Create a club membership.

create_structure(namespace, structure_descriptor)

Create and return a struct from a descriptor.

static decode(module, /, blob, *, stream_codec_instancing=None)

Return a Definitions by decoding the blob with a StreamTokenBinaryCodec if not specified.

extend(definitions)

Extend the registered types with the types of definitions and return information about added definitions.

extend_concepts(definitions)

Extend the registered concepts with the concepts of definitions.

static read(module, /, stream_reading)

Read and return a Definitions.

class dsviper.DefinitionsCollector

Not instantiable. A class used to collect referenced types.

club_runtime_ids()

Return the set of uuid for collected clubs.

collect_attachment(attachment)

Collect the types referenced by the attachment.

collect_prototype(prototype)

Collect the types referenced by the prototype.

collect_prototypes(prototypes)

Collect the types referenced by the list of prototypes.

collect_structure_descriptor(type_structure_descriptor)

Collect the types referenced by a structure descriptor.

collect_type(type)

Collect the types referenced by the type.

concept_runtime_ids()

Return the set of uuid for collected concepts.

enumeration_runtime_ids()

Return the set of uuid for collected enumerations.

has_any()

Return True if the type any was collected.

has_any_concept()

Return True if the type any_concept was collected.

structure_runtime_ids()

Return the set of uuid for collected structures.

class dsviper.DefinitionsConst

Not instantiable. A class used to retreive registered concepts, clubs, enumerations, structures and attachments.

attachment_runtime_ids()

Return the set of runtime ID for all attachments.

attachments()

Return the list of attachments.

check_attachment(attachment_runtime_id)

Return the attachment or raise.

check_club(runtime_id)

Return the club or raise.

check_concept(runtime_id)

Return the concept or raise.

check_enumeration(runtime_id)

Return the enum or raise.

check_structure(runtime_id)

Return a struct or raise.

check_type(runtime_id)

Return the type or raise.

club_runtime_ids()

Return the set of runtime ID for all clubs.

clubs()

Return the list of clubs.

collector()

Return a collector.

concept_members(type_concept)

Return the list of related concepts.

concept_runtime_ids()

Return the set of runtime ID for all concepts.

concepts()

Return the list of concepts.

contains(definitions)

return True if the types and attachments of the definitions are known.

copy()

Return a copy immutable of the definitions.

discard()

Remove from the __main__ module the injected constants.

encode(*, stream_codec_instancing=None)

Return the blob that encodes the definitions with a StreamTokenBinaryCodec if not specified.

enumeration_runtime_ids()

Return the set of runtime ID for all enums.

enumerations()

Return the list of enums.

extract(definitions_collector)

Create and return a new Definitions from the collected types.

hexdigest()

Return the hexdigest.

inject()

Fill the __main__ module with constants for all definitions. <namespace>_T_<name> for a concept or a club. <namespace>_K_<name> for a key of a concept or a club. <namespace>_S_<name> for a structure. <namespace>_E_<name> for a enumeration. <namespace>_P_<name>_… is the path for a property of the structure. <namespace>_A_<key.name>_<name> for an attachment.

is_equal(definitions)

Return True if self and definitions are equals.

query_attachment(attachment_runtime_id)

Return the attachment or None.

query_club(runtime_id)

Return the club or None.

query_concept(runtime_id)

Return the concept or None.

query_enumeration(runtime_id)

Return the enum or None.

query_structure(runtime_id)

Return a struct or None.

query_type(runtime_id)

Return the type or None.

query_types(name)

Return the list of types.

runtime_ids()

Return the set of runtime ID for all registered types.

structure_runtime_ids()

Return the set of runtime ID for all structs.

structures()

Return the list of structs.

to_dsm_definitions()

Convert and return a DSMDefinition.

types()

Return the topologically sorted list of types.

write(stream_writing)

Write to a stream.

class dsviper.DefinitionsExtendInfo

Not instantiable. A class used to represent the types exchanged during the synchronization of two databases.

attachment_runtime_ids()

Return the set of runtime ID for all added attachments.

club_runtime_ids()

Return the set of runtime ID for all added clubs.

concept_runtime_ids()

Return the set of runtime ID for all added concepts.

count()

Return the count of added definitions.

enumeration_runtime_ids()

Return the set of runtime ID for all added enumerations.

memberships()

Return a dict[uuid, set[uuid]] for all memberships.

structure_runtime_ids()

Return the set of runtime ID for all structures.

class dsviper.DefinitionsInspector

DefinitionsInspector(definitions). A class used to retrieve registered concepts, clubs, enumerations, structures and attachments from TypeName.

attachment_identifiers()

Return the set of identifiers for all attachments.

check_attachment(identifier)

Return the attachment or raise.

check_club(type_name)

Return the club or raise.

check_concept(type_name)

Return the concept or raise.

check_enumeration(type_name)

Return the enum or raise.

check_structure(type_name)

Return a struct or raise.

club_type_names()

Return the set of TypeName for all clubs.

concept_type_names()

Return the set of TypeName for all concepts.

enumeration_type_names()

Return the set of TypeName for all enums.

name_spaces()

Return the set of NameSpace for all TypNames.

query_attachment(identifier)

Return the attachment or None.

query_club(type_name)

Return the club or None.

query_concept(type_name)

Return the concept or None.

query_enumeration(type_name)

Return the enum or None.

query_structure(type_name)

Return a struct or None.

representation(type_name)

Return the shortest representation of the TypeName.

structure_type_names()

Return the set of TypeName for all structs.

class dsviper.DefinitionsMapper(source_definitions, target_definitions)

A class use for INTERNAL DEVELOPMENT.

attachment(attachment)

Return the mapped attachment.

source()

Return the source.

target()

Return the target.

type(type)

Return the mapped type.

value(value)

Return the mapped value.

class dsviper.DocumentGetting

Not instantiable. An interface used to retreive documents.

definitions()

Return the definitions.

enumerate(attachment, *, encoded=True)

Return a list of (key, document).

get(attachment, key)

Return an optional<document_type> associated with the key in the attachment.

has(attachment, key)

Return True if a document is present for the key.

keys(attachment)

Return the set of all keys.

class dsviper.DocumentNode

Not instantiable. A class used to represent a node in the tree representation of a value.

attachment()

Return the attachment.

children()

Return the list of child.

static create_documents(module, /, key, document_getting)

Return a list of documents as a hierarchy of DocumentNode.

document()

Return the document.

is_blob_id()

Return True the node is a blob_id.

is_boolean()

Return True the node is a boolean.

is_collection()

Return True the node is a collection.

is_container()

Return True it’s a container.

is_double()

Return True the node is a double.

is_editable()

Return True if it’s editable.

is_enumeration()

Return True the node is an enumeration.

is_expandable()

Return True the node is expandable.

is_float()

Return True the node is a float.

is_int16()

Return True the node is an int16.

is_int32()

Return True the node is an int32.

is_int64()

Return True the node is an int64.

is_int8()

Return True the node is an int8.

is_integer()

Return True the node is an integer.

is_key()

Return True the node is a key.

is_numeric()

Return True the node is a number.

is_primitive()

Return True the node is a primitive.

is_readonly()

Return True if it’s readonly.

is_real()

Return True the node is real.

is_string()

Return True the node is a string.

is_uint16()

Return True the node is an uint16.

is_uint32()

Return True the node is an uint32.

is_uint64()

Return True the node is an uint64.

is_uint8()

Return True the node is an uint8.

is_uuid()

Return True the node is an uuid.

key()

Return the key.

parent()

Return the parent or None.

path()

Return the path.

string_component()

Return the string component.

string_component_tooltip()

Return the string component tooltip.

string_path()

Return the string path.

string_type()

Return the string type.

string_value()

Return the string_value.

string_value_tooltip()

Return the string value tooltip.

type()

Return the type of node.

uuid()

Return the uuid.

value()

Return the value.

class dsviper.Error(module, domain, code, message)

A class used to represent an error raised by Viper.

code()

Return the code.

component()

Return the component.

domain()

Return the domain.

explained($self)

Return the explanation of the error.

hostname()

Return the hostname.

message()

Return the message.

static parse(self, /, description)

Return an Error or None.

process_name()

Return the process name.

static set_process_name(module, /, name)

Assign the name of the process reported in Error.

class dsviper.Float16

Not instantiable. A class used to handle float16 representation.

static from_float(module, /, v)

Return the float16 as an unsigned int.

static to_float(module, /, v)

Return the float from an unsigned int representing a float16 storage.

class dsviper.Function

Not instantiable. A class used to call a C++ function.

documentation()

Return the documentation.

prototype()

Return the prototype.

class dsviper.FunctionPool

Not instantiable. A class used to register and retreive C++ functions.

check(func_name)

Return the function or raise.

documentation()

Return the documentation.

funcs

all functions.

name()

Return the name.

query(func_name)

Return the function or None.

uuid()

Return the uuid.

class dsviper.FunctionPoolFunctions

Not instantiable. A class used to represent the functions of a pool.

class dsviper.FunctionPrototype

Not instantiable. A class used to represent the prototype of a function.

parameters()

Return the list of parameters.

return_type()

Return the type of the returned value.

class dsviper.Fuzzer(definitions)

A class used to generate a random value.

blob_id()

Return The special uniq blob_id or None.

blob_size()

Return the size of the generated blob.

fuzz(type)

Generate and return a random value from the type.

map_size()

Set the size of the generated map.

set_blob_id(blob_id=None)

Set The special uniq blob_id if specified.

set_blob_size(value)

Set the size of the generated blob.

set_map_size(value)

Set the size of the generated map.

set_set_size(value)

Set the size of the generated set.

set_size()

Return the size of the generated set.

set_string_size(value)

Set the size of the generated string.

set_vector_size(value)

Set the size of the generated vector.

set_xarray_size(value)

Set the size of the generated xarray.

string_size()

Return the size of the generated string.

types()

Return the list of types.

vector_size()

Return the size of the generated vector.

xarray_size()

Return the size of the generated xarray.

class dsviper.HashCRC32

A class used to hash data with CRC32.

block_size()

Return the internal block size of the hash algorithm in bytes.

digest()

Return the digest.

digest_size()

Return the size of the resulting hash in bytes.

static hash(module, /, blob)

Return the hexdigest of the blob.

hashing()

Return the Hashing interface.

hexdigest()

Return the digest in hexadecimal.

name()

Return the name.

reset()

Reset the hasher.

update(blob)

Update the data.

class dsviper.HashMD5

A class used to hash data with MD5.

block_size()

Return the internal block size of the hash algorithm in bytes.

digest()

Return the digest.

digest_size()

Return the size of the resulting hash in bytes.

static hash(module, /, blob)

Return the hexdigest of the blob.

hashing()

Return the Hashing interface.

hexdigest()

Return the digest in hexadecimal.

name()

Return the name.

reset()

Reset the hasher.

update(blob)

Update the data.

class dsviper.HashSHA1

A class used to hash data with SHA1.

block_size()

Return the internal block size of the hash algorithm in bytes.

digest()

Return the digest.

digest_size()

Return the size of the resulting hash in bytes.

static hash(module, /, blob)

Return the hexdigest of the blob.

hashing()

Return the Hashing interface.

hexdigest()

Return the digest in hexadecimal.

name()

Return the name.

reset()

Reset the hasher.

update(blob)

Update the data.

class dsviper.HashSHA256

A class used to hash data with SHA256.

block_size()

Return the internal block size of the hash algorithm in bytes.

digest()

Return the digest.

digest_size()

Return the size of the resulting hash in bytes.

static hash(module, /, blob)

Return the hexdigest of the blob.

hashing()

Return the Hashing interface.

hexdigest()

Return the digest in hexadecimal.

name()

Return the name.

reset()

Reset the hasher.

update(blob)

Update the data.

class dsviper.HashSHA3(bits)

A class used to hash a data with SHA3. Supported bits are 224, 256, 384 or 512.

block_size()

Return the internal block size of the hash algorithm in bytes.

digest()

Return the digest.

digest_size()

Return the size of the resulting hash in bytes.

static hash(module, /, blob, bits='256')

Return the hexdigest of the blob.

hashing()

Return the Hashing interface.

hexdigest()

Return the hexa digest.

name()

Return the name.

reset()

Reset the hasher.

update(blob)

Update the data.

class dsviper.Hashing

Not instantiable. An interface to abstract a hasher.

block_size()

Return the internal block size of the hash algorithm in bytes.

digest()

Return the digest.

digest_size()

Return the size of the resulting hash in bytes.

hexdigest()

Return the digest in hexadecimal.

name()

Return the name.

reset()

Reset the hasher.

update(blob)

Update the data.

class dsviper.Html

Not instantiable. A class used to generate HTML representation.

static body(module, /, content)

Embed the content in a body.

static document(module, /, title, style, body)

Return an HTML document.

static documents_details(module, /, documents, show_type)

Return the HTML representation of the documents as a hierarchy of details.

static dsm_definitions(module, /, definitions, show_documentation=False, show_runtime_id=False)

Return the HTML representation of the DSM Definitions.

static style(module, /)

Return the default style.

static type(module, /, type)

Return the representation of the type in HTML.

static value(module, /, value, use_description=False)

Return the representation of the value in HTML.

static value_pretty(module, /, value, show_type=False)

Return the representation of the value like the HTML pretty printer.

class dsviper.KeyHelper

Not instantiable. A class used to collect keys, attachments and missing attachments for a key.

static attachments(module, /, type, definitions)

Return a list of attachments.

static collect_keys(module, /, type_key, document_getting)

Return a set of key.

static missing_attachments(module, /, key, document_getting)

Return the list of missing attachments.

class dsviper.KeyNamer(definitions)

A class used to get a name for a key from available attachments.

name(key, document_getting)

Return the name or None.

smart_name(key, document_getting)

Return the name or None.

class dsviper.LoggerConsole(level=0)

A class used to display a message on the console.

logging()

Return the Logging interface.

class dsviper.LoggerNull(level=0)

A class used to discard messages.

logging()

Return the Logging interface.

class dsviper.LoggerPrint(level=0)

A class used to display a message on the Python stdout.

logging()

Return the Logging interface.

class dsviper.LoggerReport(level=0)

A class used to collect messages.

logging()

Return the Logging interface.

messages()

Return the list of messages.

class dsviper.Logging

Not instantiable. An interface to emit a message.

static create(module, /, object)

Return a new Logging if the Python object responds to the interface or raise.

critical(message)

Log the message for level Critical.

debug(message)

Log the message for level Debug.

error(message)

Log the message for level Error.

info(message)

Log the message for level Info.

log(level, message)

Log the message for level.

warning(message)

Log the message for level Warning.

class dsviper.NameSpace

Namespace(uuid, name) A class used to describe a namespace.

name()

Return the name.

uuid()

Return the uuid.

class dsviper.Path(path=None)

A class used to construct the location of a portion of a value.

Use the static factory method from_field(…), from_index(…), from_key(…), from_position(…) and from_unwrap().

const()

Return the PathConst interface.

copy()

Return a copy.

static decode(module, /, blob, definitions, *, stream_codec_instancing=None)

Return a Path by decoding the blob with a StreamBinaryCodec if not specified.

element(index)

Append an element component and return self.

entry(key)

Append an entry component and return self.

field(name)

Append a field component and return self.

static from_element(module, /, index)

Create and return a Path with an element component at index.

static from_entry(module, /, value)

Create and return a Path with an entry component.

static from_field(module, /, name)

Create and return a Path with a field component.

static from_index(module, /, index)

Create a return a Path with an index component.

static from_key(module, /, key)

Create and return a Path with a key component.

static from_position(module, /, position)

Create and return a Path with a position component.

static from_unwrap(self, /)

Create and return a Path with an unwrap component.

index(value)

Append an index component and return self.

key(value)

Append a key component and return self.

path(other)

Append path components and return self.

position(value)

Append a position component and return self.

static read(module, /, stream_reading, definitions)

Read and return a Path.

representation()

Return a string representation.

unwrap()

Append an unwrap directive component and return self.

class dsviper.PathComponent

Not instantiable. A class used to represent a component of a Path.

type()

Return the type.

value(*, encoded=True)

Return the value or None.

class dsviper.PathConst

Not instantiable. A class used to retreive a value from a Path.

ancestors()

Return the list of ancestors.

at(target, *, encoded=True)

Return the value for the target.

check_type(type)

Check if the path can be used to locate the value in the type.

components()

Return the list of components.

copy()

Return a copy.

element_info()

Return the ElementInfo.

encode(*, stream_codec_instancing=None)

Return a blob that encodes the Path with a StreamTokenBinaryCodec if not specified.

entry_key_info()

Return the EntryKeyInfo.

from_component(index)

Return a path from index.

has_prefix(path)

Return True if other is a prefix.

is_applicable(value)

Check if the path is applicable to the value.

is_element_path()

Return True if the path contains Element components.

is_entry_key_path()

Return True if the path contains Entry components.

is_regular()

Return False if the path contains Entry components.

is_root()

Return True if self is the root.

last_component()

Return the last component as a Path.

last_component_value(*, encoded=True)

Return the last component value.

parent()

Return the parent Path or raise if self is root.

patch(target, value)

Assign the value to the target.

regularized()

Return the path without the entry component.

representation()

Return a string representation.

set(target, value)

Assign the value to the target.

to_component(index)

Return a path to index (excluded).

write(*, stream_writing)

Write a path.

class dsviper.PathElementInfo

Not instantiable. A class used to represent the various information for an element of a set.

element_path()

Return the path for the element.

index()

Return the index for the element.

set_path()

Return the path for the set.

class dsviper.PathEntryKeyInfo

Not instantiable. A class used to represent various information for an entry of a map.

key()

Return the key.

key_path()

Return the path for the key.

map_path()

Return the path for the map.

class dsviper.SQLite

Not instantiable. A class used to retreive the configuration of SQLite3.

compile_options()

Return a dict[str, str] of compilation options

get_pragma(key)

Return the pragma value in a list of str.

static is_sqlite3(module, /, file_path)

Return True if the file is a SQLite3 database.

max_database_size()

Return maximum size.

max_length()

Return the max size supported by the current implementation of SQLite3.

max_page_count()

Return the max page count.

page_size()

Return the page size.

pragmas()

Return the list of pragmas.

set_pragma(key, value)

set the pragma value.

class dsviper.Semaphore

Not instantiable. A class used to represent a semaphore.

Use the static factory method create(…) or open(…).

static create(module, /, name)

Create a semaphore.

static exists(module, /, name)

Return True is the name exist.

name()

Return the name.

static open(module, /, name)

Open an existing semaphore.

post()

The semaphore is unlocked.

try_wait()

The semaphore is locked.

Unlink the shared memory object.

wait()

The semaphore is locked.

class dsviper.ServiceRemote

Not instantiable. A class used to connect to a remote service.

Use the static factory method connect(…) or connect_local(…).

close()

Close the service.

commit_function_pool_funcs(pool_id_or_name)

Return functions or None.

commit_function_pools()

Return a list of pools.

commit_pools

all commit function pools.

static connect(module, /, host, service, definitions)

Connect to a remote service.

static connect_local(module, /, socket_path, definitions)

Connect to a service located at socket_path.

definitions()

Return the definitions.

function_pool_funcs(pool_id_or_name)

Return functions or None.

function_pools()

Return a list of pools.

is_closed()

Return True if the service is closed.

peername()

Return the peername.

pools

all function pools.

sockname()

Return the sockname.

to_dsm_definitions()

Return the DSMDefinitions of the service.

class dsviper.ServiceRemoteCommitFunction

Not instantiable. A class used to call a remote commit function.

function()

Return the function.

pool()

Return the pool.

service()

Return the service.

class dsviper.ServiceRemoteCommitFunctionPool

Not instantiable. A class used to represent a remote commit function pool.

check(func_name)

Return a function or raise.

documentation()

Return the documentation.

functions()

Return the list of functions.

name()

Return the name.

query(func_name)

Return a function or None.

uuid()

Return the uuid.

class dsviper.ServiceRemoteCommitFunctionPoolFunction

Not instantiable. A class used to represent a remote commit function.

documentation()

Return the documentation.

is_mutable()

Return True if the function is mutable.

prototype()

Return the prototype.

class dsviper.ServiceRemoteCommitFunctionPoolFunctions

Not instantiable. A class used to represent the remote commit functions.

class dsviper.ServiceRemoteCommitFunctionPools

Not instantiable. A class used to represent the remote commit pools.

class dsviper.ServiceRemoteFunction

Not instantiable. A class used to call a remote function.

function()

Return the function.

pool()

Return the pool.

service()

Return the service.

class dsviper.ServiceRemoteFunctionPool

Not instantiable. A class used to represent a remote function pool.

check(func_name)

Return a function or raise.

documentation()

Return the documentation.

functions()

Return the list of functions.

name()

Return the name.

query(func_name)

Return a function or None.

uuid()

Return the uuid.

class dsviper.ServiceRemoteFunctionPoolFunction

Not instantiable. A class used to represent a remote function.

documentation()

Return the documentation.

prototype()

Return the prototype.

class dsviper.ServiceRemoteFunctionPoolFunctions

Not instantiable. A class used to represent the functions of a pool.

class dsviper.ServiceRemoteFunctionPools

Not instantiable. A class used to represent the remote function pools.

class dsviper.SharedMemory

Not instantiable. A class used to represent a shared memory region.

address()

Return the address.

static create(module, /, name, size)

Create a shared memory segment.

static exists(module, /, name)

Return True is the name exist.

fd()

Return the file descriptor.

name()

Return the name.

static open(module, /, name, size)

Open an exising shared memory segment.

size()

Return the size.

Unlink the shared memory object.

class dsviper.Socket

Not instantiable. A class used to represent a shared memory region.

static create_passive_inet(module, /, host, service)

Create an inet passive socket.

static create_passive_local(module, /, socket_path)

Create a local passive socket.

class dsviper.StreamBinaryReader(stream_raw_reading)

A class used to read data through the StreamRawReading interface (handle endianness).

read_blob()

Read and return a blob.

read_blob_id()

Read and return a blob_id.

read_bool()

Read and return a Python bool.

read_commit_id()

Read and return a commit_id.

read_double()

Read and return a Python float.

read_doubles(size)

Read an array of doubles and return a vec<double, size>.

read_float()

Read and return a Python float.

read_floats(size)

Read an array of float and return a vec<float, size>.

read_int16()

Read and return a Python int.

read_int16s(size)

Read an array of int16 and return a vec<int16, size>.

read_int32()

Read and return a Python int.

read_int32s(size)

Read an array of int32 and return a vec<int32, size>.

read_int64()

Read and return a Python int.

read_int64s(size)

Read an array of int64 and return a vec<int64, size>.

read_int8()

Read and return a Python int.

read_int8s(size)

Read an array of int8 and return a vec<int8, size>.

read_string()

Read and return a Python str.

read_uint16()

Read and return a Python int.

read_uint16s(size)

Read an array of uint16 and return a vec<uint16, size>.

read_uint32()

Read and return a Python int.

read_uint32s(size)

Read an array of uint32 and return a vec<uint32, size>.

read_uint64()

Read and return a Python int.

read_uint64s(size)

Read an array of uint64 and return a vec<uint64, size>.

read_uint8()

Read and return a Python int.

read_uint8s(size)

Read an array of uint8 and return a vec<uint8, size>.

read_uuid()

Read and return uuid.

stream_reading()

Return the StreamReading interface.

class dsviper.StreamBinaryWriter(stream_raw_reading)

A class used to write data through the StreamRawWriting interface (handle endianness).

stream_writing()

Return the StreamWriting interface.

write_blob(value)

Write a blob.

write_blob_id(value)

Write a blob_id.

write_bool(value)

Write a bool.

write_commit_id(value)

Write a commit_id.

write_double(value)

Write a double.

write_doubles(value, size)

Write an array of double.

write_float(value)

Write a float.

write_floats(value, size)

Write an array of float.

write_int16(value)

Write an int16.

write_int16s(value, size)

Write an array of int16.

write_int32(value)

Write an int32.

write_int32s(value, size)

Write an array of int32.

write_int64(value)

Write an int64.

write_int64s(value, size)

Write an array of int64.

write_int8(value)

Write an int8.

write_int8s(value, size)

Write an array of int8.

write_string(value)

Write a string.

write_uint16(value)

Write an uint16.

write_uint16s(value, size)

Write an array of uint16.

write_uint32(value)

Write an uint32.

write_uint32s(value, size)

Write an array of uint32.

write_uint64(value)

Write an uint64.

write_uint64s(value, size)

Write an array of uint64.

write_uint8(value)

Write an uint8.

write_uint8s(value, size)

Write an array of uint8.

write_uuid(value)

Write an uuid.

class dsviper.StreamCodecInstancing

Not instantiable. An interface used to create encoder, decoder and sizer.

create_decoder(blob)

Create and return a decoder.

create_encoder()

Create and return an encoder.

create_sizer()

Create and return a sizer.

name()

Return the name.

class dsviper.StreamDecoding

Not instantiable. An interface used to read data from a blob.

blob()

Return the blob.

has_more()

Return True if there is something to read.

offset()

Read the offset in the stream.

read_blob()

Read and return a blob.

read_blob_id()

Read and return a blob_id.

read_bool()

Read and return a Python bool.

read_commit_id()

Read and return a commit_id.

read_double()

Read and return a Python float.

read_doubles(size)

Read an array of doubles and return a vec<double, size>.

read_float()

Read aan return a Python float.

read_floats(size)

Read an array of float and return a vec<float, size>.

read_int16()

Read and return a Python int.

read_int16s(size)

Read an array of int16 and return a vec<int16, size>.

read_int32()

Read and return a Python int.

read_int32s(size)

Read an array of int32 and return a vec<int32, size>.

read_int64()

Read and return a Python int.

read_int64s(size)

Read an array of int64 and return a vec<int64, size>.

read_int8()

Read and return a Python int.

read_int8s(size)

Read an array of int8 and return a vec<int8, size>.

read_string()

Read a return a Python str.

read_uint16()

Read and return a Python int.

read_uint16s(size)

Read an array of uint16 and return a vec<uint16, size>.

read_uint32()

Read and return a Python int.

read_uint32s(size)

Read an array of uint32 and return a vec<uint32, size>.

read_uint64()

Read and return a Python int.

read_uint64s(size)

Read an array of uint64 and return a vec<uint64, size>.

read_uint8()

Read and return a Python int.

read_uint8s(size)

Read an array of uint8 and return a vec<uint8, size>.

read_uuid()

Read and return an uuid.

rewind()

Rewind the stream.

stream_reading()

Return the StreamReading interface.

class dsviper.StreamEncoding

Not instantiable. An interface used to write data to a blob.

end_encoding()

Return the blob and set the flag ended to True.

is_ended()

Return True if the stream is ended.

stream_writing()

Return a StreamWriting interface.

write_blob(value)

Write a blob.

write_blob_id(value)

Write a blob_id.

write_bool(value)

Write a bool.

write_commit_id(value)

Write a commit_id.

write_double(value)

Write a double.

write_doubles(value, size)

Write an array of double.

write_float(value)

Write a float.

write_floats(value, size)

Write an array of float.

write_int16(value)

Write an int16.

write_int16s(value, size)

Write an array of int16.

write_int32(value)

Write an int32.

write_int32s(value, size)

Write an array of int32.

write_int64(value)

Write an int64.

write_int64s(value, size)

Write an array of int64.

write_int8(value)

Write an int8.

write_int8s(value, size)

Write an array of int8.

write_string(value)

Write a string.

write_uint16(value)

Write an uint16.

write_uint16s(value, size)

Write an array of uint16.

write_uint32(value)

Write an uint32.

write_uint32s(value, size)

Write an array of uint32.

write_uint64(value)

Write an uint64.

write_uint64s(value, size)

Write an array of uint64.

write_uint8(value)

Write an uint8.

write_uint8s(value, size)

Write an array of uint8.

write_uuid(value)

Write an uuid.

class dsviper.StreamRawReader(stream_raw_reading)

An class used to read data through the StreamRawReading interface.

read_blob()

Read and return a blob.

read_blob_id()

Read and return a blob_id.

read_bool()

Read and return a Python bool.

read_commit_id()

Read and return a commit_id.

read_double()

Read and return a Python float.

read_doubles(size)

Read an array of doubles and return a vec<double, size>.

read_float()

Read aan return a Python float.

read_floats(size)

Read an array of float and return a vec<float, size>.

read_int16()

Read and return a Python int.

read_int16s(size)

Read an array of int16 and return a vec<int16, size>.

read_int32()

Read and return a Python int.

read_int32s(size)

Read an array of int32 and return a vec<int32, size>.

read_int64()

Read and return a Python int.

read_int64s(size)

Read an array of int64 and return a vec<int64, size>.

read_int8()

Read and return a Python int.

read_int8s(size)

Read an array of int8 and return a vec<int8, size>.

read_string()

Read and return a Python str.

read_uint16()

Read and return a Python int.

read_uint16s(size)

Read an array of uint16 and return a vec<uint16, size>.

read_uint32()

Read and return a Python int.

read_uint32s(size)

Read an array of uint32 and return a vec<uint32, size>.

read_uint64()

Read and return a Python int.

read_uint64s(size)

Read an array of uint64 and return a vec<uint64, size>.

read_uint8()

Read and return a Python int.

read_uint8s(size)

Read an array of uint8 and return a vec<uint8, size>.

read_uuid()

Read and return an uuid.

stream_reading()

Return the StreamReading interface.

class dsviper.StreamRawReading

Not instantiable. An interface used to read data.

class dsviper.StreamRawWriter(stream_raw_writing)

A class used to write data through the StreamRawWriting interface.

stream_writing()

Return the StreamWriting interface.

write_blob(value)

Write a blob.

write_blob_id(value)

Write a blob_id.

write_bool(value)

Write a bool.

write_commit_id(value)

Write a commit_id.

write_double(value)

Write a double.

write_doubles(value, size)

Write an array of double.

write_float(value)

Write a float.

write_floats(value, size)

Write an array of float.

write_int16(value)

Write an int16.

write_int16s(value, size)

Write an array of int16.

write_int32(value)

Write an int32.

write_int32s(value, size)

Write an array of int32.

write_int64(value)

Write an int64.

write_int64s(value, size)

Write an array of int64.

write_int8(value)

Write an int8.

write_int8s(value, size)

Write an array of int8.

write_string(value)

Write a string.

write_uint16(value)

Write an uint16.

write_uint16s(value, size)

Write an array of uint16.

write_uint32(value)

Write an uint32.

write_uint32s(value, size)

Write an array of uint32.

write_uint64(value)

Write an uint64.

write_uint64s(value, size)

Write an array of uint64.

write_uint8(value)

Write an uint8.

write_uint8s(value, size)

Write an array of uint8.

write_uuid(value)

Write an uuid.

class dsviper.StreamRawWriting

Not instantiable. An interface to write data.

class dsviper.StreamReaderBlob(blob)

A class used to read data from a blob.

blob()

Return the blob.

offset()

Return the offset.

stream_raw_reading()

Return the StreamRawReading interface.

class dsviper.StreamReaderFile

A class used to read data from a file.

close()

Close the file.

offset()

Return the offset.

stream_raw_reading()

Return the StreamRawReading interface.

class dsviper.StreamReaderSharedMemory

A class used to read data from a shared memory region.

offset()

Return the offset.

rewind()

Rewind the stream.

stream_raw_reading()

Return the StreamRawReading interface.

class dsviper.StreamReading

Not instantiable. An interface used to read data.

read_blob()

Read and return a blob.

read_blob_id()

Read and return a blob_id.

read_bool()

Read and return a Python bool.

read_commit_id()

Read and return a commit_id.

read_double()

Read and return a Python float.

read_doubles(size)

Read an array of doubles and return a vec<double, size>.

read_float()

Read aan return a Python float.

read_floats(size)

Read an array of float and return a vec<float, size>.

read_int16()

Read and return a Python int.

read_int16s(size)

Read an array of int16 and return a vec<int16, size>.

read_int32()

Read and return a Python int.

read_int32s(size)

Read an array of int32 and return a vec<int32, size>.

read_int64()

Read and return a Python int.

read_int64s(size)

Read an array of int64 and return a vec<int64, size>.

read_int8()

Read and return a Python int.

read_int8s(size)

Read an array of int8 and return a vec<int8, size>.

read_string()

Read and return a Python str.

read_uint16()

Read and return a Python int.

read_uint16s(size)

Read an array of uint16 and return a vec<uint16, size>.

read_uint32()

Read and return a Python int.

read_uint32s(size)

Read an array of uint32 and return a vec<uint32, size>.

read_uint64()

Read and return a Python int.

read_uint64s(size)

Read an array of uint64 and return a vec<uint64, size>.

read_uint8()

Read and return a Python int.

read_uint8s(size)

Read an array of uint8 and return a vec<uint8, size>.

read_uuid()

Read and return an uuid.

class dsviper.StreamSizing

Not instantiable. An interface used to get the size of data.

size_of_blob_id()

Return the size of a blob_id.

size_of_bool()

Return the size of a bool.

size_of_commit_id()

Return the size of a commit_id.

size_of_double()

Return the size of a double.

size_of_doubles(size)

Return the size for an array of double.

size_of_float()

Return the size of a float.

size_of_floats(size)

Return the size for an array of float.

size_of_int16()

Return the size of an int16.

size_of_int16s(size)

Return the size for an array of int16.

size_of_int32()

Return the size of an int32.

size_of_int32s(size)

Return the size for an array of int32.

size_of_int64()

Return the size of an int64.

size_of_int64s(size)

Return the size for an array of uint64.

size_of_int8()

Return the size of an int8.

size_of_int8s(size)

Return the size for an array of int8.

size_of_uint16()

Return the size of an uint16.

size_of_uint16s(size)

Return the size for an array of uint16.

size_of_uint32()

Return the size of an uint32.

size_of_uint32s(size)

Return the size for an array of uint32.

size_of_uint64()

Return the size of an uint64.

size_of_uint64s(size)

Return the size for an array of uint64.

size_of_uint8()

Return the size of an uint8.

size_of_uint8s(size)

Return the size for an array of uint8.

size_of_uuid()

Return the size of an uuid.

class dsviper.StreamTokenBinaryReader(stream_raw_reading)

A class used to read through the StreamRawReading interface (handle endianness).

read_blob()

Read and return a blob.

read_blob_id()

Read and return a blob_id.

read_bool()

Read and return a Python bool.

read_commit_id()

Read and return a commit_id.

read_double()

Read and return a Python float.

read_doubles(size)

Read an array of double and return a vec<double, size>.

read_float()

Read aan return a float.

read_floats(size)

Read an array of float and return a vec<float, size>.

read_int16()

Read and return a Python int.

read_int16s(size)

Read an array of int16 and return a vec<int16, size>.

read_int32()

Read and return a Python int.

read_int32s(size)

Read an array of int32 and return a vec<int32, size>.

read_int64()

Read and return a Python int.

read_int64s(size)

Read an array of int64 and return a vec<int64, size>.

read_int8()

Read and return a Python int.

read_int8s(size)

Read an array of int8 and return a vec<int8, size>.

read_string()

Read and return a Python str.

read_uint16()

Read and return a Python int.

read_uint16s(size)

Read an array of uint16 and return a vec<uint16, size>.

read_uint32()

Read and return a Python int.

read_uint32s(size)

Read an array of uint32 and return a vec<uint32, size>.

read_uint64()

Read and return a Python int.

read_uint64s(size)

Read an array of uint64 and return a vec<uint64, size>.

read_uint8()

Read and return a Python int.

read_uint8s(size)

Read an array of uint8 and return a vec<uint8, size>.

read_uuid()

Read and return an uuid.

stream_reading()

Return the StreamReading interface.

class dsviper.StreamTokenBinaryWriter(stream_raw_reading)

A class used to write through the StreamRawWriting interface (handle endianness).

stream_writing()

Return the StreamWriting interface.

write_blob(value)

Write a blob.

write_blob_id(value)

Write a blob_id.

write_bool(value)

Write a bool.

write_commit_id(value)

Write a commit_id.

write_double(value)

Write a double.

write_doubles(value, size)

Write an array of double.

write_float(value)

Write a float.

write_floats(value, size)

Write an array of float.

write_int16(value)

Write an int16.

write_int16s(value, size)

Write an array of int16.

write_int32(value)

Write an int32.

write_int32s(value, size)

Write an array of int32.

write_int64(value)

Write an int64.

write_int64s(value, size)

Write an array of int64.

write_int8(value)

Write an int8.

write_int8s(value, size)

Write an array of int8.

write_string(value)

Write a string.

write_uint16(value)

Write an uint16.

write_uint16s(value, size)

Write an array of uint16.

write_uint32(value)

Write an uint32.

write_uint32s(value, size)

Write an array of uint32.

write_uint64(value)

Write an uint64.

write_uint64s(value, size)

Write an array of uint64.

write_uint8(value)

Write an uint8.

write_uint8s(value, size)

Write an array of uint8.

write_uuid(value)

Write an uuid.

class dsviper.StreamWriterBlob

A class used to write data to a blob.

blob()

Return the blob.

stream_raw_writing()

Return the StreamRawWriting interface.

class dsviper.StreamWriterFile

A class used to write data to a file.

close()

Close the file.

offset()

Return the offset.

stream_raw_writing()

Return the StreamRawWriting interface.

class dsviper.StreamWriterSharedMemory

StreamSharedMemoryWriter(shared_memory) A class used to write data to a shared memory region.

offset()

Return the offset.

rewind()

Rewind the stream.

stream_raw_writing()

Return StreamRawWriting interface.

class dsviper.StreamWriting

Not instantiable. An interface used to read data.

write_blob(value)

Write a blob.

write_blob_id(value)

Write a blob_id.

write_bool(value)

Write a bool.

write_commit_id(value)

Write a commit_id.

write_double(value)

Write a double.

write_doubles(value, size)

Write an array of double.

write_float(value)

Write a float.

write_floats(value, size)

Write an array of float.

write_int16(value)

Write an int16.

write_int16s(value, size)

Write an array of int16.

write_int32(value)

Write an int32.

write_int32s(value, size)

Write an array of int32.

write_int64(value)

Write an int64.

write_int64s(value, size)

Write an array of int64.

write_int8(value)

Write an int8.

write_int8s(value, size)

Write an array of int8.

write_string(value)

Write a string.

write_uint16(value)

Write an uint16.

write_uint16s(value, size)

Write an array of uint16.

write_uint32(value)

Write an uint32.

write_uint32s(value, size)

Write an array of uint32.

write_uint64(value)

Write an uint64.

write_uint64s(value, size)

Write an array of uint64.

write_uint8(value)

Write an uint8.

write_uint8s(value, size)

Write an array of uint8.

write_uuid(value)

Write an uuid.

class dsviper.Type

Not instantiable. A utility class to handle type representation.

static decode(module, /, blob, definitions, *, stream_codec_instancing=None)

Return a type by decoding the blob with a StreamBinaryCodec if not specified.

static encode(module, /, type, *, stream_codec_instancing=None)

Return a blob that encodes the type with a StreamBinaryCodec if not specified.

static hexdigest(module, /, type, *, hashing=None)

Return the hexa digest of the type computed with the hashing interface if specified else use SHA1.

static is_sized(module, /, type)

Return True if the type has a fixed size.

static read(module, /, stream_reading, definitions)

Read and return a type.

static size_of(module, /, type, stream_sizing)

Return the fixed size of the type or raise.

static use_blob_id(module, /, type)

Return True if the type uses the type blob_id.

static write(module, /, type, stream_writing)

Write a type.

class dsviper.TypeAny

A class used to represent the any type.

Use the static property Type.ANY.

description(*, namespace=None)

Return the description.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

type_name()

Return a TypeName.

class dsviper.TypeAnyConcept

A class used to represent the any_concept type.

Use the static property Type.ANY_CONCEPT.

description(*, namespace=None)

Return the description.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

type_name()

Return a TypeName.

class dsviper.TypeBlob

A class used to represent the blob type.

Use the static property Type.BLOB.

description(*, namespace=None)

Return the description.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

type_name()

Return a TypeName.

class dsviper.TypeBlobId

A class used to represent the blob_id type.

Use the static property Type.BLOB_ID.

description(*, namespace=None)

Return the description.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

type_name()

Return a TypeName.

class dsviper.TypeBool

A class used to represent the bool type.

Use the static property Type.BOOL.

description(*, namespace=None)

Return the description.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

type_name()

Return a TypeName.

class dsviper.TypeClub

Not instantiable. A class used to represent a club type.

static cast(self, /, type)

Return a type club or raise.

description(*, namespace=None)

Return the description.

documentation()

Return the documentation.

is_member(type_concept)

Return True type_concept is a member.

members()

Return the list of concepts.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

type_name()

Return a TypeName.

class dsviper.TypeCommitId

A class used to represent the commit_id type.

Use the static property Type.COMMIT_ID.

description(*, namespace=None)

Return the description.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

type_name()

Return a TypeName.

class dsviper.TypeConcept

Not instantiable. A class used to represent a concept type.

static cast(self, /, type)

Return a concept or raise.

description(*, namespace=None)

Return the description.

documentation()

Return the documentation.

is_member(type_concept)

Return True if type_concept is related.

parent()

Return the parent concept or None.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

type_name()

Return a TypeName.

class dsviper.TypeDouble

A class used to represent the double type.

Use the static property Type.DOUBLE.

description(*, namespace=None)

Return the description.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

type_name()

Return a TypeName.

class dsviper.TypeEnumeration

Not instantiable. A class used to represent an enum type.

cases()

Return the list of cases.

static cast(self, /, type)

Return a type enum or raise.

check(name)

Return the case or raise.

description(*, namespace=None)

Return the description.

documentation()

Return the documentation.

query(name)

Return the case or None.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

type_name()

Return a TypeName.

class dsviper.TypeEnumerationCase

Not instantiable. A class used to represent a case for an enum type.

documentation()

Return the documentation.

name()

Return the name.

class dsviper.TypeEnumerationDescriptor(name, *, documentation=None)

A class used to describe the cases of an enum.

add_case(name, documentation=None)

Add a case to the enum.

cases()

Return the list of cases.

description()

Return the description.

documentation()

Return the documentation.

name()

Return the name.

class dsviper.TypeFloat

A class used to represent the float type.

Use the static property Type.FLOAT.

description(*, namespace=None)

Return the description.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

type_name()

Return a TypeName.

class dsviper.TypeInt16

A class used to represent the int16 type.

Use the static property Type.INT16.

description(*, namespace=None)

Return the description.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

type_name()

Return a TypeName.

class dsviper.TypeInt32

A class used to represent the int32 type.

Use the static property Type.INT32.

description(*, namespace=None)

Return the description.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

type_name()

Return a TypeName.

class dsviper.TypeInt64

A class used to represent the int64 type.

Use the static property Type.INT64.

description(*, namespace=None)

Return the description.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

type_name()

Return A TypeName.

class dsviper.TypeInt8

A class used to represent the int8 type.

Use the static property Type.INT8.

description(*, namespace=None)

Return the description.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

type_name()

Return a TypeName.

class dsviper.TypeKey(element_type)

A class used to represent a key<element_type> type where element_type is a concept, club or any_concept.

static cast(self, /, type)

Return the type key<element_type> or raise.

description(*, namespace=None)

Return the description.

element_type()

Return the element type.

is_any_concept()

Return True if element_type is any_concept.

is_club()

Return True if element_type is a club.

is_concept()

Return True if element_type is a concept.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

class dsviper.TypeMap(key_type, element_type)

A class used to represent a map<element_type> type.

static cast(self, /, type)

Return the type map<key_type, element_type> or raise.

description(*, namespace=None)

Return the description.

element_type()

Return the element type.

item_type()

Return the type for item.

items_type()

item_type($self) –

Return the type for items.

key_type()

Return the KeyType.

keys_type()

Return the type for keys.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

values_type()

Return the type for values.

class dsviper.TypeMat(numeric_type, columns, rows)

A class used to represent a mat<numeric_type, columns, rows> type.

static cast(self, /, type)

Return the type mat<N, columns, rows> or raise.

columns()

Return the number of columns.

description(*, namespace=None)

Return the description.

element_type()

Return the element type.

elements_type()

Return the type for elements.

representation(*, namespace=None)

Return the representation.

rows()

Return the number of rows.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

class dsviper.TypeName

Not instantiable. A class used to describe the name of a type.

name()

Return the name.

name_space()

Return the namespace.

class dsviper.TypeOptional(element_type)

A class used to represent an optional<element_type> type.

static cast(self, /, type)

Return the type optional<element_type> or raise.

description(*, namespace=None)

Return the description.

element_type()

Return the element type.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

class dsviper.TypeSet(element_type)

A class used to represent a set<element_type> type.

static cast(self, /, type)

Return the type set<element_type> or raise.

description(*, namespace=None)

Return the description.

element_type()

Return the element type.

elements_type()

Return the type for elements.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

class dsviper.TypeString

A class used to represent the string type.

Use the static property Type.STRING.

description(*, namespace=None)

Return the description.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

type_name()

Return a TypeName.

class dsviper.TypeStructure

Not instantiable. A class used to represent a struct type.

static cast(self, /, type)

Return a type struct or raise.

check(field_name)

Return the field or raise.

description(*, namespace=None)

Return the description.

documentation()

Return The documentation.

fields()

Return the list of fields.

is_compact()

Return True the type is compact.

query(field_name)

Return the field or None.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

type_name()

Return a TypeName.

class dsviper.TypeStructureDescriptor(name, *, documentation=None)

A class used to describe the fields of a struct.

add_field(field_name, type_or_value, documentation=None)

Add a field where the type is specified or deducted from the value.

description()

Return the description.

documentation()

Return the documentation.

fields()

Return the list of fields.

name()

Return the name.

class dsviper.TypeStructureField

Not instantiable. A class used to represent a field for a struct.

default_value()

Return the default value or None.

documentation()

Return the documentation.

name()

Return the name.

type()

Return the type.

class dsviper.TypeTuple(types)

A class used to represent a tuple<T0, …> type.

static cast(self, /, type)

Return a type tuple<T0, …> or raise.

description(*, namespace=None)

Return the description.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

types()

Return the list of types.

class dsviper.TypeUInt16

A class used to represent the uint16 type.

Use the static property Type.UINT16.

description(*, namespace=None)

Return the description.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

type_name()

Return a TypeName.

class dsviper.TypeUInt32

A class used to represent the uint32 type.

Use the static property Type.UINT32.

description(*, namespace=None)

Return the description.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

type_name()

Return a TypeName.

class dsviper.TypeUInt64

A class used to represent the uint64 type.

Use the static property Type.UINT64.

description(*, namespace=None)

Return the description.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

type_name()

Return a TypeName.

class dsviper.TypeUInt8

A class used to represent the uint8 type.

Use the static property Type.UINT8.

description(*, namespace=None)

Return the description.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

type_name()

Return a TypeName.

class dsviper.TypeUUId

A class used to represent the uuid type.

Use the static property Type.UUID.

description(*, namespace=None)

Return the description.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

type_name()

Return A TypeName.

class dsviper.TypeVariant(types)

A class used to represent a variant<T0, …> type.

static cast(self, /, type)

Return a type variant<T0, …> or raise.

description(*, namespace=None)

Return the description.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

types()

Return the list of types.

class dsviper.TypeVec(element_type, size)

a class used to represent a vec<element_type, size> type.

static cast(self, /, type)

Return a vec<N, size> or raise.

description(*, namespace=None)

Return the description.

element_type()

Return the element type.

elements_type()

Return the type for elements.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

size()

Return the number of elements.

type_code()

Return the type code.

class dsviper.TypeVector(element_type)

A class used to represent a vector<element_type> type.

static cast(self, /, type)

Return a type vector<element_type> or raise.

description(*, namespace=None)

Return the description.

element_type()

Return the element type.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

class dsviper.TypeVoid

A class used to represent the void type.

Use the static property Type.VOID.

description(*, namespace=None)

Return the description.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

type_name()

Return a TypeName.

class dsviper.TypeXArray(element_type)

A class used to represent a xarray<element_type> type.

static cast(self, /, type)

Return a type xarray<element_type> or raise.

description(*, namespace=None)

Return the description.

element_type()

Return the type.

elements_type()

Return the type for elements.

representation(*, namespace=None)

Return the representation.

runtime_id()

Return the uuid assigned by the runtime.

type_code()

Return the type code.

class dsviper.Value

Not instantiable. A utility class to handle value instantiation and representation.

static bson_decode(module, /, blob, type_structure, definitions)

Return a value by decoding the bson encoded blob of a structure.

static bson_encode(module, /, value)

Return the bson encoded blob of the value.

static collect_blob_ids(module, /, object)

Return the set of blob_id of all referenced blob_id by the object, where object must be a Value, a Path, a CommitState, a CommitMutableState or a CommitCommands.

static copy(module, /, value)

Return a copy of a value (deepcopy).

static create()

Return an initialized value from the type.

static decode(module, /, blob, type, definitions, *, stream_codec_instancing=None, pack_sized=False)

Return a Value by decoding the blob with a StreamBinaryCodec if not specified.

If pack_sized is True, then the vector<T> where T is a Sized type keeps an element in the binary encoded representation. This feature is only used for decoding huge immutable resource by deferred the decoding cost to the method ValueVector.at(index).

static deduce(module, /, value)

Return a strong typed conversion of a Python object.

static dumps(module, /, value, json=False)

Return a projection to Python objects of the strong typed value. If json is True then: - a set is converted to a list. - a map is converted to a list of (key, value).

static encode(module, /, value, *, stream_codec_instancing=None)

Return a blob that encodes the value with a StreamBinaryCodec if not specified.

static hexdigest(module, /, value, *, hashing=None)

Hash the value with the hashing interface if specified else use SHA1.

static json_decode(module, /, string, type, definitions)

Return a value by decoding the json encoded string.

static json_encode(module, /, value, indent=-1)

Return the JSON encoded string for the value.

static loads(module, /, object, type, definitions)

Return a value by decoding the Python object.

static read(module, /, type, stream_reading, definitions, *, pack_sized=False)

Write the value to the blob.

static succ(module, /, value)

Return the successor of a value.

static write(module, /, value, stream_writing)

Write the value to the blob.

class dsviper.ValueAny(initial_value=None)

A class used to represent a value of any type. Seamless with many Python objects.

Or use Value.create(Type.ANY [, initial_value]).

static cast(self, /, value)

Return an any or raise.

clear()

Clear the container.

copy()

Return a deep copy.

description(*, namespace=None)

Return the description.

hash()

Return the hash value.

is_nil()

Return True if there is no value to unwrap.

representation()

Return the representation.

type()

Return the type.

type_code()

Return the type code.

unwrap(*, encoded=True)

Return the wrapped value or raise.

wrap(value)

Wrap a value.

class dsviper.ValueBlob(initial_value=None)

A class used to represent a value of type blob. Seamless with bytes, bytearray and base64_string.

Or use Value.create(Type.BLOB [, initial_value]).

static base64_decode(module, /, base64_string)

Return a blob from a base64 encoded string.

base64_encode()

Return the base64 encoded string representation of this blob.

static cast(self, /, value)

Return a blob or raise.

copy()

Return a deep copy.

description(*, namespace=None)

Return the description.

embed(name)

Return the c++ representation of a blob.

encoded()

Return a Python bytes.

hash()

Return the hash value.

representation()

Return the representation.

sha1()

Return the hexdigest (SHA1).

size()

Return the size.

type()

Return the type.

type_code()

Return the type code.

class dsviper.ValueBlobId(blob_layout, blob)

A class used to represent a value of type blob_id. The uniq identifier is computed from the immutable content of the blob and the layout.

static cast(self, /, value)

Return a blob_id or raise.

copy()

Return a deep copy.

description(*, namespace=None)

Return the description.

encoded()

Return a blob_id.

hash()

Return the hash value.

is_valid()

Return True if the value is not INVALID.

representation()

Return the representation.

static try_parse(self, /, string)

Return a blob_id or None.

type()

Return the type.

type_code()

Return the type code.

class dsviper.ValueBool(value)

A class used to represent a value of type bool. Seamless with a Python bool.

Or use Value.create(Type.BOOL [, True|False]).

static cast(self, /, value)

Return a bool or raise.

copy()

Return a deep copy.

description(*, namespace=None)

Return the description.

encoded()

Return a Python bool.

hash()

Return the hash value.

representation()

Return the representation.

static try_parse(self, /, string)

Return a bool or None.

type()

Return the type.

type_code()

Return the type code.

class dsviper.ValueCommitId(initial_value=None)

A class used to represent a value of type commit_id.

Use the static factory method try_parse(…).

Or use Value.create(Type.COMMIT_ID [, initial_value]).

static cast(self, /, value)

Return a commit_id or raise.

copy()

Return a deep copy.

description(*, namespace=None)

Return the description.

encoded()

Return a Python str.

hash()

Return the hash value.

is_valid()

Return True if the CommitId is not INVALID.

representation()

Return the representation.

static try_parse(self, /, string)

Return a commit_id or None.

type()

Return the type.

type_code()

Return the type code.

class dsviper.ValueDouble(initial_value=None)

A class used to represent a value of type double. Seamless with a Python float.

Or use Value.create(Type.DOUBLE [, initial_value])

static cast(self, /, value)

Return a double or raise.

copy()

Return a deep copy.

description(*, namespace=None)

Return the description.

encoded()

Return a Python float.

hash()

Return the hash value.

representation()

Return the representation.

static try_parse(self, /, string)

Return a double or None.

type()

Return the type.

type_code()

Return the type code.

class dsviper.ValueEnumeration(type_enumeration[, initial_value])

A class used to represent a value of type struct. Seamless with a Python str.

Or use Value.create(type_enumeration [, initial_value]). If the initial_value is not specified, the first enum case is used.

The string representation of an enum case start with a ‘.’. ex: Value.create(type_enum_E, ‘.a’) or Value.create(type_enum_E, ‘E.a’).

static cast(self, /, value)

Return an enum or raise.

copy()

Return a deep copy.

description(*, namespace=None)

Return the description.

index()

Return the index.

name()

Return the name of the enumeration case.

representation()

Return the representation.

static try_parse(self, /, string, type_enumeration)

Return an enum or None.

type()

Return the type.

type_code()

Return the type code.

type_enumeration()

Return the type enum.

class dsviper.ValueFloat(initial_value=None)

A class used to represent a value of type float. Seamless with a Python float.

Or use Value.create(Type.FLOAT [, initial_value]).

static cast(self, /, value)

Return a float or raise.

copy()

Return a deep copy.

description(*, namespace=None)

Return the description.

encoded()

Return a Python float.

hash()

Return the hash value.

representation()

Return the representation.

static try_parse(self, /, string)

Return a float or None.

type()

Return the type.

type_code()

Return the type code.

class dsviper.ValueInt16(initial_value=None)

A class used to represent a value of type int16. Seamless with a Python int.

Or use Value.create(Type.INT16 [, initial_value]).

static cast(self, /, value)

Return an int16 or raise.

copy()

Return a deep copy.

description(*, namespace=None)

Return the description.

encoded()

Return a Python int.

hash()

Return the hash value.

representation()

Return the representation.

static try_parse(self, /, string)

Return an int16 or None.

type()

Return the type.

type_code()

Return the type code.

class dsviper.ValueInt32(initial_value=None)

A class used to represent a value of type int32. Seamless with a Python int.

Or use Value.create(Type.INT32 [, initial_value]).

static cast(self, /, value)

Return an int32 or raise.

copy()

Return a deep copy.

description(*, namespace=None)

Return the description.

encoded()

Return a Python int.

hash()

Return the hash value.

representation()

Return the representation.

static try_parse(self, /, string)

Return an int32 or None.

type()

Return the type.

type_code()

Return the type code.

class dsviper.ValueInt64(initial_value=None)

A class used to represent a value of type int64. Seamless with a Python int.

Or use Value.create(Type.INT64 [, initial_value]).

static cast(self, /, value)

Return an int64 or raise.

copy()

Return a deep copy.

description(*, namespace=None)

Return the description.

encoded()

Return a Python int.

hash()

Return the hash value.

representation()

Return the representation.

static try_parse(self, /, string)

Return an int64 or None.

type()

Return the type.

type_code()

Return the type code.

class dsviper.ValueInt8(initial_value=None)

A class used to represent a value of type int8. Seamless with a Python int.

Or use Value.create(Type.INT8 [, initial_value]).

static cast(self, /, value)

Return an int8 or raise.

copy()

Return a deep copy.

description(*, namespace=None)

Return the description.

encoded()

Return a Python int.

hash()

Return the hash value.

representation()

Return the representation.

static try_parse(self, /, string)

Return an int8 or None.

type()

Return the type.

type_code()

Return the type code.

class dsviper.ValueKey

Not instantiable. A class used to represent a value of type key<element_type>.

Use the static factory method create(…).

static cast(self, /, value)

Return a key or raise.

copy()

Return a deep copy.

static create(module, /, type_concept, instance_id=None)

Return a new key with the instance_id or a generated one if not specified.

description(*, namespace=None)

Return the description.

detail_representation()

Return a detailed representation.

detail_type_representation()

Return the detail type representation.

has_parent_key()

Return True if a parent key is available.

hash()

Return the hash value.

instance_id()

Return the uuid of the instance.

is_member(target_concept)

Return True if target_concept is a member.

static keys(module, /, key)

Return the list of hierarchical keys.

representation()

Return the representation.

to_any_concept_key()

Return an key<any_concept>.

to_club_key(type_club)

Return a key<type_club> or raise.

to_concept_key()

Return a key<type_concept>.

to_key(type_key)

Return a key<type_key> or raise.

to_member_key(target_concept)

Return a key<target_concept> or raise.

to_parent_key()

Return a key<parent_concept> or raise.

type()

Return the type.

type_code()

Return the type code.

type_concept()

Return the type of the concept.

type_key()

Return the TypeKey.

class dsviper.ValueMap(type_map[, initial_value])

A class used to represent a value of type map<key_type, element_type>. Seamless with a Python dict[object, object].

Or use Value.create(type_map [, initial_value]).

at(key, *, encoded=True)

Return the value for a key.

static cast(self, /, value)

Return a map or raise.

clear()

Remove all items.

contains(key)

Return True if the value is present.

copy()

Return a deep copy.

description(*, namespace=None)

Return the description.

discard(key)

Remove the key if present.

empty()

Return True if the container is empty.

get(key, default)

Return the value associated with the key or default.

hash()

Return the hash value.

items(*, encoded=True)

Return a MapItemsIter.

keys(*, encoded=True)

Return a MapKeysIter.

max(*, encoded=True)

Return the max key.

min(*, encoded=True)

Return the min key.

pop(key, default=None, *, encoded=True)

Remove the key and return the corresponding value. If the key is not found, return the default if given; otherwise raise.

popitem()

Remove and return a (key, value) pair as a 2-tuple. Raises error if the map is empty.

remove(key)

Remove the key or raises.

representation()

Return the representation.

set(key, value)

Set the value for a key.

setdefault(key, value)

Insert the value for the key if the key is not in the map. Return the value for the key if the key is in the map, else default.

size()

Return the number of elements.

type()

Return the type.

type_code()

Return the type code.

type_map()

Return the type map<key_type, element_type>.

update(value)

for k, v in other: self[key] = v.

values(*, encoded=True)

Return a MapValuesIter.

class dsviper.ValueMapItemsIter

Not instantiable.

class dsviper.ValueMapKeysIter

Not instantiable.

class dsviper.ValueMapValuesIter

Not instantiable.

class dsviper.ValueMat(type_mat[, initial_value])

A class used to represent a value of type mat<element_type, columns, rows>. Seamless with a Python seq[seq[int|float]].

Or use Value.create(type_mat [, initial_value]).

at(column, row, *, encoded=True)

Return the value at column and row.

static cast(self, /, value)

Return a mat or raise.

columns()

Return the number of columns.

copy()

Return a deep copy.

description(*, namespace=None)

Return the description.

hash()

Return the hash value.

representation()

Return the representation.

rows()

Return the number of rows.

set(column, row, value)

Set the value at column, row.

size()

Return the number of elements.

to_tuple()

Return a tuple.

type()

Return the type.

type_code()

Return the type code.

type_mat()

Return the type mat<element_type, size>.

class dsviper.ValueOptional(type_optional, initial_value)

A class used to represent a value of type optional<element_type>.

Or use Value.create(type_optional [, initial_value]).

static cast(self, /, value)

Return an optional or raise.

clear()

Clear the container.

copy()

Return a deep copy.

description(*, namespace=None)

Return the description.

get(default=None, *, encoded=True)

Return the wrapped value or return default if given; otherwise raise.

is_nil()

Return True if there is no value to unwrap.

representation()

Return the representation.

type()

Return the type.

type_code()

Return the type code.

type_optional()

Return the type optional<element_type>.

unwrap(*, encoded=True)

Return the wrapped value or raise.

wrap(value)

Wrap the value.

class dsviper.ValueSet(type_set[, initial_value])

A class used to represent a value of type set<element_type>. Seamless with a Python seq[object].

Or use Value.create(type_set [, initial_value]).

add(value)

Add an element to a set. This has no effect if the element is already present.

at(index, *, encoded=True)

Return the element at index.

static cast(self, /, value)

Return a set or raise.

clear()

Remove all elements from this set.

copy()

Return a deep copy.

description(*, namespace=None)

Return the description.

difference(value)

Return the difference of two or more sets as a new set. (i.e., all elements that are in this set but not the others.)

difference_update(value)

Remove all elements of another set from this set.

discard(value)

Remove an element from a set; it must be a member. If the element is not a member, do nothing.

empty()

Remove True if the container is empty.

extend(elements)

Add the elements of value.

hash()

Return the hash value.

index(value)

Return the index or None.

intersection(value)

Return the intersection of two sets as a new set. (i.e., all elements that are in both sets.)

intersection_update(value)

Update a set with the intersection of itself and another.

isdisjoint(value)

Return True if two sets have a null intersection.

issubset(value)

Report whether another set contains this set.

issuperset(value)

Report whether this set contains another set.

max(*, encoded=True)

Return the maximum element or raise.

min(*, encoded=True)

Return the minimum element or raise.

pop(*, encoded=True)

Remove and return the min element. Raises error if the set is empty.

pop_max(*, encoded=False)

Remove and return the max element. Raises error if the set is empty.

remove(value)

Remove an element from a set; it must be a member. If the element is not a member, raise a KeyError.

representation()

Return the representation.

size()

Return the number of elements.

symmetric_difference(value)

Return the symmetric difference of two sets as a new set. (i.e., all elements that are in exactly one of the sets.)

symmetric_difference_update(value)

Update a set with the symmetric difference of itself and another.

type()

Return the type.

type_code()

Return the type code.

type_set()

Return the type set<element_type>.

union(value)

Return the union of sets as a new set. (i.e., all elements that are in either set).

update(value)

Update a set with the union of itself and other.

class dsviper.ValueSetIter

Not instantiable.

class dsviper.ValueString(initial_value=None)

A class used to represent a value of type string. Seamless with a Python str.

Or use Value.create(Type.STRING [, initial_value]).

static cast(self, /, value)

Return a string or raise.

copy()

Return a deep copy.

description(*, namespace=None)

Return the description.

encoded()

Return a Python str.

hash()

Return the hash value.

representation()

Return the representation.

type()

Return the type.

type_code()

Return the type code.

class dsviper.ValueStructure(type_structure[, initial_value])

A class used to represent a value of type struct. Seamless with a Python dict[str, object].

Or use Value.create(type_structure [, initial_value]).

at(field_name, *, encoded=True)

Return the value of the field.

static cast(self, /, value)

Return a struct or raise.

copy()

Return a deep copy.

description(*, namespace=None)

Return the description.

hash()

Return the hash value.

representation()

Return the representation.

set(field_name, value)

Set the value of the field.

type()

Return the type.

type_code()

Return the type code.

type_structure()

Return the type struct.

class dsviper.ValueTuple(type_tuple[, initial_value])

A class used to represent a value of type tuple<T0, …>. Seamless with a Python seq[object].

Or use Value.create(type_tuple [, initial_value]).

at(index, *, encoded=True)

Return the value at index.

static cast(self, /, value)

Return a tuple or raise.

copy()

Return a deep copy.

description(*, namespace=None)

Return the description.

empty()

Remove True if the container is empty.

hash()

Return the hash value.

replace(index, value)

Return a copy of the tuple where the value was replaced.

representation()

Return the representation.

set(index, value)

Set the value at index.

size()

Return the number of elements.

type()

Return the type.

type_code()

Return the type code.

type_tuple()

Return the type tuple<T0,…>.

class dsviper.ValueTupleIter

Not instantiable.

class dsviper.ValueUInt16(initial_value=None)

A class used to represent a value of type uint16. Seamless with a Python int.

Or use Value.create(Type.UINT16 [, initial_value]).

static cast(self, /, value)

Return an uint16 or raise.

copy()

Return a deep copy.

description(*, namespace=None)

Return the description.

encoded()

Return a Python int.

hash()

Return the hash value.

representation()

Return the representation.

static try_parse(self, /, string)

Return an uint16 or None.

type()

Return the type.

type_code()

Return the type code.

class dsviper.ValueUInt32(initial_value=None)

A class used to represent a value of type uint32. Seamless with a Python int.

Or use Value.create(Type.UINT32 [, initial_value]).

static cast(self, /, value)

Return an uint32 or raise.

copy()

Return a deep copy.

description(*, namespace=None)

Return the description.

encoded()

Return a Python int.

hash()

Return the hash value.

representation()

Return the representation.

static try_parse(self, /, string)

Return an uint32 or None.

type()

Return the type.

type_code()

Return the type code.

class dsviper.ValueUInt64(initial_value=None)

A class used to represent a value of type uint64. Seamless with a Python int.

Or use Value.create(Type.UINT64 [, initial_value]).

static cast(self, /, value)

Return an uint64 or raise.

copy()

Return a deep copy.

description(*, namespace=None)

Return the description.

encoded()

Return a Python int.

hash()

Return the hash value.

representation()

Return the representation.

static try_parse(self, /, string)

Return an uint64 or None.

type()

Return the type.

type_code()

Return the type code.

class dsviper.ValueUInt8(initial_value=None)

A class used to represent a value of type uint8. Seamless with a Python int.

Or use Value.create(Type.UINT8 [, initial_value]).

static cast(self, /, value)

Return an uint8 or raise.

copy()

Return a deep copy.

description(*, namespace=None)

Return the description.

encoded()

Return a Python int.

hash()

Return the hash value.

representation()

Return the representation.

static try_parse(self, /, string)

Return an uint8 or None.

type()

Return the type.

type_code()

Return the type code.

class dsviper.ValueUUId(initial_value=None)

A class used to represent a value of type uuid.

Use the static factory method create(…) or try_parse(…).

Or use Value.create(Type.UUID [, initial_value]).

static cast(self, /, value)

Return an uuid or raise.

copy()

Return a deep copy.

static create(module, /, uuid_string=None)

Return an uuid from uuid_string if specified otherwise a generated one.

description(*, namespace=None)

Return the description.

encoded()

Return a Python str.

hash()

Return the hash value.

is_valid()

Return True if the value is not INVALID.

representation()

Return the representation.

static try_parse(self, /, string)

Return an uuid or None.

type()

Return the type.

type_code()

Return the type code.

class dsviper.ValueVariant

ValueVariant(type_variant, initial_value). A class used to represent a value of type variant<T0, …>. Seamless with a Python object compatible with the variant’s types.

Or use Value.create(type_variant [, initial_value]).

static cast(self, /, value)

Return a variant<T0, …> or raise.

copy()

Return a deep copy.

description(*, namespace=None)

Return the description.

hash()

Return the hash value.

representation()

Return the representation.

type()

Return the type.

type_code()

Return the type code.

type_variant()

Return the type variant<T0, …>.

unwrap(*, encoded=True)

Return the value or raise.

wrap(value, type=None)

wrap a value.

class dsviper.ValueVec

ValueVec(type_vec [, initial_value]). A class used to represent a value of type vec<element_type, size>. Seamless with a Python seq[int|real].

Or use Value.create(type_vec [, initial_value]).

at(index, *, encoded=True)

Return the value at index.

static cast(self, /, value)

Return a vec<element_type, size> or raise.

copy()

Return a deep copy.

description(*, namespace=None)

Return the description.

hash()

Return the hash value.

representation()

Return the representation.

set(index, value)

Set the value at index.

size()

Return the number of elements.

to_tuple()

Return a tuple.

type()

Return the type.

type_code()

Return the type code.

type_vec()

Return the type vec<element_type, size>.

class dsviper.ValueVector(type_vector[, initial_value])

A class used to represent a value of type vector<element_type>. Seamless with a Python seq[object].

Or use Value.create(type_vector [, initial_value]).

append(value)

Append value to the end of the vector.

at(index, *, encoded=True)

Return the value at index.

back(*, encoded=False)

Return the back element or raise.

capacity()

Return the capacity.

static cast(self, /, value)

Return a vector<element_type> or raise.

clear()

Remove all items.

contains(value)

Return True if the value is present.

copy()

Return a deep copy.

count(value)

Return the number of occurrences for the value.

description(*, namespace=None)

Return the description.

empty()

Return True if the container is empty.

exchange(idx1, idx2)

Exchange the value at idx1 with the value at idx2.

extend(values)

Extend the vector by appending the values.

front(*, encoded=False)

Return the front element or raise.

hash()

Return the hash value.

index(value)

Return the first index of value.

insert(index, value)

Insert object before index.

is_pack_sized()

Return True if the vector packs elements in a contiguous array of binary encoded elements.

pop(index=-1, *, encoded=True)

Remove and return item at index (default last). Raises error if the vector is empty or the index is out of range.

remove(value)

Remove first occurrence of value. Raises error if the value is not present.

representation()

Return the representation.

reserve(size)

Reserve space for size.

resize(size)

Resize the vector for size.

set(index, value)

Set the value at index.

shrink_to_fit()

Shrink to fit.

size()

Return the number of elements.

type()

Return the type.

type_code()

Return the type code.

type_vector()

Return the type vector<element_type>.

class dsviper.ValueVectorIter

Not instantiable.

class dsviper.ValueVoid

Not instantiable. A class used to represent a value of type void. Seamless with Python None.

Or use Value.create(Type.VOID).

static cast(self, /, value)

Return void or raise.

copy()

Return a deep copy.

description(*, namespace=None)

Return the description.

encoded()

Return Python None.

hash()

Return the hash value.

representation()

Return the representation.

type()

Return the type.

type_code()

Return the type code.

class dsviper.ValueXArray(type_xarray[, initial_value])

A class used to represent a value of type xarray<element_type>. Seamless with a Python seq[object].

Or use Value.create(type_xarray [, initial_value]).

append(value)

Append value to the end.

at(position, *, encoded=True)

Return the element at the position or None.

static cast(self, /, value)

Return a xarray<element_type> or raise.

copy()

Return a deep copy.

static create_position(module, /)

Create and return a position.

description(*, namespace=None)

Return the description.

disable_position(position)

Disable the position.

extend(values)

Extend by appending the values.

has_position(position)

Return True if the position exists.

hash()

Return the hash value.

index(position)

Return the index of the position.

insert(before_position, value, new_position=None)

Insert the value before_position and return the new position. Use new_position if specified, else a new position is created.

insert_position(before_position, new_position)

Insert before_position a new_position.

items()

Return the list of positions with a value.

position(index)

Return the position for the index or None.

position_of(value)

Return the position of the value or None.

positions()

Return the list of positions.

remove(position)

Remove the element at the position.

representation()

Return the representation.

set(position, value)

Set the value at the position.

to_vector()

Convert to a vector<element_type>.

type()

Return the type.

type_code()

Return the type code.

type_xarray()

Return the type xarray<element_type>.

exception dsviper.ViperError