Databricks Unity Catalog Setup Demo
A Python package that demonstrates automated setup and teardown of Databricks Unity Catalog resources using the Databricks SDK. This package provides a reusable framework for managing Unity Catalog resources programmatically, both from local environments and within Databricks notebooks.
Features
- Automated creation of Unity Catalog resources:
- Catalogs
- Schemas
- Volumes
- Configurable resource naming via environment variables
- Support for both local execution and Databricks notebook execution
- Type-safe configuration management using Pydantic
- Clean teardown functionality
Prerequisites
- Python 3.8+
- A Databricks workspace with Unity Catalog enabled
- Appropriate permissions to create/manage Unity Catalog resources
Installation
pip install demo-uc-setup
Configuration
The package uses environment variables for configuration. You can set these either in your environment or in a .env file:
# Required for local execution (optional in Databricks notebooks)
DATABRICKS_HOST=your-workspace-url
DATABRICKS_TOKEN=your-pat-token
# Optional - override default resource names
DEMO_CATALOG_NAME=custom_catalog_name
DEMO_SCHEMAS=["schema1", "schema2"]
DEMO_VOLUME_NAME=custom_volume_name
Usage
Local Execution
from demo_uc_setup.unity_catalog_setup import UnityCatalogSetupTask
from demo_uc_setup.unity_catalog_teardown import UnityCatalogTeardownTask
# Setup Unity Catalog resources
UnityCatalogSetupTask.entrypoint()
# Teardown Unity Catalog resources
UnityCatalogTeardownTask.entrypoint()
Databricks Notebook Execution
%pip install demo-uc-setup
from demo_uc_setup.unity_catalog_setup import UnityCatalogSetupTask
UnityCatalogSetupTask.entrypoint()
Default Resource Names
If not overridden via environment variables, the package will create:
- A catalog named
demo_catalog - Two schemas:
demo_schema_1anddemo_schema_2 - A volume named
demo_volumein each schema
Extending the Framework
The package provides a reusable Task base class that can be extended for custom Unity Catalog operations:
from demo_uc_setup.common import Task
from demo_uc_setup.config import Config
class CustomTask(Task[Config]):
def run(self):
self.logger.info("Starting custom task...")
# Your custom logic here
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for demo_uc_setup 0.1.0
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 |
|---|---|---|---|---|
| demo_uc_setup-0.1.0.tar.gz | 51.1 kB | Without provenance | Details for demo_uc_setup-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| demo_uc_setup-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for demo_uc_setup-0.1.0-py3-none-any.whl |
Total release size: 56.4 kB
Release files / demo_uc_setup-0.1.0.tar.gz
| Download URL | demo_uc_setup-0.1.0.tar.gz |
|---|---|
| Size | 51.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
86d1509ba5e408e735e25f5d2e01037f24e1b5566c5fb5188b304e10a665dbb1
|
|
BLAKE2b-256 checksum How to use checksums |
a7622468d65a62a72cfe10915f4e0471c5e33e18473470a9f4425f8591bc7fa8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.24
|
Release files / demo_uc_setup-0.1.0-py3-none-any.whl
| Download URL | demo_uc_setup-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8f0ca6cc5de4aaa07aa39b99bccb3feb874f68c90968a0494663e21b338179f9
|
|
BLAKE2b-256 checksum How to use checksums |
dd7cd9f311694cd50632d85d9388ae491d714497afd84c9d118d25f78f11a8d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.24
|
Security for demo_uc_setup 0.1.0
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.