Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -95,6 +95,33 @@ def check_extended_horoscope(horoscope_type, name, dob, tob, lat, lon, tz):
|
|
95 |
|
96 |
return gr.Markdown(readable_response)
|
97 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
# Gradio UI with improvements
|
99 |
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
100 |
gr.Markdown("# 🪐 Astrology Checker - Find Your Dosha & Dasha 🪐")
|
@@ -137,25 +164,12 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
137 |
create_button("Yogini Dasha Main", "yogini-dasha-main", check_dasha)
|
138 |
create_button("Yogini Dasha Sub", "yogini-dasha-sub", check_dasha)
|
139 |
|
140 |
-
gr.Markdown("##
|
141 |
with gr.Row():
|
142 |
-
create_button("
|
143 |
-
create_button("
|
144 |
-
create_button("
|
145 |
-
create_button("
|
146 |
-
create_button("Extended Kundli Details", "extended-kundli-details", check_extended_horoscope)
|
147 |
-
create_button("Shad Bala", "shad-bala", check_extended_horoscope)
|
148 |
-
create_button("Shad Sati Table", "sade-sati-table", check_extended_horoscope)
|
149 |
-
create_button("Friendship", "friendship", check_extended_horoscope)
|
150 |
-
create_button("Kp Houses", "kp-houses", check_extended_horoscope)
|
151 |
-
create_button("Kp Planets", "kp-planets", check_extended_horoscope)
|
152 |
-
create_button("Gem Suggestion", "gem-suggestion", check_extended_horoscope)
|
153 |
-
create_button("Numero table", "numero-table", check_extended_horoscope)
|
154 |
-
create_button("Rudraksh Suggestion", "rudraksh-suggestion", check_extended_horoscope)
|
155 |
-
create_button("Varshapal Details", "varshapal-details", check_extended_horoscope)
|
156 |
-
create_button("Varshapal Month Chart", "varshapal-month-chart", check_extended_horoscope)
|
157 |
-
create_button("Varshapal Year Chart", "varshapal-year-chart", check_extended_horoscope)
|
158 |
-
create_button("Yoga List", "yoga-list", check_extended_horoscope)
|
159 |
|
160 |
|
161 |
gr.Markdown("### 🔍 Enter your details above and click the relevant button to analyze your astrology report!")
|
|
|
95 |
|
96 |
return gr.Markdown(readable_response)
|
97 |
|
98 |
+
|
99 |
+
# Function to check Horoscope(Kundali)
|
100 |
+
def check_horoscope(horoscope(K)_type, name, dob, tob, lat, lon, tz):
|
101 |
+
response = fetch_astrology_data(f"horoscope/{horoscope(K)_type}", dob, tob, lat, lon, tz)
|
102 |
+
if isinstance(response, str):
|
103 |
+
return gr.Markdown(response)
|
104 |
+
|
105 |
+
readable_response = f"""
|
106 |
+
### {horoscope(K)_type.replace('-', ' ').title()} Analysis for {name}
|
107 |
+
|
108 |
+
**Details:**
|
109 |
+
"""
|
110 |
+
|
111 |
+
for key, value in response.items():
|
112 |
+
readable_response += f"\n- **{key.replace('_', ' ').title()}**: "
|
113 |
+
if isinstance(value, dict):
|
114 |
+
for sub_key, sub_value in value.items():
|
115 |
+
readable_response += f"\n - {sub_key.replace('_', ' ').title()}: {sub_value}"
|
116 |
+
elif isinstance(value, list):
|
117 |
+
for item in value:
|
118 |
+
readable_response += f"\n - {item}"
|
119 |
+
else:
|
120 |
+
readable_response += f"{value}"
|
121 |
+
|
122 |
+
return gr.Markdown(readable_response)
|
123 |
+
|
124 |
+
|
125 |
# Gradio UI with improvements
|
126 |
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
127 |
gr.Markdown("# 🪐 Astrology Checker - Find Your Dosha & Dasha 🪐")
|
|
|
164 |
create_button("Yogini Dasha Main", "yogini-dasha-main", check_dasha)
|
165 |
create_button("Yogini Dasha Sub", "yogini-dasha-sub", check_dasha)
|
166 |
|
167 |
+
gr.Markdown("## 💫 Horoscope")
|
168 |
with gr.Row():
|
169 |
+
create_button("Planet Details", "planet-details", check_horoscope)
|
170 |
+
create_button("Ascendant Report", "ascendant-report", check_horoscope)
|
171 |
+
create_button("Planet Report", "planet-report", check_horoscope)
|
172 |
+
create_button("Personal Characteristics", "personal-characteristics", check_horoscope)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
173 |
|
174 |
|
175 |
gr.Markdown("### 🔍 Enter your details above and click the relevant button to analyze your astrology report!")
|