Skip to main content
Version: Main branch

datatype

superduper.base.datatype

Source code

get_hash​

get_hash(data)
ParameterDescription
dataData to hash.

Get the hash of the given data.

hash_indescript​

hash_indescript(item)
ParameterDescription
itemThe item to hash.

Hash a range of items.

BaseDataType​

BaseDataType(self) -> None

Base class for datatype.

Blob​

Blob(self,
db: 'Datalayer' = None,
*,
identifier: str = '',
bytes: bytearray | None = None,
builder: Callable) -> None
ParameterDescription
bytesThe bytes blob.
identifierIdentifier of the blob.
builderFunction to rebuild object from bytes.
dbThe Datalayer.

Placeholder for a blob of bytes.

BaseType​

BaseType(self) -> None

Datatype for encoding base instances.

ComponentType​

ComponentType(self) -> None

Datatype for encoding Component instances.

FileItem​

FileItem(self,
identifier: str,
db: 'Datalayer' = None,
*,
path: str = '') -> None
ParameterDescription
identifierIdentifier of the file.
dbThe Datalayer.
pathPath to file.

Placeholder for a file.

Array​

Array(self,
*,
dtype: str = 'float64',
shape: Union[int,
Tuple[int]]) -> None
ParameterDescription
dtypenumpy native datatype.
shapeShape of array.

Encode/ decode a numpy array as bytes.

BaseVector​

BaseVector(self,
*,
dtype: str = 'float64',
shape: int) -> None
ParameterDescription
shapesize of vector
dtypeDatatype of array to encode.

Base class for vector.

ComponentDict​

ComponentDict(self) -> None

Datatype for encoding dictionaries which are supported as dict by databackend.

ComponentList​

ComponentList(self) -> None

Datatype for encoding lists which are supported as list by databackend.

Dill​

Dill(self) -> None

Serializer with dill.

# This is also the default serializer.
from superduper.components.datatype import DEFAULT_SERIALIZER

DillEncoder​

DillEncoder(self) -> None

Encoder with dill.

FieldType​

FieldType(self,
identifier: str) -> None
ParameterDescription
identifierThe identifier of the datatype.

Field type to represent the type of a field in a table.

This is a wrapper around a database's native datatypes.

File​

File(self) -> None

Type for encoding files on disk.

FileDict​

FileDict(self) -> None

Datatype for encoding dictionaries of files.

JSON​

JSON(self) -> None

Datatype for encoding json-able items.

NativeVector​

NativeVector(self,
*,
dtype: str = 'float',
shape: int) -> None
ParameterDescription
dtypeDatatype of encoded arrays.
shapeShape of array.

Datatype for encoding vectors which are supported as list by databackend.

Pickle​

Pickle(self) -> None

Serializer with pickle.

PickleEncoder​

PickleEncoder(self) -> None

Pickle encoder.

Saveable​

Saveable(self,
identifier: str,
db: 'Datalayer' = None) -> None
ParameterDescription
identifierIdentifier of the object.
dbThe Datalayer.

A Saveable base class.

Vector​

Vector(self,
*,
dtype: str = 'float64',
shape: int) -> None
ParameterDescription
dtypeDatatype of encoded arrays.
shapeShape of array.

Vector meta-datatype for encoding vectors ready for search.