datatype
superduper.base.datatype
get_hash
​
get_hash(data)
Parameter | Description |
---|---|
data | Data to hash. |
Get the hash of the given data.
hash_indescript
​
hash_indescript(item)
Parameter | Description |
---|---|
item | The 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
Parameter | Description |
---|---|
bytes | The bytes blob. |
identifier | Identifier of the blob. |
builder | Function to rebuild object from bytes. |
db | The 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
Parameter | Description |
---|---|
identifier | Identifier of the file. |
db | The Datalayer. |
path | Path to file. |
Placeholder for a file.
Array
​
Array(self,
*,
dtype: str = 'float64',
shape: Union[int,
Tuple[int]]) -> None
Parameter | Description |
---|---|
dtype | numpy native datatype. |
shape | Shape of array. |
Encode/ decode a numpy array as bytes.
BaseVector
​
BaseVector(self,
*,
dtype: str = 'float64',
shape: int) -> None
Parameter | Description |
---|---|
shape | size of vector |
dtype | Datatype 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
Parameter | Description |
---|---|
identifier | The 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
Parameter | Description |
---|---|
dtype | Datatype of encoded arrays. |
shape | Shape 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
Parameter | Description |
---|---|
identifier | Identifier of the object. |
db | The Datalayer. |
A Saveable base class.
Vector
​
Vector(self,
*,
dtype: str = 'float64',
shape: int) -> None
Parameter | Description |
---|---|
dtype | Datatype of encoded arrays. |
shape | Shape of array. |
Vector meta-datatype for encoding vectors ready for search.