Skip to main content

streamlit-azure-kit

A JSON-based parameter-to-key mapper for database connections.

Installation

pip install streamlit-azure-kit

Quick Start

Database Connections

from streamlit_azure_kit.config import ConfigLoader
from streamlit_azure_kit.database import create_engine_from_config

# Load config and create database engine
config = ConfigLoader("config/endpoint_config.json")
db_config = config.get_database_config("my_dashboard", "primary_db")
engine = create_engine_from_config(db_config)

Blob Storage (Optional)

from streamlit_azure_kit.config import ConfigLoader
from streamlit_azure_kit.database import create_blob_client_from_config

# Load config and create blob storage client
config = ConfigLoader("config/endpoint_config.json")
storage_config = config.get_storage_config("my_dashboard", "blob_storage")
blob_client = create_blob_client_from_config(storage_config)

# Use the client
container = blob_client.get_container_client("mycontainer")

Authentication (Optional - Streamlit Apps Only)

from streamlit_azure_kit.auth import AuthHandler

# Optional - only for Streamlit dashboards
auth = AuthHandler("config/user_roles.json")
auth.require_auth()

Configuration

Your application needs an endpoint_config.json file.

Minimal Database Configuration

{
  "_database_definitions": {
    "my_db": {
      "server": "myserver.database.windows.net",
      "database": "mydb",
      "db_engine_type": "always_on",
      "pool_size": 10,
      "max_overflow": 20,
      "pool_timeout": 30,
      "pool_recycle": 3600,
      "connection_timeout": 30,
      "retry_config": {
        "max_retries": 6,
        "delay": 2.0
      }
    }
  },
  "my_app": {
    "production": {
      "primary_db": "my_db"
    }
  }
}

Storage Configuration (Optional)

{
  "_storage_definitions": {
    "my_storage": {
      "account_name": "mystorageaccount",
      "connection_timeout": 20
    }
  },
  "my_app": {
    "production": {
      "blob_storage": "my_storage"
    }
  }
}

Note: Only account_name is required for storage. Optional parameters: connection_timeout, max_single_put_size, max_block_size.

Requirements

  • Python >= 3.9
  • SQLAlchemy >= 2.0.0
  • Azure Identity >= 1.14.0
  • PyODBC >= 4.0.0
  • Pandas >= 2.0.0
  • Azure Storage Blob >= 12.0.0

License

MIT License - See LICENSE file for details

Metadata

Release files for streamlit-azure-kit 0.3.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for streamlit-azure-kit 0.3.4
File Interpreter ABI Platform Actions
streamlit_azure_kit-0.3.4-py3-none-any.whl Python 3 none any Details for streamlit_azure_kit-0.3.4-py3-none-any.whl

Release files / streamlit_azure_kit-0.3.4-py3-none-any.whl

Download URL streamlit_azure_kit-0.3.4-py3-none-any.whl
Size 20.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
106dc7627e222cc94f01a99b4747467bb33f05cfa366f02392a5747883c8f9ae
BLAKE2b-256 checksum
How to use checksums
202474e076ad938652a1423b4d8913e9b4e84d486472c0661d4a62d51bb3f7e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.13

Security for streamlit-azure-kit 0.3.4

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page