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.
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 labelvalue- Current valuevalue_before- Previous value for delta calculation
Optional:
relative_change- Show percentage vs absolute change (default: False)time_series- pd.Series for chart displayformat- String ('number', 'percentage', 'currency', 'integer') or dict. Auto-detects integer vs number if omitted. Defaults: 2 decimals, € for currencychart_type- 'line', 'bar', or 'area' (default: 'line')line_color- Chart line colorshow_average- Show average line on chartinfo_text- Hover text for info iconis_inverse- Invert colors for "lower is better" metricsbackground_color,border,shadow,border_radius,height- Styling options
License
MIT
Project details
Release history Release notifications | RSS feed
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)
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0812e0dbca740615087c34fd1e8fc64b9cb85a61be11c0318ff054adb91a6c02
|
|
| MD5 |
2510791fd4fc958506a1094548af8543
|
|
| BLAKE2b-256 |
d964affe7ab2d6a2eb64c2e3bf0c8f274f812b6fddae6cdc5386e7cf43a2f51b
|
File details
Details for the file streamlit_kpi_card-0.1.0-py3-none-any.whl.
File metadata
- Download URL: streamlit_kpi_card-0.1.0-py3-none-any.whl
- Upload date:
- Size: 226.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce84f116366f159d10a101f735c14bd6e9fb44db8d7665d0f20cb9b26aaaaedd
|
|
| MD5 |
528758bf28692e7132b40d2cb9e4019f
|
|
| BLAKE2b-256 |
036f3a19f125aba103b4f505804bc0dd1a82e1a785939572f34847814208b38e
|