snowbim
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: name)
Supported Models:
- Compatibility Level: 1550
- Default Power BI Data Source Version: powerBI_V3
We make use of dbt (data build tool)'s 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
- Support AZ Synapse connector
Metadata
Release files for snowbim 1.0.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| snowbim-1.0.12.tar.gz | 7.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| snowbim-1.0.12-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.8 kB
Release files / snowbim-1.0.12.tar.gz
| Download URL | snowbim-1.0.12.tar.gz |
|---|---|
| Size | 7.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
226b10e5611472c5c31123ec5f68d739787bf5c686446e72bdf0f2c837f8cf62
|
|
BLAKE2b-256 checksum How to use checksums |
8c9004811b50018d00eb4445c91b2e1e2b5dccbef20d9bfc876cef66dd4a1aed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.3.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.8
|
Release files / snowbim-1.0.12-py3-none-any.whl
| Download URL | snowbim-1.0.12-py3-none-any.whl |
|---|---|
| Size | 9.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ccbbc7201a474c2e906f19e7ea730d7c8bf5934d50f402b1bac8300dc9d7ef41
|
|
BLAKE2b-256 checksum How to use checksums |
71be042fd9ca988c9d55d16a58b8382c4029c71679eb3611b52fd02c53f64f44
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.3.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.8
|
Security for snowbim 1.0.12
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.