Spaces:
Sleeping
Sleeping
| import pandas as pd | |
| import gradio as gr | |
| CSV_URL = "https://docs.google.com/spreadsheets/d/1CVXfiTL4pJ_TqxRQy6riNU4Iy4OX6HZHM8JzpI_dAZs/gviz/tq?tqx=out:csv" | |
| df = pd.read_csv(CSV_URL, low_memory=False) | |
| # Columns to display | |
| selected_columns = [ | |
| "Name", | |
| "Phone", | |
| "email", | |
| "emailid", | |
| "company", | |
| "designation", | |
| "city", | |
| "country", | |
| "linkedin_url" | |
| ] | |
| def search(phone_query): | |
| results = df[df["Phone"].astype(str).str.contains(phone_query, case=False, na=False)] | |
| if not results.empty: | |
| return results[selected_columns] | |
| else: | |
| return "β No match found." | |
| # Gradio interface | |
| iface = gr.Interface( | |
| fn=search, | |
| inputs=gr.Textbox(label="Enter phone number"), | |
| outputs="dataframe", | |
| title="π Phone Number Lookup App" | |
| ) | |
| iface.launch() | |