Skip to main content

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 AmlGen and Dbt classes
  • Provide the path to your manifest.json and catalog.json files
  • Run the AmlGen#gen_table_models to generate the Holistics data models
  • Call to_s on 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

holistics_dbt-0.0.2.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

holistics_dbt-0.0.2-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

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

Hashes for holistics_dbt-0.0.2.tar.gz
Algorithm Hash digest
SHA256 7e23244a317c045c70174a329ca763fc1f7e1d082d9aa3d742fa3b6cd26694f5
MD5 09cc48290324f2010f9190a91b281e6a
BLAKE2b-256 f94e38a3e8a85dd74fafe0a2fe2dc0b2749646fdf32506cf00b0064af6c37b6f

See more details on using hashes here.

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

Hashes for holistics_dbt-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d9e563aa40586151d57ab5817ed94f410188d60b6d020255d32b683369deb62d
MD5 14c4da4c8b84c6f82d0dc5170a5096e1
BLAKE2b-256 2162e3467a1723f815141074b4ed3c36445578c701466a3ba9589b676efce73c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page