Skip to main content

Python package to make it easy to develop beautiful, 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

uvx sisx

After doing this, you can either do sisx, or uvx sisx.

Commands

Deploy Commands

deploy

Deploy a Streamlit application to Snowflake.

sisx deploy [--verbose] [--replace] [--no-open] [--connection NAME] [--query-warehouse NAME] [--app-warehouse NAME] [--debug]

Options:

  • --verbose, -v: Enable verbose output
  • --replace, -r: Replace existing app if it exists
  • --no-open: Don't open the deployed app in a browser (opens by default)
  • --connection, -c: Connection name to use
  • --query-warehouse: Override the query warehouse to use
  • --app-warehouse: Override the app warehouse to use
  • --debug: Enable debug output

deploy-preview

Deploy a preview version of your application with "preview_" prefix and "PREVIEW:" title.

sisx deploy-preview [--preview-name NAME] [--verbose] [--replace] [--no-open] [--connection NAME] [--debug]

Options:

  • --preview-name: Custom name for the preview app (defaults to "preview_" + original name)
  • --verbose, -v: Enable verbose output
  • --replace, -r: Replace existing preview if it exists
  • --no-open: Don't open the deployed app in a browser (opens by default)
  • --connection, -c: Connection name to use
  • --debug: Enable debug output

Management Commands

drop

Remove a deployed Streamlit application.

sisx drop [--verbose] [--connection NAME] [--force] [--drop-spcs]

Options:

  • --verbose, -v: Enable verbose output
  • --connection, -c: Connection name to use
  • --force, -f: Force drop without confirmation
  • --drop-spcs: Also drop any associated SPCS services

drop-preview

Remove a preview version of a Streamlit application.

sisx drop-preview [--verbose] [--connection NAME] [--force] [--drop-spcs]

Options:

  • --verbose, -v: Enable verbose output
  • --connection, -c: Connection name to use
  • --force, -f: Force drop without confirmation
  • --drop-spcs: Also drop any associated SPCS services

cleanup

Remove multiple applications matching a filter.

sisx cleanup [FILTER] [--verbose] [--connection NAME] [--force] [--drop-spcs]

If no filter is specified, this will remove all apps with "preview_" prefix by default.

Options:

  • --verbose, -v: Enable verbose output
  • --connection, -c: Connection name to use
  • --force, -f: Force cleanup without confirmation
  • --drop-spcs: Also drop any associated SPCS services

Development Commands

new

Create a new Streamlit app from a template.

sisx new [OUTPUT_DIR] [--verbose] [--force] [--connection NAME] [--compute-type TYPE] [--query-warehouse NAME] [--app-warehouse NAME] [--compute-pool NAME] [--stage NAME]

Options:

  • --verbose, -v: Enable verbose output
  • --force, -f: Force overwrite without confirmation
  • --connection, -c: Name of the Snowflake connection to use
  • --compute-type, -t: Type of compute to use: 'warehouse' or 'compute_pool' (default: warehouse)
  • --query-warehouse, -q: Warehouse to use for queries (when using warehouse compute type)
  • --app-warehouse, -a: Warehouse to use for running the app (when using warehouse compute type)
  • --compute-pool: Compute pool to use (when using compute_pool compute type)
  • --stage: Stage to use for app artifacts

run

Run a Streamlit app locally for development.

sisx run [APP_PATH]

Default app path is streamlit_app.py.

test

Run tests for the CLI.

sisx test [PYTEST_ARGS]

Any additional arguments are passed directly to pytest.

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:

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

sisx-0.1.6.tar.gz (135.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sisx-0.1.6-py3-none-any.whl (24.1 kB view details)

Uploaded Python 3

File details

Details for the file sisx-0.1.6.tar.gz.

File metadata

  • Download URL: sisx-0.1.6.tar.gz
  • Upload date:
  • Size: 135.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.4.18

File hashes

Hashes for sisx-0.1.6.tar.gz
Algorithm Hash digest
SHA256 bf24fee9d89cf3bcea67087b62ff2952418ada2a3540ab666d47492dfbd638ae
MD5 455ab2856df332860dc3169196f8ab79
BLAKE2b-256 fcc5da2791e6994e9d791ed9b65751b6770927c89553a99b5c0587103d6c09da

See more details on using hashes here.

File details

Details for the file sisx-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: sisx-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 24.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.4.18

File hashes

Hashes for sisx-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e795688eae7bb5f78781b8fc95ed7c2117132d06a72a4e24542df61e1bfa8a90
MD5 ebd8ed24a520095a7107727e367647dd
BLAKE2b-256 11d9b4c0798f8a006a88a66025d4a9c0988c256086e55f3074586c9a139c4aa8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page