looker-loader
Write rules for how you want fields and measures to be generated from tables into looker.
Are you tired of adding timeframes to dimension_groups manually, of defining simple measures, of adding descriptions to measures? looker_loader removes a lot of the tedious work involved with loading new tables into Looker.
Define field_label, group_label, value_format_name etc in a common source of truth
If you find discrepancies in value formats and labelling across tables to be annoying and tedious, wouldnt it be nice to be able to input a label one place, and have it applied for every table? Looker_loader enables this.
Setup scheduled refreshes of lookml automatically
Fed up with generating new autogenerated tables every time a new field is added to a table? Use looker_loader to refresh tables on a schedule!
Quick Start
-
Install the package:
uv add looker_loader
-
Create configuration files:
loader_config.yml- Define your BigQuery connections and settingsloader_recipe.yml- Define rules for field transformations
loader_config.yml
This file defines your BigQuery connections and loader settings:
config:
loader:
lexicanum: true
output_path: ./views
bigquery:
- project_id: "your-project-id"
dataset_id: "your_dataset"
config:
regex_include: "^fct_|^dim_|^obt_"
regex_exclude: "_temp$|_backup$"
loader_recipe.yml
This file defines rules for how different field types should be transformed:
recipes:
- name: primary_key
filters:
field_order: [0]
dimension:
primary_key: true
- name: hide_records
filters:
db_types: [RECORD]
dimension:
hidden: true
- name: group_ids
dimension:
group_label: Identifiers
value_format_name: id
measures:
- type: count_distinct
filters:
regex_include: _id$|^pk.*_|_code$
- name: numbers
filters:
types: [number]
regex_exclude: _id$|^pk_|_code$
dimension:
group_label: Numbers
value_format_name: decimal_1
measures:
- type: sum
label: "Sum {{ parent_label }}"
- name: time_date_values
filters:
regex_include: _date
types: [date]
dimension:
timeframes:
- raw
- time
- date
- week
- month
- quarter
- year
- Run the loader:
uv run looker_loader
Check the Output
The loader will create LookML files in your specified output directory (default: ./views). You should see files like:
views/
├── fct_sales.view.lkml
├── dim_customers.view.lkml
└── obt_daily_summary.view.lkml
Common Issues
No tables found
- Check your
project_idanddataset_idare correct - Verify your BigQuery permissions
- Check if your
regex_includepattern matches any tables
Authentication errors
- Ensure your Google Cloud credentials are properly set up
Next Steps
Now that you have the basics working:
- Explore Configuration Options - Learn about all available configuration settings
- Create Custom Recipes - Build specialized field transformation rules
- Use Lexicanum - Enhance field definitions by using a common source of truth
Metadata
Release files for looker_loader 0.1.50
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| looker_loader-0.1.50.tar.gz | 111.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| looker_loader-0.1.50-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 138.5 kB
Release files / looker_loader-0.1.50.tar.gz
| Download URL | looker_loader-0.1.50.tar.gz |
|---|---|
| Size | 111.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d2a82f1c14dc2bfc9f6daa2e90cd5126411179f30611f2e11e709161c1cb7954
|
|
BLAKE2b-256 checksum How to use checksums |
28ae19e681be7c0d9e7e38ce0a3dfe418e705c3a5db812385948866b408d3364
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.2
|
Release files / looker_loader-0.1.50-py3-none-any.whl
| Download URL | looker_loader-0.1.50-py3-none-any.whl |
|---|---|
| Size | 27.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
267fce722275e5fb9022ec2a10b8c020735dd626f2848ce5ab7308c1b176e5e7
|
|
BLAKE2b-256 checksum How to use checksums |
5cf19515b1192331b0503488ec7e56181e086a7135b8a4a72d5d3a2ab08f5a81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.2
|