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.2.tar.gz (202.0 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.2-py3-none-any.whl (201.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: streamlit_kpi_card-0.1.2.tar.gz
  • Upload date:
  • Size: 202.0 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.2.tar.gz
Algorithm Hash digest
SHA256 410414725d074fa6e24e5222fdd897816294353a65b951470b9ec6851e083f74
MD5 02402f6b57ee983d4fdae63de2dd7804
BLAKE2b-256 f613051ad97524d3d7d474a3a76ca4ed465e7cee56adda6956b8fe7772cfa778

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for streamlit_kpi_card-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 95d98cf8900b396512ee4dceb3827f6ece27bc3862a13cb24d2ea0c84545fd5f
MD5 d4f34364feaab8f402e9a9b2410c6a25
BLAKE2b-256 7eb6c587aaa3070622168532180deb049511b34f83557336d11b73f1ea01b10b

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