![image](https://img.shields.io/badge/Python-FFD43B?style=for-the-badge&logo=python&logoColor=blue)
[![image](https://img.shields.io/badge/Gmail-D14836?style=for-the-badge&logo=gmail&logoColor=white)](mailto:thomas.dambrin@gmail.com?subject=[GitHub]%20Snowflake%20Git%20Versioning)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![Coverage Badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/tdambrin/e2c293d7db07bee70d2845387cb133ff/raw/sf_git_main_cov_badge.json)
# Snowflake Git
# Worksheet Versioning
Inspired by a snowflake developers maintained [repository](https://github.com/Snowflake-Labs/sfsnowsightextensions).
### Git integration
The extension is designed to **apply git versioning on worksheets while developing on Snowsight, fully taking advantage of its functionalities**.\
The following workflow is advised :
1. [Start session] Upload worksheet from local branch to a user Snowsight workspace
2. Test, update and validate on Snowsight
3. [End session] Update local branch with modified Snowsight worksheets
## Installation
Entry points are accessible through a CLI once the package is installed.
To install it, please follow the following steps :
```bash
# [Optional: Python virtual environement]
$ pyenv virtualenv 3.10.4 sf
$ pyenv activate sf
# [Mandatory: Pip install]
$ pip install -U pip
$ pip install sf_git>=1.3
# [Check your installation]
$ sfgit --help
# [Should result in:]
# Usage: sfgit [OPTIONS] COMMAND [ARGS]...
#
# Options:
# --help Show this message and exit.
#
# Commands:
# commit Commit Snowsight worksheets to Git repository.
# config Configure sfgit for easier version control.
# fetch Fetch worksheets from user Snowsight account and store them in...
# init Initialize a git repository and set it as the sfgit versioning...
# push Upload locally stored worksheets to Snowsight user workspace.
```
Commands have been created to **import/export (respectively fetch/push) snowsight worksheets to/from local**.
## Git configuration
> **Warning**
> A git repository is necessary to manage worksheets. You can either use an existing one
> or create a new one.
To apply versioning to your worksheets, you need to **configure Git information**
through the config command.
First, set git repository to be used:
```bash
# if you want to use an existing git repository
$ sfgit config --git-repo <path_to_git_repo>
# if you want to create a new one
$ sfgit init -p <path_to_git_repo>
```
Then, set a location to save your worksheets within this git repository:
```bash
$ sfgit config --save-dir <path_to_worksheets_persistency_directory>
```
## Authentication
Currently, two authentication modes are supported i.e. credentials (PWD) and single sign-on (SSO).
Commands requiring Snowsight authentication all have options to provide at command time.
If you don't want to manually input them everytime, you can set them at Python/Virtual environement level with :
```bash
$ sfgit config --account <your_snowsight_account_id>
$ sfgit config --username <your_snowsight_login_name>
$ sfgit config --password <your_snowsight_password> # unnecessary for SSO authentication mode
```
## Usage
**Import user worksheet locally** :
```bash
$ sfgit fetch -username tdambrin -account-id my_account.west-europe.azure --auth-mode SSO
```
**Commit you worksheets** (or through git commands for more flexibility) :
```bash
$ sfgit commit --branch master -m "Initial worksheet commit"
```
**Export user worksheets to Snowsight** :
```bash
$ sfgit push --auth-mode SSO --branch master
```
## Policies
Feedbacks and contributions are greatly appreciated. This package was made to ease every day life for Snowflake
developers and promote version control as much as possible.
For questions, please feel free to reach out [by email](mailto:thomas.dambrin@gmail.com?subject=[GitHub]%20Snowflake%20Git%20Versioning).
Raw data
{
"_id": null,
"home_page": "https://github.com/tdambrin/sf_git",
"name": "sf-git",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "python,snowflake,git",
"author": "Thomas Dambrin",
"author_email": "thomas.dambrin@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/cb/a3/0d9706ab47b7c58eadd6f8511c7da5f20a91d630a44933c46816f52a2cda/sf_git-1.3.1.tar.gz",
"platform": null,
"description": "![image](https://img.shields.io/badge/Python-FFD43B?style=for-the-badge&logo=python&logoColor=blue)\n[![image](https://img.shields.io/badge/Gmail-D14836?style=for-the-badge&logo=gmail&logoColor=white)](mailto:thomas.dambrin@gmail.com?subject=[GitHub]%20Snowflake%20Git%20Versioning)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n![Coverage Badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/tdambrin/e2c293d7db07bee70d2845387cb133ff/raw/sf_git_main_cov_badge.json)\n\n\n\n# Snowflake Git\n\n# Worksheet Versioning\n\nInspired by a snowflake developers maintained [repository](https://github.com/Snowflake-Labs/sfsnowsightextensions).\n\n### Git integration \n\nThe extension is designed to **apply git versioning on worksheets while developing on Snowsight, fully taking advantage of its functionalities**.\\\nThe following workflow is advised :\n1. [Start session] Upload worksheet from local branch to a user Snowsight workspace\n2. Test, update and validate on Snowsight \n3. [End session] Update local branch with modified Snowsight worksheets\n\n## Installation\n\nEntry points are accessible through a CLI once the package is installed. \nTo install it, please follow the following steps :\n\n```bash\n# [Optional: Python virtual environement]\n$ pyenv virtualenv 3.10.4 sf\n$ pyenv activate sf\n\n# [Mandatory: Pip install]\n$ pip install -U pip\n$ pip install sf_git>=1.3\n\n# [Check your installation]\n$ sfgit --help\n\n# [Should result in:]\n# Usage: sfgit [OPTIONS] COMMAND [ARGS]...\n# \n# Options:\n# --help Show this message and exit.\n# \n# Commands:\n# commit Commit Snowsight worksheets to Git repository.\n# config Configure sfgit for easier version control.\n# fetch Fetch worksheets from user Snowsight account and store them in...\n# init Initialize a git repository and set it as the sfgit versioning...\n# push Upload locally stored worksheets to Snowsight user workspace.\n```\n\nCommands have been created to **import/export (respectively fetch/push) snowsight worksheets to/from local**.\n\n## Git configuration\n\n> **Warning**\n> A git repository is necessary to manage worksheets. You can either use an existing one\n> or create a new one.\n\nTo apply versioning to your worksheets, you need to **configure Git information**\nthrough the config command. \n\nFirst, set git repository to be used:\n\n```bash\n# if you want to use an existing git repository\n$ sfgit config --git-repo <path_to_git_repo>\n\n# if you want to create a new one \n$ sfgit init -p <path_to_git_repo>\n```\n\nThen, set a location to save your worksheets within this git repository:\n```bash\n$ sfgit config --save-dir <path_to_worksheets_persistency_directory>\n```\n\n## Authentication\nCurrently, two authentication modes are supported i.e. credentials (PWD) and single sign-on (SSO).\n\nCommands requiring Snowsight authentication all have options to provide at command time. \nIf you don't want to manually input them everytime, you can set them at Python/Virtual environement level with :\n\n\n```bash\n$ sfgit config --account <your_snowsight_account_id>\n$ sfgit config --username <your_snowsight_login_name>\n$ sfgit config --password <your_snowsight_password> # unnecessary for SSO authentication mode\n```\n\n## Usage\n\n**Import user worksheet locally** :\n```bash\n$ sfgit fetch -username tdambrin -account-id my_account.west-europe.azure --auth-mode SSO\n```\n\n**Commit you worksheets** (or through git commands for more flexibility) :\n```bash\n$ sfgit commit --branch master -m \"Initial worksheet commit\"\n```\n\n**Export user worksheets to Snowsight** :\n```bash\n$ sfgit push --auth-mode SSO --branch master\n```\n\n## Policies\nFeedbacks and contributions are greatly appreciated. This package was made to ease every day life for Snowflake \ndevelopers and promote version control as much as possible.\n\nFor questions, please feel free to reach out [by email](mailto:thomas.dambrin@gmail.com?subject=[GitHub]%20Snowflake%20Git%20Versioning).\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python package to manipulate Snowsight worksheets and easily apply Git versioning on it.",
"version": "1.3.1",
"project_urls": {
"Homepage": "https://github.com/tdambrin/sf_git"
},
"split_keywords": [
"python",
"snowflake",
"git"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "12c12f4d732cc7a6cde0fb7a2722a3b231ac0690b578c1d81aa0d66c8ad16a4a",
"md5": "7e08de2a875f320bf577c876ee5258ee",
"sha256": "f522702395c1f5618abff5b0232c3c17100a17789914cc85a79e69288c2222f3"
},
"downloads": -1,
"filename": "sf_git-1.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7e08de2a875f320bf577c876ee5258ee",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 20074,
"upload_time": "2024-01-26T07:48:07",
"upload_time_iso_8601": "2024-01-26T07:48:07.907469Z",
"url": "https://files.pythonhosted.org/packages/12/c1/2f4d732cc7a6cde0fb7a2722a3b231ac0690b578c1d81aa0d66c8ad16a4a/sf_git-1.3.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cba30d9706ab47b7c58eadd6f8511c7da5f20a91d630a44933c46816f52a2cda",
"md5": "38d93f4e61fb22b50290a9aa466c72bc",
"sha256": "0f7a2216e6d15a80e0f83064ae3b4d8e6a7fecc367fa722fdbe0db0aecf93ea6"
},
"downloads": -1,
"filename": "sf_git-1.3.1.tar.gz",
"has_sig": false,
"md5_digest": "38d93f4e61fb22b50290a9aa466c72bc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 118481,
"upload_time": "2024-01-26T07:48:10",
"upload_time_iso_8601": "2024-01-26T07:48:10.130445Z",
"url": "https://files.pythonhosted.org/packages/cb/a3/0d9706ab47b7c58eadd6f8511c7da5f20a91d630a44933c46816f52a2cda/sf_git-1.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-26 07:48:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "tdambrin",
"github_project": "sf_git",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"requirements": [],
"lcname": "sf-git"
}