Skip to main content

Query Tool

Query Tool - a powerful and user-friendly streamlit component designed to simplify your data analysis. With its intuitive interface, you can easily select the desired databases, columns, and tables, and apply filters, dimensions, and measures to analyze your data. Whether you're a beginner or an experienced analyst, "query_tool" is the perfect tool for your data analysis needs.

Installation

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

pip install bp-query-tool

Usage

To use the Query Tool component in your Streamlit application, follow these steps:

  1. Import the necessary modules:
import query_tool as qt
  1. Add the Query Tool component to your application:
qt.query_tool(
    query=query,
    title="Query Tool",
    databases=databases,
    tables=tables,
    columns=columns,
    on_database_change=on_database_change,
    on_table_change=on_table_change,
    on_generate_query=on_generate_query,
    on_copy_query=on_copy_query,
    on_execute_query=on_execute_query,
    key="query_builder",
)
  1. Run your Streamlit application:
streamlit run your_app.py

Example

import query_tool as qt

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 on_database_change(database):
    print(database)

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

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

def on_copy_query(query):
    print(query)

def on_execute_query(query):
    print(query)

qt.query_tool(
    query=query,
    title="Query Tool",
    databases=databases,
    tables=tables,
    columns=columns,
    on_database_change=on_database_change,
    on_table_change=on_table_change,
    on_generate_query=on_generate_query,
    on_copy_query=on_copy_query,
    on_execute_query=on_execute_query,
    key="query_builder",
)

Screenshot

Screenshot

Metadata

Release files for bp-query-tool 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bp-query-tool 1.0.3
File Size Uploaded Provenance Actions
bp_query_tool-1.0.3.tar.gz 314.4 kB Without provenance Details for bp_query_tool-1.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bp-query-tool 1.0.3
File Interpreter ABI Platform Actions
bp_query_tool-1.0.3-py3-none-any.whl Python 3 none any Details for bp_query_tool-1.0.3-py3-none-any.whl

Total release size: 631.9 kB

Release files / bp_query_tool-1.0.3.tar.gz

Download URL bp_query_tool-1.0.3.tar.gz
Size 314.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4793bba8b741b207f41060ad63f58482078aa290e4aa8276426a4d35ed91f9db
BLAKE2b-256 checksum
How to use checksums
d87363066146558e17ec49f786888f1ab7a88b2ecd36f16d393a81b1cb1826fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.10

Release files / bp_query_tool-1.0.3-py3-none-any.whl

Download URL bp_query_tool-1.0.3-py3-none-any.whl
Size 317.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f2e62573631a71aa08ac5056767e061e8d2aafbaa402de2fc1aedcf48d0252f9
BLAKE2b-256 checksum
How to use checksums
1104a8f848861390f41b434563290893b7b02382645c69f7e916a2102385ded4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.10

Security for bp-query-tool 1.0.3

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page