Skip to main content

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"
    }
  ]
}

Merge UI Merge Plan


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

streamlit_merge_tables-1.0.4.tar.gz (161.9 kB view details)

Uploaded Source

Built Distribution

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

streamlit_merge_tables-1.0.4-py3-none-any.whl (162.1 kB view details)

Uploaded Python 3

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

Hashes for streamlit_merge_tables-1.0.4.tar.gz
Algorithm Hash digest
SHA256 33a69dc4697c8b0f018e3a0b1b750a234af3e63f80c823eb85d31960eb9ce1a2
MD5 cb873c2456bced7556d76dfe6bda446d
BLAKE2b-256 e5c8948c00df15f50fda7625043f6e8fbc875a029c154bf191cdc4cd25de5bfe

See more details on using hashes here.

File details

Details for the file streamlit_merge_tables-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_merge_tables-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 27e3432a3684acc92c1cb8d70f31ebf1db49aeed6e2ad15c98712eb5e56b0fad
MD5 58932748f6291215bec8683e6d61f9a9
BLAKE2b-256 54cacd32b2ba6b7111f873d5776a579c625e6d96fac9598728b7446a93d3ff3a

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