> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tilebox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Client.create_or_update_dataset

```python theme={"system"}
def Client.create_or_update_dataset(
    kind: DatasetKind,
    code_name: str,
    name: str | None = None,
    custom_fields: list[FieldDict],
) -> Dataset
```

Create a dataset.

## Parameters

<ParamField path="kind" type="DatasetKind">
  The kind of the dataset
</ParamField>

<ParamField path="code_name" type="str">
  The code name of the dataset
</ParamField>

<ParamField path="name" type="str | None">
  The name of the dataset
</ParamField>

<ParamField path="custom_fields" type="list[FieldDict]">
  The fields of the dataset
</ParamField>

## Dataset kinds

<ParamField path="DatasetKind.TEMPORAL" type="DatasetKind">
  A dataset that contains a timestamp field
</ParamField>

<ParamField path="DatasetKind.SPATIOTEMPORAL" type="DatasetKind">
  A dataset that contains a timestamp field and a geometry field
</ParamField>

## Field types

<ParamField path="str" type="type">
  A string field
</ParamField>

<ParamField path="bytes" type="type">
  A bytes field
</ParamField>

<ParamField path="bool" type="type">
  A boolean field
</ParamField>

<ParamField path="int" type="type">
  A 64-bit signed integer field
</ParamField>

<ParamField path="np.uint64" type="type">
  A 64-bit unsigned integer field
</ParamField>

<ParamField path="float" type="type">
  A 64-bit floating-point number field
</ParamField>

<ParamField path="datetime.timedelta" type="type">
  A duration field
</ParamField>

<ParamField path="datetime.datetime" type="type">
  A timestamp field
</ParamField>

<ParamField path="uuid.UUID" type="type">
  A UUID field
</ParamField>

<ParamField path="shapely.Geometry" type="type">
  A geometry field
</ParamField>

Note that the type can also be a list of one of the types, indicating that the field is an array, e.g. `list[str]`.

## Field options

<ParamField path="name" type="str" required>
  Set the name of the field
</ParamField>

<ParamField path="type" type="type" required>
  Set the type of the field
</ParamField>

<ParamField path="description" type="str">
  Set the description of the field to provide more context and details about the data
</ParamField>

<ParamField path="example_value" type="str">
  Set the example value of the field for documentation purposes
</ParamField>

## Returns

The created dataset object.

<RequestExample>
  ```python Python theme={"system"}
  from shapely import Geometry

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