Synchronization tool for dbt models to Cube.js schemas and BI tools
Project description
dbt-cube-sync
A powerful synchronization tool that creates a seamless pipeline from dbt models to Cube.js schemas and BI tools (Superset, Tableau, PowerBI).
Features
- ๐ dbt โ Cube.js: Auto-generate Cube.js schemas from dbt models with metrics
- ๐ Cube.js โ BI Tools: Sync schemas to multiple BI platforms
- ๐๏ธ Extensible Architecture: Plugin-based connector system for easy BI tool integration
- ๐ณ Docker Support: Containerized execution with orchestration support
- ๐ฏ CLI Interface: Simple command-line tools for automation
Supported BI Tools
- โ Apache Superset - Full implementation
- ๐ง Tableau - Placeholder (coming soon)
- ๐ง PowerBI - Placeholder (coming soon)
Installation
Using Poetry (Development)
cd dbt-cube-sync
poetry install
poetry run dbt-cube-sync --help
Using Docker
docker build -t dbt-cube-sync .
docker run --rm dbt-cube-sync --help
Quick Start
1. Create Configuration File
# Create sample config
dbt-cube-sync create-config sync-config.yaml
# Edit the config file with your BI tool credentials
2. Generate Cube.js Schemas
# Generate from dbt manifest
dbt-cube-sync generate-cubes \\
--dbt-manifest ./DbtEducationalDataProject/target/manifest.json \\
--output-dir ./cube/conf/cube_output
3. Sync to BI Tool
# Sync to Superset
dbt-cube-sync sync-bi superset \\
--cube-dir ./cube/conf/cube_output \\
--config-file ./sync-config.yaml
4. Full Pipeline
# Complete dbt โ Cube.js โ Superset pipeline
dbt-cube-sync full-sync \\
--dbt-manifest ./DbtEducationalDataProject/target/manifest.json \\
--cube-dir ./cube/conf/cube_output \\
--bi-connector superset \\
--config-file ./sync-config.yaml
Configuration
Sample Configuration (sync-config.yaml)
connectors:
superset:
type: superset
url: http://localhost:8088
username: admin
password: admin
database_name: Cube
tableau:
type: tableau
url: https://your-tableau-server.com
username: your-username
password: your-password
powerbi:
type: powerbi
# PowerBI specific configuration
CLI Commands
generate-cubes
Generate Cube.js schema files from dbt models.
Options:
--dbt-manifest/-m: Path to dbt manifest.json file--output-dir/-o: Output directory for Cube.js files--template-dir/-t: Directory containing Cube.js templates
sync-bi
Sync Cube.js schemas to BI tool datasets.
Arguments:
connector: BI tool type (superset,tableau,powerbi)
Options:
--cube-dir/-c: Directory containing Cube.js files--config-file/-f: Configuration file for BI tool connection
full-sync
Complete pipeline: dbt models โ Cube.js schemas โ BI tool datasets.
Options:
--dbt-manifest/-m: Path to dbt manifest.json file--cube-dir/-c: Directory for Cube.js files--template-dir/-t: Directory containing Cube.js templates--bi-connector/-b: BI tool to sync to--config-file/-f: Configuration file for BI tool connection
Architecture
dbt models (with metrics)
โ
dbt-cube-sync generate-cubes
โ
Cube.js schemas
โ
dbt-cube-sync sync-bi [connector]
โ
BI Tool Datasets (Superset/Tableau/PowerBI)
Project Structure
dbt-cube-sync/
โโโ dbt_cube_sync/
โ โโโ cli.py # CLI interface
โ โโโ config.py # Configuration management
โ โโโ core/
โ โ โโโ dbt_parser.py # dbt manifest parser
โ โ โโโ cube_generator.py # Cube.js generator
โ โ โโโ models.py # Pydantic data models
โ โโโ connectors/
โ โโโ base.py # Abstract base connector
โ โโโ superset.py # Superset implementation
โ โโโ tableau.py # Tableau placeholder
โ โโโ powerbi.py # PowerBI placeholder
โโโ Dockerfile # Container definition
โโโ pyproject.toml # Poetry configuration
โโโ README.md
Adding New BI Connectors
- Create a new connector class inheriting from
BaseConnector - Implement the required abstract methods
- Register the connector using
ConnectorRegistry.register()
Example:
from .base import BaseConnector, ConnectorRegistry
class MyBIConnector(BaseConnector):
def _validate_config(self):
# Validation logic
pass
def connect(self):
# Connection logic
pass
def sync_cube_schemas(self, cube_dir):
# Sync implementation
pass
# Register the connector
ConnectorRegistry.register('mybi', MyBIConnector)
Docker Integration
The tool is designed to work in containerized environments with proper dependency orchestration:
- dbt docs: Runs
dbt buildthen serves documentation - dbt-cube-sync: Runs sync pipeline after dbt and Cube.js are ready
- BI Tools: Receive synced datasets after sync completes
Contributing
- Fork the repository
- Create a feature branch
- Implement your changes
- Add tests if applicable
- Submit a pull request
License
MIT License - see LICENSE file for details.
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 dbt_cube_sync-0.1.0a1.tar.gz.
File metadata
- Download URL: dbt_cube_sync-0.1.0a1.tar.gz
- Upload date:
- Size: 15.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.10.19 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d02132eb77292db15bc1f5fba4e91c8e0e9421470afdde674b59f9e2ceb09f70
|
|
| MD5 |
beb80fc32e13616c5069df9d25a29760
|
|
| BLAKE2b-256 |
ff88cbabd4f4c29d5235034e0dc25974ca43b79342a458318316cde6a4108479
|
File details
Details for the file dbt_cube_sync-0.1.0a1-py3-none-any.whl.
File metadata
- Download URL: dbt_cube_sync-0.1.0a1-py3-none-any.whl
- Upload date:
- Size: 19.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.10.19 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2817cf6ccd58552dbe1925c7b8c69b3c7b0ab91b50c30e34d5b842209c42211
|
|
| MD5 |
a0a82e22e7ab8fd79495eb1b31e3517e
|
|
| BLAKE2b-256 |
94d74304b67fae89b86825cfdaaf9ca56e643933bdff134d12c289ca03f88b61
|