Py.Cafe

ronald.pedeglorio/

streamlit-email-lookup

Streamlit Email Lookup

DocsPricing
  • app.py
  • requirements.txt
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import streamlit as st
import numpy as np
import pandas as pd

# Load the Excel file
df = pd.read_excel('https://philsagov-my.sharepoint.com/:x:/g/personal/ronald_pedeglorio_philsa_gov_ph/ETvqosjFcSFIicv8ti0xds0Br7v_80jnnn9caewWD5TLFA?e=Z7M8iX')

# Function to search for the email and return the corresponding value in column H
def find_email(email):
    # Search for the email in column E
    row = df[df['E'] == email]
    if not row.empty:
        # Return the value in column H of the same row
        return row.iloc[0]['H']
    else:
        return "Email not found."

# Get user input
user_email = input("Enter the email address: ")

# Find and print the result
result = find_email(user_email)
print(result)