unitycatalog-rs (Python)
The Python client of unitycatalog-rs, a
Unity Catalog server written in Rust. It calls the server's APIs from Python, with or without
asyncio, and has a method for each API route. It also works with upstream's Unity Catalog OSS
server for the APIs that both servers have.
It installs as unitycatalog-rs and imports as unitycatalog. It needs Python 3.12 or later.
pip install unitycatalog-rs # the client
pip install 'unitycatalog-rs[all]' # also the uc CLI, the server and the web UI
The extras install the other packages of unitycatalog-rs, at the same version:
| Extra | Installs |
|---|---|
cli |
the uc CLI |
server |
uc-server, and uc |
ui |
the web UI, and uc |
all |
all of the above |
With the server extra, uc dev starts a server on http://localhost:8080, with the web UI.
Quick start
from unitycatalog import Client, NotFoundError
client = Client("http://localhost:8080/")
client.create_catalog("main", comment="primary")
client.create_schema("default", "main")
print([c.name for c in client.list_catalogs()])
client.catalog("main").update(comment="the main catalog")
try:
client.catalog("missing").get()
except NotFoundError as e:
print(e.code, e.message) # CATALOG_NOT_FOUND Catalog not found: missing
Sign-in
When the server needs sign-in, the client sends a token with each request. It gets one in one of these ways:
import os
from unitycatalog import Client, identity
# A fixed token: a personal access token, or a token of the server.
client = Client("https://uc.example.com/", token=os.environ["UC_TOKEN"])
# A token provider: a cloud identity, an OAuth client, or a function that returns a token.
client = Client(
"https://uc.example.com/",
token_provider=identity.azure("https://uc.example.com/.default"),
)
client = Client(
"https://uc.example.com/", token_provider=identity.aws("https://uc.example.com")
)
# No token: the client uses the identity of the environment, such as AZURE_*, AWS_* or
# GOOGLE_APPLICATION_CREDENTIALS variables, or UC_TOKEN.
client = Client("https://uc.example.com/")
Async
Each method that sends a request also comes as <name>_async, which returns an awaitable. Call
it in a running event loop:
import asyncio
async def main() -> None:
catalog, schemas = await asyncio.gather(
client.catalog("main").get_async(),
client.list_schemas_async("main"),
)
asyncio.run(main())
The sync methods release the GIL while they wait, so other Python threads keep running.
How the API works
- Handles. The requests on one object are on its handle:
client.catalog(name),client.schema(full_name),client.table(full_name)and so on. Making a handle sends no request. - Arguments. They have the names of the REST API's fields. Required arguments are positional; the others are keyword-only.
- Results. Results are frozen classes, such as
CatalogInfoandTableInfo, with each field of the API's JSON as an attribute. They compare by value, and their repr shows the fields that are set. The classes are in a module per API area, such asunitycatalog.tables(ColumnInfo,TableInfo). - Enums. Enums are
enum.StrEnumclasses, such asTableType. A parameter takes a member or its name ("MANAGED"). Another string raisesValueError. - JSON values. Arguments that hold free-form JSON, such as the rows of
restore_backupor thevalueof aScimPatchOperation, takedict,list,str,int,float,boolandNone. - Lists. The list methods return every item: they read one page after the other.
max_resultslimits the number of items.list_audit_events,search_objectsand the Iceberg lists return one page, with itsnext_page_token.list_usersandlist_groupsreturncountitems fromstart_index. - Exists checks.
delta_table_exists,iceberg_namespace_existsandiceberg_table_existsreturnTrue, orFalsewhen the server answers 404.
Errors
An error from the server raises UnityCatalogError, or its subclass for the HTTP status:
| Exception | Status |
|---|---|
BadRequestError |
400 |
UnauthenticatedError |
401 |
PermissionDeniedError |
403 |
NotFoundError |
404 |
ConflictError |
409 |
RateLimitError |
429 |
ServerError |
5xx |
Each has the error code (code), the message (message), the status (status) and the details
(details). When the server does not answer, the client raises UnityCatalogError with no code
and no status.
Methods
Each method also comes as <name>_async. A handle method, such as catalog(name), returns the
handle, and the handle's methods also come as <name>_async.
| Resource | Methods |
|---|---|
| Catalogs | create_catalog, list_catalogs; catalog(name): get, update, delete |
| Schemas | create_schema, list_schemas; schema(full_name): get, update, delete |
| Tables | create_table, create_staging_table, list_tables; table(full_name): get, delete |
| Volumes | create_volume, list_volumes; volume(full_name): get, update, delete |
| Files | upload_file, download_file, get_file_metadata, delete_file, create_directory, list_directory_contents, get_directory_metadata, delete_directory |
| Functions | create_function, list_functions; function(full_name): get, delete |
| Registered models | create_registered_model, list_registered_models; registered_model(full_name): get, update, delete |
| Model versions | create_model_version, get_model_version, list_model_versions, update_model_version, delete_model_version, finalize_model_version |
| Search | search_objects |
| Credentials | create_credential, list_credentials; credential(name): get, update, delete |
| External locations | create_external_location, list_external_locations; external_location(name): get, update, delete |
| Temporary credentials | generate_temporary_table_credentials, generate_temporary_volume_credentials, generate_temporary_path_credentials, generate_temporary_model_version_credentials |
| Permissions | get_permissions, update_permissions |
| Metastore, health | get_metastore_summary, get_health, get_version |
| Personal access tokens | create_token, list_tokens; token(id): delete |
| Sign-in | exchange_token, request_access_token, get_auth_mode, logout |
| SCIM users and groups | create_user, get_user, list_users, search_users, replace_user, patch_user, delete_user, get_me, create_group, get_group, list_groups, search_groups, replace_group, patch_group, delete_group, search_resources, scim_bulk, list_scim_schemas, get_scim_schema, list_scim_resource_types, get_scim_resource_type, get_service_provider_config |
| Admin (a signed-in admin) | get_backup, restore_backup, list_audit_events |
| Shares and recipients | create_share, list_shares, create_recipient, list_recipients, activate_recipient_token; share(name): get, update, delete, get_share_permissions, update_share_permissions; recipient(name): get, update, delete, rotate_recipient_token |
| Iceberg REST catalog | get_iceberg_config, list_iceberg_namespaces, create_iceberg_namespace, load_iceberg_namespace, iceberg_namespace_exists, update_iceberg_namespace_properties, drop_iceberg_namespace, list_iceberg_tables, create_iceberg_table, load_iceberg_table, iceberg_table_exists, commit_iceberg_table, rename_iceberg_table, drop_iceberg_table, load_iceberg_table_credentials, report_iceberg_metrics, load_iceberg_view |
| Delta API | get_delta_config, create_delta_staging_table, get_delta_staging_table_credentials, create_delta_table, load_delta_table, update_delta_table, delta_table_exists, rename_delta_table, delete_delta_table, get_delta_table_credentials, report_delta_table_metrics |
| Delta commits | get_delta_commits, commit_delta |
help(Client.create_table) shows the arguments of a method. The
documentation has a guide and the full
Python API reference.
License
Apache-2.0
Metadata
Release files for unitycatalog-rs 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 92.6 MB
Release files / unitycatalog_rs-0.0.2-cp314-cp314t-win_amd64.whl
| Download URL | unitycatalog_rs-0.0.2-cp314-cp314t-win_amd64.whl |
|---|---|
| Size | 6.8 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Windows x86-64 |
|
SHA-256 checksum How to use checksums |
518a0d1fd439886d1f2a8e58e1a0c8e253bdc03566c8bea5abcf144d095506a5
|
|
BLAKE2b-256 checksum How to use checksums |
3149b714f4aa6825ae5c2fa71effa3b3cb28711c831d1ba75daf3185a0bd1d11
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.16.0
|
Release files / unitycatalog_rs-0.0.2-cp314-cp314t-musllinux_1_2_x86_64.whl
| Download URL | unitycatalog_rs-0.0.2-cp314-cp314t-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 7.0 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
2f02ed2723d73ab696b1f9ddbda2963cd4528f45d0c5106f634336d515b0d61e
|
|
BLAKE2b-256 checksum How to use checksums |
a2549b155bc655a26347ca72580ba049456ea3cf004429550aeabe0f76747ade
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.16.0
|
Release files / unitycatalog_rs-0.0.2-cp314-cp314t-musllinux_1_2_aarch64.whl
| Download URL | unitycatalog_rs-0.0.2-cp314-cp314t-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 6.7 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux musl 1.2+ ARM64 |
|
SHA-256 checksum How to use checksums |
4ccfa27e60a1b398a829a0d0c530166d7ee80409996919b5932768d172152576
|
|
BLAKE2b-256 checksum How to use checksums |
fc88b3fd0b6cb5201177ac31e7ca988f8f03b9a08d28a731f26a50d7dc364134
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.16.0
|
Release files / unitycatalog_rs-0.0.2-cp314-cp314t-manylinux_2_28_x86_64.whl
| Download URL | unitycatalog_rs-0.0.2-cp314-cp314t-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 6.7 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
ab90e8c831a1f31b6a15e43a50a30358305adf1062e9a66bfd0d90bca0910a1e
|
|
BLAKE2b-256 checksum How to use checksums |
ac1be981de040d204d9baf788b19d9c3e73b32a765bbd7eaf394ee3f8fcf7ed7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.16.0
|
Release files / unitycatalog_rs-0.0.2-cp314-cp314t-manylinux_2_28_aarch64.whl
| Download URL | unitycatalog_rs-0.0.2-cp314-cp314t-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 6.5 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
f09dacfdc73669727daf4c920702cfbb025fd506639ae6e2cb390bcdafcb8aae
|
|
BLAKE2b-256 checksum How to use checksums |
3c635e5a9a946d2b0c54843d660d04d947ed8aab8d60c80281706e4b7fa21d2a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.16.0
|
Release files / unitycatalog_rs-0.0.2-cp314-cp314t-macosx_11_0_arm64.whl
| Download URL | unitycatalog_rs-0.0.2-cp314-cp314t-macosx_11_0_arm64.whl |
|---|---|
| Size | 6.2 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
9627a2da84cba84da29b4bcbf6e9eae1bf391298bd25afe067727c82c3a09245
|
|
BLAKE2b-256 checksum How to use checksums |
8f20d385ad96236be00c87f1b42686dd4652eb36534237930b7d38d3dacc35db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.16.0
|
Release files / unitycatalog_rs-0.0.2-cp314-cp314t-macosx_10_12_x86_64.whl
| Download URL | unitycatalog_rs-0.0.2-cp314-cp314t-macosx_10_12_x86_64.whl |
|---|---|
| Size | 6.5 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
5275d87b2e412c3096e0eabd68d66e4f65d785e0f7223d221507fdc32615878d
|
|
BLAKE2b-256 checksum How to use checksums |
fac207a5b4e0cf8b498d10838e2ca462409e91be520cd0235d5f2ed74572e6fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.16.0
|
Release files / unitycatalog_rs-0.0.2-cp312-abi3-win_amd64.whl
| Download URL | unitycatalog_rs-0.0.2-cp312-abi3-win_amd64.whl |
|---|---|
| Size | 6.8 MB |
| Tags | CPython 3.12 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
020e2042f9fa777e9688ef6c37a20702e70e28907f045432b72aae7abd2437e6
|
|
BLAKE2b-256 checksum How to use checksums |
8622e2cb7c1702f9e1053d7931ae0aa87ba3a2ea70565bf1f735ca164a61dcaa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.16.0
|
Release files / unitycatalog_rs-0.0.2-cp312-abi3-musllinux_1_2_x86_64.whl
| Download URL | unitycatalog_rs-0.0.2-cp312-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 7.0 MB |
| Tags | CPython 3.12 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
f5b5f8cba7eaffca2b1408c7a7a2f6a0d5294a654e653a2076b171b65a19b807
|
|
BLAKE2b-256 checksum How to use checksums |
9b2c64df84257954b812c1f2bac3eb47e628057452338a48b2638915e957b739
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.16.0
|
Release files / unitycatalog_rs-0.0.2-cp312-abi3-musllinux_1_2_aarch64.whl
| Download URL | unitycatalog_rs-0.0.2-cp312-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 6.7 MB |
| Tags | CPython 3.12 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
570eb0f9706d07b341a3eac68c19b41e218dba5f75ff924a8062d05a6037f70f
|
|
BLAKE2b-256 checksum How to use checksums |
8dfdc44399d401dd72d42fc105b1b7be0aa22abc9a0389dacced04357dab36a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.16.0
|
Release files / unitycatalog_rs-0.0.2-cp312-abi3-manylinux_2_28_x86_64.whl
| Download URL | unitycatalog_rs-0.0.2-cp312-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 6.7 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
bff8abcb91fc8982cbd9d1dfdbf4261cc687d27a775f922174eb4f0f10ea1e3c
|
|
BLAKE2b-256 checksum How to use checksums |
5951a0b6ffada28a51d12c35aa14547c290f396f2ad20494301a32458a0812ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.16.0
|
Release files / unitycatalog_rs-0.0.2-cp312-abi3-manylinux_2_28_aarch64.whl
| Download URL | unitycatalog_rs-0.0.2-cp312-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 6.5 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
6da128d9804a0b304d1a827e77bedbbcb1205c3b551285144da66dff2cd476ad
|
|
BLAKE2b-256 checksum How to use checksums |
d70f70b5ab030015f9ba1ac75af0ef2459bdc6083444da87650aa890bedf2ea3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.16.0
|
Release files / unitycatalog_rs-0.0.2-cp312-abi3-macosx_11_0_arm64.whl
| Download URL | unitycatalog_rs-0.0.2-cp312-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 6.2 MB |
| Tags | CPython 3.12 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
345df5e374c4017de052a01f34b130d3bacf072aa07327575f671e719aa00ede
|
|
BLAKE2b-256 checksum How to use checksums |
6f9c19b2006f67a0610355b5fc602cc5a65c6a4fcabd1394df3eea8e05020a7e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.16.0
|
Release files / unitycatalog_rs-0.0.2-cp312-abi3-macosx_10_12_x86_64.whl
| Download URL | unitycatalog_rs-0.0.2-cp312-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 6.5 MB |
| Tags | CPython 3.12 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
bb967b6419cfb36603dea73f47a20aaae5f53fae33f00abdbde62ddd3ba3083e
|
|
BLAKE2b-256 checksum How to use checksums |
af8a7c58f18b1a7124aea890ea6a12102753500493b234711fcdefb939de8855
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.16.0
|
Security for unitycatalog-rs 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.