Skip to main content

Concordia CLI - Generate LookML from BigQuery using Looker & Dataform

Project description

Concordia

concordia-logo

Bring harmony to your data stack.

What is it?How it WorksFeaturesGetting StartedUsageConfiguration

What is Concordia? Concordia is a command-line interface (CLI) tool that automates the creation and maintenance of Looker views, ensuring they are always in sync with your BigQuery data warehouse. It establishes your BigQuery/Dataform schema as the single source of truth and propagates its structure and documentation directly into your Looker project.

If you've ever had to:

  • Manually create a new LookML view for every new table in your warehouse.
  • Update a LookML dimension because a column name changed in BigQuery.
  • Copy and paste column descriptions from a dbt/dataform model into a Looker view.
  • Notice that the documentation in Looker is out of date with the real-world table.

...then Concordia is the tool for you.

How it Works

Concordia operates on a simple, unidirectional data flow. It reads the metadata (column names, data types, descriptions) directly from your BigQuery tables and uses that information to generate clean, consistent, and documented LookML view files.

Dataform/BigQuery (Source of Truth) -> Concordia -> Looker .view Files

This ensures that your semantic layer in Looker is a perfect reflection of your transformation layer in the data warehouse, eliminating drift and manual effort.

Key Features

Automated View Generation: Create a complete, well-structured LookML view from a BigQuery table with a single command.

  • Documentation Sync: Automatically pulls column descriptions from BigQuery and populates the description tag in your LookML dimensions.
  • Convention over Configuration: Uses smart naming conventions (e.g., for primary and foreign keys) to generate better LookML.
  • Intelligent Defaults: Automatically adds a count measure, hides key fields, and creates a set for drill fields.
  • Simple Configuration: A single concordia.yml file manages all project settings.
  • Secure Authentication: Leverages existing Dataform credentials files or Google Application Default Credentials (ADC) so you don't have to manage new secrets.

Getting Started

  1. Installation (Placeholder for installation instructions, e.g., pip install concordia-cli)
  2. Initialization Navigate to the root of your analytics repository and run: concordia init. This will create a concordia.yml file in your project. This is where you will configure the tool.

Configuration

All configuration is handled in the concordia.yml file.

# concordia.yml - Example Configuration

# BigQuery Connection Details
connection:
  # (Recommended) Point to your Dataform credentials file.
  dataform_credentials_file: './.df-credentials.json'

  # If the file above is not found, Concordia falls back to Google ADC.

  # The GCP project ID and location to target.
  project_id: 'my-gcp-project'
  location: 'europe-west2'

  # The datasets to scan for tables.
  datasets:
    - 'marts'
    - 'finance'

# Looker project configuration
looker:
  project_path: './looker_project/' # Path to your local Looker git repo
  views_path: 'views/base/base.view.lkml' # Path for generated base view
  connection: 'bigquery-prod' # The name of your Looker connection

# Rules for how models and fields are generated
model_rules:
  # Define how to identify PKs and FKs from column names
  naming_conventions:
    pk_suffix: '_pk'
    fk_suffix: '_fk'

  # Define default behaviors for generated views
  defaults:
    measures: [count]
    hide_fields_by_suffix: ['_pk', '_fk']

  # Map BigQuery data types to LookML
  type_mapping:
    - bq_type: 'TIMESTAMP'
      lookml_type: 'dimension_group'
      lookml_params: { type: 'time', timeframes: '[raw, time, date, week, month]' }
    - bq_type: 'INTEGER'
      lookml_type: 'dimension'
      lookml_params: { type: 'number' }
    # ... and so on


# BigQuery Connection Details

connection:

# (Recommended) Point to your Dataform credentials file.

dataform_credentials_file: './.df-credentials.json'

# If the file above is not found, Concordia falls back to Google ADC.

# The GCP project ID and location to target.

project_id: 'my-gcp-project'
location: 'europe-west2'

# The datasets to scan for tables.

datasets: - 'marts' - 'finance'

# Looker project configuration

looker:
project_path: './looker_project/' # Path to your local Looker git repo
views_path: 'views/generated_views.view.lkml' # File path where generated views will be written
explores_path: 'views/generated_explores.view.lkml' # File path where generated explores will be written
connection: 'bigquery-prod' # The name of your Looker connection

# Rules for how models and fields are generated

model_rules:

# Define how to identify PKs and FKs from column names

naming_conventions:
pk_suffix: '\_pk'
fk_suffix: '\_fk'

# Define default behaviors for generated views

defaults:
measures: [count]
hide_fields_by_suffix: ['_pk', '_fk']

# Map BigQuery data types to LookML

type_mapping: - bq_type: 'TIMESTAMP'
lookml_type: 'dimension_group'
lookml_params: { type: 'time', timeframes: '[raw, time, date, week, month]' } - bq_type: 'INTEGER'
lookml_type: 'dimension'
lookml_params: { type: 'number' } # ... and so on

Usage

//TODO

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

concordia_cli-0.1.1.tar.gz (32.6 kB view details)

Uploaded Source

Built Distribution

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

concordia_cli-0.1.1-py3-none-any.whl (37.7 kB view details)

Uploaded Python 3

File details

Details for the file concordia_cli-0.1.1.tar.gz.

File metadata

  • Download URL: concordia_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 32.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for concordia_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 738dcb97d43cae7f29e3f0dd3ca481ab04b008ae063150434de8858d4f6f28b1
MD5 46ce29b9e455fc5da27e530a11ba7c1e
BLAKE2b-256 d31be67b928974515ab5ecb6354642ffbc79a4207141635366f4e38a35481b1a

See more details on using hashes here.

File details

Details for the file concordia_cli-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: concordia_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 37.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for concordia_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1427cc41630fd8c59d63ee93990a93d6eb4c87ae1f41d7bbde7427e9a739aae4
MD5 a63f3072e3b6cfe4cbae405689f86055
BLAKE2b-256 05b93c1b49403dace2559ddbf772b1a5a54c327f2e4394c922aff2fa6ec68f19

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