Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bp-data-fabric

Package Overview
Dependencies
Maintainers
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bp-data-fabric

  • 1.0.15
  • PyPI
  • Socket score

Maintainers
3

Data Fabric

Data Fabric is a comprehensive streamlit component package available on PyPI. This powerful tool simplifies the process of generating SQL queries by allowing users to select databases, tables, and columns effortlessly. It provides a user-friendly interface to display data in a tabular format, enabling easy filtering and data export directly from the grid. Additionally, Data Fabric offers visually appealing graphical representations of data, including bar charts, pie charts, heatmaps, and scatter charts. With Data Fabric, analyzing and visualizing data becomes a seamless experience within your Streamlit applications.

Installation

You can install the Data Fabric package from PyPI using pip:

pip install bp-data-fabric

Usage

To use the Data Fabric component in your Streamlit application, follow these steps:

  1. Import the necessary modules:
import data_fabric as df
  1. Add the Data Fabric component to your application:
df.data_fabric(
    query="",
    query_tool_title="Query Tool",
    data_grid_title="Results",
    data_visualization_title="Data Visualization",
    databases=database_list,
    tables=table_list,
    columns=column_list,
    error="",
    show_execute=True,
    on_database_change=handle_on_database_change,
    on_table_change=handle_on_table_change,
    on_generate_query=handle_on_generate_query,
    on_copy_query=handle_on_copy_query,
    on_execute_query=handle_on_execute,
    data=data,
    show_data_grid=True,
    show_charts=True
)
  1. Run your Streamlit application:
streamlit run your_app.py

Example

import data_fabric as df

databases = ['COMPANY_DB', 'SALES_DB']
tables = [
    {
        'database': 'COMPANY_DB',
        'tables': ['EMPLOYEES', 'DEPARTMENTS']
    },
    {
        'database': 'SALES_DB',
        'tables': ['CUSTOMERS', 'ORDERS']
    }
]
columns = [
    {
        'fqtn': 'COMPANY_DB.EMPLOYEES',
        'columns': ['ID', 'NAME', 'EMAIL', 'POSITION']
    },
    {
        'fqtn': 'COMPANY_DB.DEPARTMENTS',
        'columns': ['ID', 'NAME', 'LOCATION', 'MANAGER']
    },
    {
        'fqtn': 'SALES_DB.CUSTOMERS',
        'columns': ['ID', 'NAME', 'EMAIL', 'PHONE']
    },
    {
        'fqtn': 'SALES_DB.ORDERS',
        'columns': ['ID', 'PRODUCT', 'QUANTITY', 'DATE']
    }
]

def handle_on_database_change(database):
    print(database)

def handle_on_table_change(database, table):
    print(database, table)

def handle_on_generate_query(selection, query):
    print(selection, query)

def handle_on_copy_query(query):
    print(query)

def handle_on_execute(query):
    print(query)

df.data_fabric(
    query="",
    query_tool_title="Query Tool",
    data_grid_title="Results",
    data_visualization_title="Data Visualization",
    databases=database_list,
    tables=table_list,
    columns=column_list,
    error="",
    show_execute=True,
    on_database_change=handle_on_database_change,
    on_table_change=handle_on_table_change,
    on_generate_query=handle_on_generate_query,
    on_copy_query=handle_on_copy_query,
    on_execute_query=handle_on_execute,
    data=data,
    show_data_grid=True,
    show_charts=True
)

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc