Visual table merge tool for Streamlit
Project description
streamlit-merge-tables
streamlit-merge-tables is a Streamlit custom component that allows users to visually define merge (join) logic across multiple tables using an interactive UI.
The component does not perform the actual data merge. Instead, it returns a merge plan (dictionary) describing how tables should be joined, giving developers full control over execution.
Features
- Visual table merge builder
- Chain and pairwise merge modes
- Multiple join types: INNER, LEFT, RIGHT, OUTER
- Column-level join key selection
- Built-in validation
- Optional DAG visualization of merge flow
- Framework-agnostic execution (pandas, SQL, backend services)
Installation
Install from PyPI
pip install streamlit-merge-tables
Install from GitHub
git clone https://github.com/linhnt-hub/streamlit-merge-tables.git
cd streamlit-merge-tables
pip install .
Quick Start
import streamlit as st
import pandas as pd
from streamlit_component import merge_tables
df_interfaces = pd.DataFrame({
"ifname": ["ge-0/0/0", "ge-0/0/1"],
"speed": [1000, 1000],
"status": ["up", "down"],
})
df_traffic = pd.DataFrame({
"ifname": ["ge-0/0/0"],
"bps": [1234],
})
tables = [
{
"id": "interfaces",
"name": "Interfaces",
"columns": list(df_interfaces.columns),
},
{
"id": "traffic",
"name": "Traffic",
"columns": list(df_traffic.columns),
},
]
merge_plan = merge_tables(
tables=tables,
dag=True,
)
st.subheader("Merge plan")
st.json(merge_plan)
Tables Schema
The tables parameter defines table metadata only, not actual DataFrames.
tables = [
{
"id": "interfaces",
"name": "Interfaces",
"columns": ["ifname", "speed", "status"],
}
]
Merge Plan Output
{
"mode": "chain",
"steps": [
{
"leftTableId": "interfaces",
"rightTableId": "traffic",
"leftKeys": ["ifname"],
"rightKeys": ["ifname"],
"joinType": "inner"
}
]
}
Developer Notes
- This component does not merge data
- It only produces merge logic
- Developers control execution entirely
License
MIT License
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
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_merge_tables-1.0.4.tar.gz.
File metadata
- Download URL: streamlit_merge_tables-1.0.4.tar.gz
- Upload date:
- Size: 161.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33a69dc4697c8b0f018e3a0b1b750a234af3e63f80c823eb85d31960eb9ce1a2
|
|
| MD5 |
cb873c2456bced7556d76dfe6bda446d
|
|
| BLAKE2b-256 |
e5c8948c00df15f50fda7625043f6e8fbc875a029c154bf191cdc4cd25de5bfe
|
File details
Details for the file streamlit_merge_tables-1.0.4-py3-none-any.whl.
File metadata
- Download URL: streamlit_merge_tables-1.0.4-py3-none-any.whl
- Upload date:
- Size: 162.1 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 |
27e3432a3684acc92c1cb8d70f31ebf1db49aeed6e2ad15c98712eb5e56b0fad
|
|
| MD5 |
58932748f6291215bec8683e6d61f9a9
|
|
| BLAKE2b-256 |
54cacd32b2ba6b7111f873d5776a579c625e6d96fac9598728b7446a93d3ff3a
|