Skip to main content
def Client.create_dataset(
    kind: DatasetKind,
    code_name: str,
    fields: list[FieldDict],
    *,
    name: str | None = None,
    description: str | None = None
) -> Dataset
Create a dataset.

Parameters

kind
DatasetKind
The kind of the dataset
code_name
str
The code name of the dataset
fields
list[FieldDict]
The fields of the dataset
name
str | None
The name of the dataset
description
str | None
A short description of the dataset

Dataset kinds

DatasetKind.TEMPORAL
DatasetKind
A dataset that contains a timestamp field
DatasetKind.SPATIOTEMPORAL
DatasetKind
A dataset that contains a timestamp field and a geometry field

Field types

str
type
A string field
bytes
type
A bytes field
bool
type
A boolean field
int
type
A 64-bit signed integer field
np.uint64
type
A 64-bit unsigned integer field
float
type
A 64-bit floating-point number field
datetime.timedelta
type
A duration field
datetime.datetime
type
A timestamp field
uuid.UUID
type
A UUID field
shapely.Geometry
type
A geometry field
Note that the type can be a list of the types above, indicating that the field is an array, e.g. list[str].

Field options

name
str
required
Set the name of the field
type
type
required
Set the type of the field
description
str
Set the description of the field to provide more context and details about the data
example_value
str
Set the example value of the field for documentation purposes

Returns

The created dataset object.
from shapely import Geometry

dataset = client.create_dataset(
    DatasetKind.SPATIOTEMPORAL,
    "my_catalog",
    [
        {
            "name": "field1",
            "type": str,
        },
        {
            "name": "field2",
            "type": list[int],
        },
        {
            "name": "field3",
            "type": Geometry,
            "description": "Field 3",
            "example_value": "Value 3",
        },
    ],
    name="My personal catalog",
)