clickzetta-studio-utils
clickzetta-studio-utils is a Python utility package built on top of clickzetta-connector. It currently provides a lightweight wrapper around ClickZetta's FsUtil, making it convenient to work with Volume files from Studio or scripts.
Installation
This project requires Python >=3.10.
pip install clickzetta-studio-utils
For local development, use uv to install dependencies:
uv sync --dev
Basic Usage
from clickzetta.connector.v0.connection import connect
from clickzetta_studio_utils._utils import _Utils
conn = connect(
username="<USERNAME>",
password="<PASSWORD>",
service="<SERVICE>",
instance="<INSTANCE>",
workspace="<WORKSPACE>",
schema="<SCHEMA>",
vcluster="<VCLUSTER>",
)
try:
dbutils = _Utils(conn)
dbutils.fs.put("volume://<VOLUME>/data/1.txt", "hello clickzetta")
print(dbutils.fs.ls("volume://<VOLUME>/data/"))
print(dbutils.fs.head("volume://<VOLUME>/data/1.txt"))
dbutils.fs.rm("volume://<VOLUME>/data/1.txt")
finally:
conn.close()
dbutils.fs delegates filesystem operations to clickzetta-connector. dbutils.fs.mounts() is currently a compatibility stub and returns an empty list because Studio does not have a mount registry yet.
Notebook dbutils.widgets
Notebook runtimes can initialize a Databricks-like dbutils.widgets object from scheduler-provided runtime config.
from clickzetta_studio_utils import init_dbutils
dbutils = init_dbutils(
{
"runtime": {
"tenantId": 1,
"projectId": 2,
"scheduleTaskId": 3,
"scheduleInstanceId": 4,
"executeLogId": 5,
},
"dbutilsApi": {
"baseUrl": "http://scheduler-worker:8080",
},
"widgetValues": {
"biz_date": "2026-07-27",
},
}
)
dbutils.widgets.text("biz_date", "2026-07-20", "Business Date")
print(dbutils.widgets.get("biz_date")) # keeps the runtime value: 2026-07-27
Supported APIs:
dbutils.widgets.text(name, defaultValue="", label=None)
dbutils.widgets.dropdown(name, defaultValue, choices, label=None)
dbutils.widgets.combobox(name, defaultValue, choices, label=None)
dbutils.widgets.multiselect(name, defaultValue, choices, label=None)
dbutils.widgets.get(name)
dbutils.widgets.getAll()
dbutils.widgets.remove(name)
dbutils.widgets.removeAll()
Widget declaration and removal events are posted to POST /v1/dbutils/widgets/events when dbutilsApi.baseUrl is configured. Event write failures are logged as warnings and do not change local widget behavior.
Notebook dbutils.jobs.taskValues
Notebook runtimes can use dbutils.jobs.taskValues to persist values for downstream task instances and to share values across cells in the current Python kernel.
dbutils.jobs.taskValues.set("row_count", 100)
print(dbutils.jobs.taskValues.get("row_count"))
print(dbutils.jobs.taskValues.get(taskKey="extract_orders", key="row_count", default=0))
set() writes local in-memory state first, then posts serialized JSON to POST /v1/dbutils/task-values/set when dbutilsApi.baseUrl is configured. get(taskKey=...) reads upstream values through POST /v1/dbutils/task-values/get using scheduler-provided producer mappings.
Development
Common commands:
# Check code style and lint issues
uv run ruff check .
# Format Python files
uv run ruff format .
# Run the full test suite
make test
# Clean dist/ and build source and wheel distributions
make build
# Build, validate, and upload to PyPI with a project-scoped API token
export TWINE_USERNAME="__token__"
export TWINE_PASSWORD="pypi-..."
make publish
Testing Notes
The test suite includes integration tests that connect to a real ClickZetta service and operate on temporary Volumes. Before running them, make sure that:
- Connection parameters are valid, and the account has permission to create and delete Volumes and read/write files.
- Personal, production, or long-lived credentials are not committed. Prefer environment variables or local untracked configuration when credentials are needed.
- You run targeted tests for the code you changed first, then run the full test suite when appropriate.
Project Information
- Package name:
clickzetta-studio-utils - Import module:
clickzetta_studio_utils - Runtime dependency:
clickzetta-connector>=1.0.25 - Build backend:
pdm-backend
Metadata
Release files for clickzetta-studio-utils 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| clickzetta_studio_utils-0.1.4.tar.gz | 8.9 kB | Without provenance | Details for clickzetta_studio_utils-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| clickzetta_studio_utils-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for clickzetta_studio_utils-0.1.4-py3-none-any.whl |
Total release size: 17.4 kB
Release files / clickzetta_studio_utils-0.1.4.tar.gz
| Download URL | clickzetta_studio_utils-0.1.4.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6cc22a973d86c1138ced6c2f785fdadb11820262bf7173a27130b36fd59fa54e
|
|
BLAKE2b-256 checksum How to use checksums |
c3c9975f26fe57603acfcd6d81dfb58c81194406b3b8f17249adfebe811c84ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.11
|
Release files / clickzetta_studio_utils-0.1.4-py3-none-any.whl
| Download URL | clickzetta_studio_utils-0.1.4-py3-none-any.whl |
|---|---|
| Size | 8.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
60071073971bc79a8dc84fbc4de7e3a713db2b043f0681fe0d9641b118926888
|
|
BLAKE2b-256 checksum How to use checksums |
e57d0d6f6b031095ff0706c46fb25692f355b0f31716021db21c6ac944cdc481
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.11
|
Security for clickzetta-studio-utils 0.1.4
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.