Holistics DBT utilities
Project description
Holistics DBT
Generate Holistics data models based on dbt manifest.json and catalogs.json.
Supported databases:
- BigQuery
- (more to come later)
Install
pip install holistics-dbt
Usage
- Import the
AmlGenandDbtclasses - Provide the path to your
manifest.jsonandcatalog.jsonfiles - Run the
AmlGen#gen_table_modelsto generate the Holistics data models - Call
to_son each model to get the AML text
from holistics_dbt.aml_gen import AmlGen
from holistics_dbt.dbt import Dbt
dbt = Dbt(
manifest_path='target/manifest.json',
catalog_path='target/catalog.json'
)
aml_gen = AmlGen(dbt_artifact=dbt)
table_models = aml_gen.gen_table_models()
for table_model in table_models:
print(table_model.to_s())
Output:
Model model_ecommerce_dbt_model_cities {
type: 'table'
label: ''
description: ''
owner: ''
data_source_name: 'airy-berm-145910'
table_name: '`ecommerce`.`model_cities`'
dimension id {
type: 'number'
hidden: false
definition: @sql {{ #SOURCE.id }};;
label: 'id'
}
dimension name {
type: 'text'
hidden: false
definition: @sql {{ #SOURCE.name }};;
label: 'name'
}
}
Customization
The gen_table_models return a list of AmlTableModel objects which are just plain Python objects. You can see the class definition at aml_table_model.py.
Feel free to modify the class to suit your needs, and then call to_s to get the AML codes.
Project details
Release history Release notifications | RSS feed
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 holistics_dbt-0.0.2.tar.gz.
File metadata
- Download URL: holistics_dbt-0.0.2.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e23244a317c045c70174a329ca763fc1f7e1d082d9aa3d742fa3b6cd26694f5
|
|
| MD5 |
09cc48290324f2010f9190a91b281e6a
|
|
| BLAKE2b-256 |
f94e38a3e8a85dd74fafe0a2fe2dc0b2749646fdf32506cf00b0064af6c37b6f
|
File details
Details for the file holistics_dbt-0.0.2-py3-none-any.whl.
File metadata
- Download URL: holistics_dbt-0.0.2-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9e563aa40586151d57ab5817ed94f410188d60b6d020255d32b683369deb62d
|
|
| MD5 |
14c4da4c8b84c6f82d0dc5170a5096e1
|
|
| BLAKE2b-256 |
2162e3467a1723f815141074b4ed3c36445578c701466a3ba9589b676efce73c
|