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

# Collate Python SDK quickstart

> Install the OpenMetadata Python SDK, connect to Collate, and create, retrieve, update, and delete a table.

# Collate Python SDK quickstart

Collate uses the `openmetadata-ingestion` Python package for typed metadata operations. Match the package release line to your Collate server release.

## Install the SDK

For Collate 1.13.1, install a package from the matching server patch line:

```bash theme={null}
pip install "openmetadata-ingestion~=1.13.1.0"
```

## Configure the connection

Set the Collate API URL and an ingestion bot JSON Web Token (JWT):

```bash theme={null}
export OPENMETADATA_HOST="https://your-company.getcollate.io/api"
export OPENMETADATA_JWT_TOKEN="your-jwt-token"
```

Call `configure()` once when the application starts. Entity classes reuse the configured client.

```python theme={null}
from metadata.sdk import configure

configure()
```

Pass credentials directly when environment variables aren't available:

```python theme={null}
from metadata.sdk import configure

configure(
    host="https://your-company.getcollate.io/api",
    jwt_token="your-jwt-token",
)
```

## Manage a table

The following example creates, retrieves, updates, and soft-deletes a table. Replace `sample_data.ecommerce_db.shopify` with the fully qualified name of an existing database schema.

```python theme={null}
from metadata.generated.schema.api.data.createTable import CreateTableRequest
from metadata.generated.schema.entity.data.table import Column, DataType
from metadata.generated.schema.type.basic import Markdown
from metadata.sdk import Tables, configure

configure()

schema_fqn = "sample_data.ecommerce_db.shopify"

# Create or update the table.
created = Tables.create(
    CreateTableRequest(
        name="customers",
        databaseSchema=schema_fqn,
        description="Customer master data",
        columns=[
            Column(name="id", dataType=DataType.BIGINT),
            Column(name="email", dataType=DataType.VARCHAR, dataLength=320),
            Column(name="created_at", dataType=DataType.TIMESTAMP),
        ],
    )
)
print(f"Created: {created.fullyQualifiedName}")

# Retrieve by fully qualified name.
table = Tables.retrieve_by_name(f"{schema_fqn}.customers")
if table is None:
    raise RuntimeError("Table was not found")

# Update the description.
table.description = Markdown("Customer master data managed with the Python SDK")
updated = Tables.update(table)
print(f"Updated: {updated.description}")

# Soft-delete the table. Soft-deleted entities remain recoverable.
Tables.delete(updated.id)
```

`Tables.create()` is idempotent. It creates the table when it doesn't exist and updates it when the fully qualified name already exists.

<Warning>
  Avoid `hard_delete=True` unless permanent removal is intended. Hard deletes can't be undone.
</Warning>

## Next steps

* [Review all table creation fields](/api-reference/data-assets/tables/create).
* [Explore Python SDK entity classes](/sdk/python/fluent).
* [Run the OpenMetadata Python SDK examples](https://github.com/open-metadata/openmetadata-demo/tree/main/sdk-examples).
