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:
- Import the necessary modules:
import data_fabric as df
- 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
)
- 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
)
Metadata
Release files for bp-data-fabric 1.0.15
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bp_data_fabric-1.0.15.tar.gz | 3.9 kB | Without provenance | Details for bp_data_fabric-1.0.15.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bp_data_fabric-1.0.15-py3-none-any.whl | Python 3 | none | any | Details for bp_data_fabric-1.0.15-py3-none-any.whl |
Total release size: 8.3 kB
Release files / bp_data_fabric-1.0.15.tar.gz
| Download URL | bp_data_fabric-1.0.15.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
95f6370748aac78dd355d760a74c819e01ff34b5962661b96fd7f69915291fd0
|
|
BLAKE2b-256 checksum How to use checksums |
ec64c24a4b4a10e7d7efd911fc072b64a0822bea488294ff0ad94bc0d4869493
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.5
|
Release files / bp_data_fabric-1.0.15-py3-none-any.whl
| Download URL | bp_data_fabric-1.0.15-py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bf2f1b2affa6735e016614cc3982087461cb8884dc4904d1f2f4768d3a7517c8
|
|
BLAKE2b-256 checksum How to use checksums |
e4e85a0688c5265d88e28d129f70b84a4789cef9c8db14d1e951a1f3f9d802d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.5
|
Security for bp-data-fabric 1.0.15
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.