File size: 1,765 Bytes
49dee20
 
 
60378a0
 
 
 
 
49dee20
 
60378a0
 
 
 
49dee20
 
 
 
 
 
 
 
 
 
 
60378a0
49dee20
 
 
 
 
 
 
 
 
 
 
60378a0
49dee20
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import gradio as gr
import datetime
import random
import requests

def get_planetary_transits():
    # Placeholder function (Replace with an API call if available)
    return "Sun in Pisces, Moon in Leo, Mars in Capricorn"

def generate_horoscope(name, birth_date, birth_time, birth_place):
    # Get planetary transits
    transits = get_planetary_transits()
    
    # Simulating a detailed astrology prediction
    lucky_number = random.randint(1, 9)
    lucky_color = random.choice(["Red", "Blue", "Green", "Yellow", "Purple"])
    messages = [
        "Today is a great day for introspection and planning.",
        "You might face some challenges, but stay patient.",
        "A financial opportunity is on the horizon.",
        "Love and relationships may take a surprising turn.",
        "Your hard work will be recognized soon!"
    ]
    daily_message = random.choice(messages)
    
    return f"Hello {name},\n\nLucky Number: {lucky_number}\nLucky Color: {lucky_color}\nPlanetary Transits: {transits}\nDaily Insight: {daily_message}\n\n(Generated based on planetary positions on {datetime.date.today()})"

with gr.Blocks() as app:
    gr.Markdown("# 🌟 AstroGuide – Your Daily Horoscope & Insights")
    gr.Markdown("Enter your details below to receive your personalized astrology insights!")
    
    name = gr.Textbox(label="Your Name")
    birth_date = gr.Textbox(label="Birth Date (YYYY-MM-DD)")
    birth_time = gr.Textbox(label="Birth Time (HH:MM)")
    birth_place = gr.Textbox(label="Birth Place")
    
    submit_btn = gr.Button("Generate Horoscope")
    output = gr.Textbox(label="Your Detailed Horoscope")
    
    submit_btn.click(generate_horoscope, inputs=[name, birth_date, birth_time, birth_place], outputs=output)
    
app.launch()