Item key

The item key is the unique identifier that

Item value

DB1 serializes item values and stores them as binary blobs. The serializer can encode most common data types and nested data structures. For a complete list, see tables below.

Data types

Description Python Type JavaScript Type CLI Format
A signed integer type. int number
A floating point number type. float number
A string type. str string
A boolean type. bool boolean NA
A bytes (binary data) type. bytes Uint8Array NA
A multi-dimensional array, typically used for numerical computations. np.ndarray ndarray NA
A table-like data structure, typically used for data analysis and manipulation. pd.DataFrame Table NA

Data structs

Description Python Type JavaScript Type CLI Format
A list type, which is an ordered collection of objects. The elements can be any of the supported types. list Array JSON
A map type, which is an unordered collection of key-value pairs, where keys are strings and values are any of the supported types. Dict Object JSON

Examples

Python

db1.set_item(key, 'Hello, World!')
db1.set_item(key, {
	'pandas_df' : pd.read_csv('./report.csv'),
	'numpy_array' : np.ones(10),
	'a boolean' : True,
	'a list' : [1, 2, 3, 'four', np.array(5), {'num': 6}],
	'img' : cv2.imread('./image.jpg') # Can be viewed in browser/Notion!
})