hex-sl-utils
Typed models and loaders for Hex semantic-layer resources.
This package is in its initial development phase and is not yet published. Its APIs may change until the first stable release.
Features
- Pydantic models for semantic-layer projects, models, views, dimensions, measures, and relations.
- Project loading from YAML files with structured validation problems.
- Support for multiple SQL dialects.
- Generated JSON Schema and TypeScript declarations.
Installation
Once the package is published, install it with:
uv add hex-sl-utils
# or
python -m pip install hex-sl-utils
Python 3.9 or newer is required.
Usage
Load all .yml and .yaml resources beneath a project directory:
from hex_sl_utils.spec.load import load_project
loaded = load_project(
project_dir="path/to/project",
project_name="My project",
dialect_name="duckdb",
)
for problem in loaded.problems:
print(problem.to_str())
for model in loaded.project.models:
print(model.id)
Converters and other callers that already hold file contents in memory can use
the equivalent load_project_files entry point:
from hex_sl_utils.spec.load import load_project_files
loaded = load_project_files(
files={"orders.yml": "id: orders\nbase_sql_table: analytics.orders\n"},
project_name="My project",
dialect_name="duckdb",
)
Models are also available directly from hex_sl_utils.spec.types for validation
and generation:
from hex_sl_utils.spec.types import Model
model = Model.model_validate(
{
"id": "orders",
"base_sql_table": "analytics.orders",
}
)
The generated schema artifacts are included in the distribution and can be read without relying on a checkout path:
from hex_sl_utils.schema import resource_json_schema
schema = resource_json_schema()
Repository development instructions are in the workspace
CONTRIBUTING.md.
Licensed under the Apache License 2.0.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hex_sl_utils-0.2.0.tar.gz.
File metadata
- Download URL: hex_sl_utils-0.2.0.tar.gz
- Upload date:
- Size: 619.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71f893043ee2712afd48380fa03b3bc1256f281151c21a9e06e7198a46f3b840
|
|
| MD5 |
3422dd12807aa7073546ffb23bc56eb1
|
|
| BLAKE2b-256 |
caf4d68e0ca33d0c9a3efa12cf22b01e6e6ea26374d110d5eb32294d73a69fd3
|
File details
Details for the file hex_sl_utils-0.2.0-py3-none-any.whl.
File metadata
- Download URL: hex_sl_utils-0.2.0-py3-none-any.whl
- Upload date:
- Size: 728.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
918ac734f3a3bf092d56facb97258f919cab45dd1d728e4be81db0457c603a6a
|
|
| MD5 |
28cad52dc06d5ba1ace9244c9cbdad0e
|
|
| BLAKE2b-256 |
9a552299c14c3c41f5356bd0de37c37583e64fca47fde33f98d39559247ba2e1
|