Skip to main content

A beautiful, interactive KPI card component for Streamlit with time series visualization

Project description

Streamlit KPI Card

KPI card component for Streamlit with time series charts and delta indicators.

Example KPI Cards

Usage

import streamlit as st
import pandas as pd
from streamlit_kpi_card import kpi_card

# Create sample time series data
time_series = pd.Series([100, 105, 103, 108, 110, 115, 120])

# Minimal usage - format auto-detected from value type
kpi_card(
    name='Active Users',
    value=1250,
    value_before=1100
)

# With currency formatting
kpi_card(
    name='Revenue',
    value=14500.00,
    value_before=12000.00,
    time_series=time_series,
    format="currency"
)

# Custom currency
kpi_card(
    name='Revenue (USD)',
    value=14500.00,
    value_before=12000.00,
    format={"type": "currency", "decimals": 2, "currency": "$"}
)

Parameters

Required:

  • name - KPI label
  • value - Current value
  • value_before - Previous value for delta calculation

Optional:

  • relative_change - Show percentage vs absolute change (default: False)
  • time_series - pd.Series for chart display
  • format - String ('number', 'percentage', 'currency', 'integer') or dict. Auto-detects integer vs number if omitted. Defaults: 2 decimals, € for currency
  • chart_type - 'line', 'bar', or 'area' (default: 'line')
  • line_color - Chart line color
  • show_average - Show average line on chart
  • info_text - Hover text for info icon
  • is_inverse - Invert colors for "lower is better" metrics
  • background_color, border, shadow, border_radius, height - Styling options

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

streamlit_kpi_card-0.1.0.tar.gz (312.7 kB view details)

Uploaded Source

Built Distribution

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

streamlit_kpi_card-0.1.0-py3-none-any.whl (226.6 kB view details)

Uploaded Python 3

File details

Details for the file streamlit_kpi_card-0.1.0.tar.gz.

File metadata

  • Download URL: streamlit_kpi_card-0.1.0.tar.gz
  • Upload date:
  • Size: 312.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for streamlit_kpi_card-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0812e0dbca740615087c34fd1e8fc64b9cb85a61be11c0318ff054adb91a6c02
MD5 2510791fd4fc958506a1094548af8543
BLAKE2b-256 d964affe7ab2d6a2eb64c2e3bf0c8f274f812b6fddae6cdc5386e7cf43a2f51b

See more details on using hashes here.

File details

Details for the file streamlit_kpi_card-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_kpi_card-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ce84f116366f159d10a101f735c14bd6e9fb44db8d7665d0f20cb9b26aaaaedd
MD5 528758bf28692e7132b40d2cb9e4019f
BLAKE2b-256 036f3a19f125aba103b4f505804bc0dd1a82e1a785939572f34847814208b38e

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