Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -70,6 +70,31 @@ def check_dasha(dasha_type, name, dob, tob, lat, lon, tz):
|
|
| 70 |
|
| 71 |
return gr.Markdown(readable_response)
|
| 72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
# Gradio UI with improvements
|
| 74 |
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
| 75 |
gr.Markdown("# 🪐 Astrology Checker - Find Your Dosha & Dasha 🪐")
|
|
|
|
| 70 |
|
| 71 |
return gr.Markdown(readable_response)
|
| 72 |
|
| 73 |
+
# Function to check Extended Horoscope
|
| 74 |
+
def check_extended_horoscope(horoscope_type, name, dob, tob, lat, lon, tz):
|
| 75 |
+
response = fetch_astrology_data(f"dashas/{horoscope_type}", dob, tob, lat, lon, tz)
|
| 76 |
+
if isinstance(response, str):
|
| 77 |
+
return gr.Markdown(response)
|
| 78 |
+
|
| 79 |
+
readable_response = f"""
|
| 80 |
+
### {horoscope_type_type.replace('-', ' ').title()} Analysis for {name}
|
| 81 |
+
|
| 82 |
+
**Details:**
|
| 83 |
+
"""
|
| 84 |
+
|
| 85 |
+
for key, value in response.items():
|
| 86 |
+
readable_response += f"\n- **{key.replace('_', ' ').title()}**: "
|
| 87 |
+
if isinstance(value, dict):
|
| 88 |
+
for sub_key, sub_value in value.items():
|
| 89 |
+
readable_response += f"\n - {sub_key.replace('_', ' ').title()}: {sub_value}"
|
| 90 |
+
elif isinstance(value, list):
|
| 91 |
+
for item in value:
|
| 92 |
+
readable_response += f"\n - {item}"
|
| 93 |
+
else:
|
| 94 |
+
readable_response += f"{value}"
|
| 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 🪐")
|