Python package to make it easy to develop, test and deploy performant streamlit-in-snowflake apps
Project description
sisx
A command-line interface (CLI) for managing Streamlit applications in Snowflake.
Overview
sisx provides a set of commands to simplify the workflow for developing, deploying, and managing Streamlit applications on Snowflake. It handles common tasks like deploying applications, creating preview versions, and cleaning up old deployments.
Installation
uv tool install sisx
# Or
pip install sisx
If you don't want to actually install the tool permanently, you can just run uvx sisx <any command> to use it.
CLI
sisx CLI tool for Streamlit in Snowflake applications
Usage:
$ [OPTIONS] COMMAND [ARGS]...
Options:
--version: Show the version and exit.--install-completion: Install completion for the current shell.--show-completion: Show completion for the current shell, to copy it or customize the installation.--help: Show this message and exit.
Commands:
deploy: Deploy a Streamlit application using the...deploy-preview: Deploy a preview version of a Streamlit...drop: Drop a Streamlit application from Snowflake.drop-preview: Drop a preview version of a Streamlit...new: Create a new Streamlit in Snowflake...run: Run a Streamlit application locally.test: Run the tests for the CLI.cleanup: Drop multiple Streamlit applications...new-connection: Add a new Snowflake connection configuration.
deploy
Deploy a Streamlit application using the Snowflake CLI.
This command wraps the snow streamlit deploy command, providing a convenient
interface for deploying Streamlit applications to Snowflake.
By default, opens the app in your browser. Use --no-open to disable.
Usage:
$ deploy [OPTIONS]
Options:
-v, --verbose: Enable verbose output-r, --replace: Replace the Streamlit app if it already exists--no-open: Don't open the deployed Streamlit app in a browser-c, --connection TEXT: Connection to use for deployment--query-warehouse TEXT: Override the query warehouse to use--app-warehouse TEXT: Override the app warehouse to use--debug: Enable debug output--help: Show this message and exit.
deploy-preview
Deploy a preview version of a Streamlit application.
This command adds 'preview_' to the beginning of the app name and also adds 'PREVIEW: ' to the app title, making it easy to identify preview deployments.
By default, opens the app in your browser. Use --no-open to disable.
Usage:
$ deploy-preview [OPTIONS]
Options:
--preview-name TEXT: Name of the preview app-v, --verbose: Enable verbose output-r, --replace: Replace the Streamlit app if it already exists--no-open: Don't open the deployed Streamlit app in a browser-c, --connection TEXT: Connection to use for deployment--debug: Enable debug output--help: Show this message and exit.
drop
Drop a Streamlit application from Snowflake.
This command will remove the Streamlit app. If --drop-spcs is specified, it will also clean up any associated SPCS services.
Usage:
$ drop [OPTIONS]
Options:
-v, --verbose: Enable verbose output-c, --connection TEXT: Connection to use for deployment-f, --force: Force drop without confirmation--drop-spcs: Also drop any associated SPCS services--help: Show this message and exit.
drop-preview
Drop a preview version of a Streamlit application from Snowflake.
This command will remove the preview Streamlit app (with prefix 'preview_'). If --drop-spcs is specified, it will also clean up any associated SPCS services.
Usage:
$ drop-preview [OPTIONS]
Options:
-v, --verbose: Enable verbose output-c, --connection TEXT: Connection to use for deployment-f, --force: Force drop without confirmation--drop-spcs: Also drop any associated SPCS services--help: Show this message and exit.
new
Create a new Streamlit in Snowflake application using a template.
This command uses snow init to generate a new app from the appropriate template based on your compute choice (warehouse or compute pool).
All configuration can be provided via command line flags for automation, or will be prompted for interactively if not provided.
Usage:
$ new [OPTIONS] [OUTPUT_DIR]
Arguments:
[OUTPUT_DIR]: Directory where the new app will be created
Options:
-f, --force: Force creation of app, overwriting existing directory-c, --connection TEXT: Name of the connection to use-v, --verbose: Enable verbose output-t, --compute-type TEXT: Type of compute to use: 'warehouse' or 'compute_pool' [default: warehouse]-q, --query-warehouse TEXT: Warehouse to use for queries (when using warehouse compute type)-a, --app-warehouse TEXT: Warehouse to use for running the app (when using warehouse compute type)--compute-pool TEXT: Compute pool to use (when using compute_pool compute type)--stage TEXT: Stage to use for app artifacts--database TEXT: Database to use for the app--schema TEXT: Schema to use for the app--role TEXT: Role to use for the app--debug: Enable debug output--help: Show this message and exit.
run
Run a Streamlit application locally.
This command wraps the streamlit run command, providing a convenient
interface for running Streamlit applications during development.
Usage:
$ run [OPTIONS] [APP_PATH]
Arguments:
[APP_PATH]: Path to the Streamlit app file to run [default: streamlit_app.py]
Options:
--help: Show this message and exit.
test
Run the tests for the CLI.
Usage:
$ test [OPTIONS]
Options:
--help: Show this message and exit.
cleanup
Drop multiple Streamlit applications containing the specified filter text.
If no filter is provided, uses the text 'preview_' as the filter. This is useful for cleaning up development apps in your account.
Usage:
$ cleanup [OPTIONS] [FILTER_TEXT]
Arguments:
[FILTER_TEXT]: Text to filter apps by (uses preview_ if not specified)
Options:
-v, --verbose: Enable verbose output-c, --connection TEXT: Connection to use for deployment-f, --force: Force cleanup without confirmation--drop-spcs: Also drop any associated SPCS services--help: Show this message and exit.
new-connection
Add a new Snowflake connection configuration.
This command wraps the snow connection add command, providing a convenient
interface for adding new Snowflake connections.
Usage:
$ new-connection [OPTIONS]
Options:
-n, --connection-name TEXT: Name of the new connection.-a, --account, --accountname TEXT: Account name to use when authenticating with Snowflake.-u, --user, --username TEXT: Username to connect to Snowflake.-p, --password TEXT: Snowflake password.-r, --role, --rolename TEXT: Role to use on Snowflake.-w, --warehouse TEXT: Warehouse to use on Snowflake.-d, --database, --dbname TEXT: Database to use on Snowflake.-s, --schema, --schemaname TEXT: Schema to use on Snowflake.-h, --host TEXT: Host name the connection attempts to connect to Snowflake.-P, --port INTEGER: Port to communicate with on the host.-R, --region TEXT: Region name if not the default Snowflake deployment.-A, --authenticator TEXT: Chosen authenticator, if other than password-based-k, --private-key, --private-key-file, --private-key-path TEXT: Path to file containing private key-t, --token-file-path TEXT: Path to file with an OAuth token that should be used when connecting to Snowflake--default: If provided the connection will be configured as default connection.-v, --verbose: Enable verbose output--debug: Enable debug output--help: Show this message and exit.
Configuration
sisx uses the snowflake.yml file in your project directory for configuration. This defines your app's name, database, schema, and other settings.
Example snowflake.yml for warehouse compute type:
definition_version: "2"
env:
name: "my_app"
query_warehouse: "compute_wh"
app_warehouse: "SYSTEM$STREAMLIT_NOTEBOOK_WH"
schema: "public"
database: "streamlit"
role: "ACCOUNTADMIN"
preview_database: "streamlit"
preview_schema: "public"
preview_role: "ACCOUNTADMIN"
stage: "streamlit_stage"
entities:
streamlit_app:
type: streamlit
identifier:
name: <% ctx.env.name %>
schema: <% ctx.env.schema %>
database: <% ctx.env.database %>
stage: <% ctx.env.stage %>
query_warehouse: <% ctx.env.query_warehouse %>
main_file: streamlit_app.py
pages_dir: pages/
artifacts:
- "**/*.py"
- "*.yml"
Example snowflake.yml for compute pool type:
definition_version: "2"
env:
name: "my_app"
compute_pool: "streamlit_compute_pool"
schema: "public"
database: "streamlit"
preview_database: "streamlit"
preview_schema: "public"
preview_role: "ACCOUNTADMIN"
stage: "streamlit_stage"
entities:
streamlit_app:
type: streamlit
identifier:
name: <% ctx.env.name %>
schema: <% ctx.env.schema %>
database: <% ctx.env.database %>
stage: <% ctx.env.stage %>
compute_pool: <% ctx.env.compute_pool %>
main_file: streamlit_app.py
pages_dir: pages/
artifacts:
- "**/*.py"
- "requirements.txt"
- "*.yml"
Version Information
You can check the version of sisx by running:
uvx sisx --version
License
MIT
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sisx-0.1.9.tar.gz.
File metadata
- Download URL: sisx-0.1.9.tar.gz
- Upload date:
- Size: 137.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6f4877b1a22284782fc6858b1ebc38a90accb105349f334cb156e3b59f36f86
|
|
| MD5 |
9e98513814ee1219f7b08df503ed2c58
|
|
| BLAKE2b-256 |
ca2a72403f13f32ccaa8310ae01fcef8bffb9bfe4f0150e4cde02fa55d3d7cd7
|
File details
Details for the file sisx-0.1.9-py3-none-any.whl.
File metadata
- Download URL: sisx-0.1.9-py3-none-any.whl
- Upload date:
- Size: 23.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3dcf6553b50f353e5f43b1b5df71ed0ebd6661d804f3ce5222c83ebff359195a
|
|
| MD5 |
0d8d09a7e52adb07a073d59b3d201f85
|
|
| BLAKE2b-256 |
abf0b733d86bfee17fd3c4ccf59ab38590dfcfb6ea4d5a35f48e21a4cccfb360
|