Skip to main content

dbt integration for Cube

Project description

cube_dbt

cube_dbt is the dbt integration for Cube that helps define the data model of the semantic layer on top of dbt models.

Installation

pip install cube_dbt

Usage

manifest_url = 'https://bucket.s3.amazonaws.com/manifest.json'
dbt = (
  Dbt
  .from_url(manifest_url)
  .filter(
    paths=['marts/'],
    tags=['cube'],
    names=['my_table', 'my_table_2']
  )
)
print(dbt.models)

# For use in Jinja templates:
print(dbt.model('name').as_cube())
print(dbt.model('name').as_dimensions(skip=['id']))
print(dbt.model('name').column('name').as_dimension())

Development

Run tests:

pdm run test

Preprocessing the manifest.json file

In case of a massive manifest file, it can be preprocessed for optimal performance. The cube_dbt package only reads the nodes dictionary where resource_type is model. Here's a list of all keys used by the cube_dbt package:

- nodes
  - name
  - path
  - description
  - config
    - materialized
    - tags
  - resource_type
  - database
  - schema
  - alias
  - relation_name
  - columns
    - name
    - description
    - data_type
    - meta
    - tags

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

cube_dbt-0.6.3.tar.gz (818.1 kB view details)

Uploaded Source

Built Distribution

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

cube_dbt-0.6.3-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file cube_dbt-0.6.3.tar.gz.

File metadata

  • Download URL: cube_dbt-0.6.3.tar.gz
  • Upload date:
  • Size: 818.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.25.4 CPython/3.10.6 Darwin/24.5.0

File hashes

Hashes for cube_dbt-0.6.3.tar.gz
Algorithm Hash digest
SHA256 fea8b926363eddc0a99c226716a36e426f493ce1ac94278c89d6ae18e057c374
MD5 77c8ac18cf48da47061615225870ec32
BLAKE2b-256 dea619d079000b6808ddc37ae96d41e9da749905ed284500665be11cd32c5d25

See more details on using hashes here.

File details

Details for the file cube_dbt-0.6.3-py3-none-any.whl.

File metadata

  • Download URL: cube_dbt-0.6.3-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.25.4 CPython/3.10.6 Darwin/24.5.0

File hashes

Hashes for cube_dbt-0.6.3-py3-none-any.whl
Algorithm Hash digest
SHA256 69c80c4252839ff6784ae9d4653763c7551628263a0927934e0ac8e38e39e4df
MD5 ec2c19d4d7dd8760ff29fce2513bdd4e
BLAKE2b-256 600a8f3f89920c195865ae8313d4a39f0bea72589f0157ef439b6d2fad76c284

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