Update main.py
Browse files
main.py
CHANGED
@@ -1,59 +1,36 @@
|
|
1 |
import streamlit as st
|
2 |
-
from
|
3 |
-
from dataframe import precomputed_df
|
4 |
-
from search import search_application # Search functionality
|
5 |
|
6 |
-
# Set the page title
|
7 |
-
st.set_page_config(page_title="Visa Application Status Checker", layout="wide")
|
8 |
-
|
9 |
-
# Application title
|
10 |
st.title("Visa Application Status Checker")
|
11 |
|
12 |
-
#
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
if choice == "Home":
|
17 |
-
st.subheader("Welcome to the Visa Application Status Checker!")
|
18 |
-
st.write(
|
19 |
-
"""
|
20 |
-
This application allows you to:
|
21 |
-
- Check the status of your Visa Application.
|
22 |
-
- Find the nearest application records for invalid application numbers.
|
23 |
-
- Explore real-time Visa updates.
|
24 |
-
"""
|
25 |
-
)
|
26 |
-
st.write("Navigate to 'Search Application' to start.")
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
|
|
34 |
|
35 |
-
|
36 |
-
if
|
37 |
-
st.warning("Please enter a valid
|
38 |
else:
|
39 |
-
|
40 |
-
search_result = search_application(user_input)
|
41 |
|
42 |
-
if
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
else:
|
51 |
-
st.warning(f"No
|
52 |
-
|
53 |
-
|
54 |
-
st.write(
|
55 |
-
"""
|
56 |
-
This application was built using **Streamlit** to help users check their Visa application status.
|
57 |
-
Data is updated in real-time and fetched directly from the official website.
|
58 |
-
"""
|
59 |
-
)
|
|
|
1 |
import streamlit as st
|
2 |
+
from search import search_application
|
3 |
+
from dataframe import precomputed_df
|
|
|
4 |
|
|
|
|
|
|
|
|
|
5 |
st.title("Visa Application Status Checker")
|
6 |
|
7 |
+
# User input for application number
|
8 |
+
application_number = st.text_input("Enter your Application Number (include 'IRL' if applicable):")
|
9 |
+
search_button = st.button("Search")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
+
if search_button and application_number:
|
12 |
+
try:
|
13 |
+
# Parse the application number
|
14 |
+
if "IRL" in application_number.upper():
|
15 |
+
application_number = int("".join(filter(str.isdigit, application_number.upper().split("IRL")[-1])))
|
16 |
+
else:
|
17 |
+
application_number = int(application_number)
|
18 |
|
19 |
+
# Validate input length
|
20 |
+
if len(str(application_number)) > 8:
|
21 |
+
st.warning("Please enter a valid application number with up to 8 digits.")
|
22 |
else:
|
23 |
+
result = search_application(application_number)
|
|
|
24 |
|
25 |
+
if result is not None and isinstance(result, pd.Series):
|
26 |
+
# Display exact match
|
27 |
+
st.subheader("Exact Match Found")
|
28 |
+
st.success(f"Application Number: {result['Application Number']}, Decision: {result['Decision']}")
|
29 |
+
elif result is not None:
|
30 |
+
# Display nearest records
|
31 |
+
st.subheader("Nearest Application Numbers")
|
32 |
+
st.table(result[["Application Number", "Decision", "Difference"]])
|
33 |
else:
|
34 |
+
st.warning(f"No records found for Application Number {application_number}.")
|
35 |
+
except ValueError:
|
36 |
+
st.error("Invalid input. Please enter numeric digits only.")
|
|
|
|
|
|
|
|
|
|
|
|