https://github.com/datnguye/snowbim
Python CLI tool to refresh schema of Power BI tabular model file (.bim) from Snowflake database
https://github.com/datnguye/snowbim
powerbi schema snowflake tabular-model
Last synced: 6 months ago
JSON representation
Python CLI tool to refresh schema of Power BI tabular model file (.bim) from Snowflake database
- Host: GitHub
- URL: https://github.com/datnguye/snowbim
- Owner: datnguye
- License: mit
- Created: 2021-05-24T14:07:42.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-06-19T10:21:43.000Z (over 4 years ago)
- Last Synced: 2025-06-07T10:07:23.578Z (7 months ago)
- Topics: powerbi, schema, snowflake, tabular-model
- Language: Python
- Homepage:
- Size: 37.1 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# snowbim
[](https://github.com/datnguye/snowbim#readme)
This is to do something awesome between snowflake database and Power BI tabular model file (.bim).
Those are:
* Refresh tables (key: name)
* Refresh table's columns (key: name)
* Refresh table's partitions (key: power-query or name)
Supported Models:
* Compatibility Level: 1550
* Default Power BI Data Source Version: powerBI_V3
We make use of [dbt (data build tool)'s profile](https://docs.getdbt.com/dbt-cli/configure-your-profile) to configure the Snowflake connection.
> Therefore, PLEASE MAKE SURE you've already managed to create 1 dbt profiles.yml file.
Installation:
```
python -m pip install snowbim --upgrade
# dependencies
python -m pip install snowflake-connector-python[pandas]
# check version
python -m snowbim --version
```
## Usage
```
python -m snowbim --help
```
If you don't use --profile-dir argument, by default, it will look for profiles.yml in the user home folder:
* Windows: %userprofile%/.dbt/profiles.yml
* Linux: ~/.dbt/profiles.yml
Sample commands:
* To create new model.bim file:
```
python -m snowbim --bim "/path/to/model.bim" --db "YOUR_SF_DB_NAME" --schema "YOUR_SF_SCHEMA_NAME"
# model.bim will be created after above command
```
* To upgrade existing model.bim file:
```
python -m snowbim --bim "/path/to/model.bim" --db "YOUR_SF_DB_NAME" --schema "YOUR_SF_SCHEMA_NAME"
# model.bim will be overidden after above command
```
* To upgrade existing model.bim file but output to a new model_upgrade.bim file:
```
python -m snowbim --bim "/path/to/model.bim" --out "/path/to/model_upgrade.bim" --db "YOUR_SF_DB_NAME" --schema "YOUR_SF_SCHEMA_NAME"
# model_upgrade.bim will be created after above command
```
> NOTE: If schema is up-to-date, .bim file will not be created or modified.
## Development Enviroment
Virtual enviroment:
```
python -m venv env
```
Activate virtual env:
```
Windows: .\env\Scripts\activate
Linux: source env/bin/activate
```
Install dependencies:
```
pip install -r requirements.txt
```
## TODO:
* Adding schema list