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.3.tar.gz (161.8 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.3-py3-none-any.whl (162.2 kB view details)

Uploaded Python 3

File details

Details for the file streamlit_merge_tables-1.0.3.tar.gz.

File metadata

  • Download URL: streamlit_merge_tables-1.0.3.tar.gz
  • Upload date:
  • Size: 161.8 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.3.tar.gz
Algorithm Hash digest
SHA256 75d3c57a4fc0f0cc20dc8ecb8f831fdc36f2a1ac67bc743412e2375b7cbfcc57
MD5 a10246b08a6b5bf8d734fd7098d16efc
BLAKE2b-256 600a73a11f7186ef455e29a29bf49eb340d34ffa2253a81bd3d1d47303bc0fd3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for streamlit_merge_tables-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bdb1bac187dc914043681279fa3308e208210f840a9ee32b7a6cb3840b9d911b
MD5 c3fa116ce7fb486dbc90f85dba75c05c
BLAKE2b-256 d6f1d947faf073af36ca2bcd72beb4cd7ba3b2e2cb10b8c65d88875584a7441b

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