Update app.py
Browse files65 unmodified lines6667686970717273747576164 unmodified lines24124224324424524624718 unmodified lines26626726826927027127227327427527627727827928028128228328428528628728817 unmodified lines3063073083093103113123133143 unmodified lines31831932032132232332432532632732832933033117 unmodified lines34935035135235335435535635735835965 unmodified lines# Setup headers for the worksheetworksheet = sheet.sheet1worksheet.update("A1:R1", [["Timestamp", "Company Name", "Event Name", "Event Type", "Zip Code", "Event Style","Attendees", "Duration", "Event Date", "Event Start Time", "Budget Min", "Budget Max","Special Requirements", "Event Goals", "Company Website","Catering", "Additional Services", "Service Details"]])worksheet.format("A1:R1", {"textFormat": {"bold": True}})# Get the first worksheetworksheet = sheet.sheet1164 unmodified linesprofessional = st.checkbox("Professional")attendees = st.number_input("Expected Number of Attendees*", min_value=1, value=100)duration = st.slider("Event Duration (Days)", min_value=1, max_value=7, value=1)col1, col2 = st.columns(2)with col1:18 unmodified linesother_services = st.text_input("Other Services Needed (if not listed above)")# Optional fieldswebsite_url = st.text_input("Company Website URL (Optional)", placeholder="e.g., www.example.com",help="We'll extract information about your company to find better matches")special_requirements = st.text_area("Special Requirements or Preferences",help="E.g., accessibility needs, catering preferences, technical requirements")event_goals = st.text_area("Event Goals",help="Describe the primary goals of this event")if st.button("Generate Venue Recommendations"):if not all([company_name, event_name, event_type, attendees, zip_code, event_date, event_time]):st.error("Please fill in all required fields marked with *")else:# Collect company information if website is providedcompany_info = Noneif website_url:with st.spinner("Extracting company information..."):company_info = scrape_website(website_url)# Collect all form dataevent_style = ', '.join([style for style, selected in zip(['Formal', 'Outdoor', 'Modern', 'Traditional', 'Creative', 'Professional'],[formal, outdoor, modern, traditional, creative, professional]) if selected])17 unmodified linesservice_details = ", ".join(additional_services) if additional_services else "None"# Format event date and timeformatted_date = event_date.strftime("%Y-%m-%d")formatted_time = event_time.strftime("%H:%M")# Format data for Google Sheetsform_data = {3 unmodified lines"Zip Code": zip_code,"Event Style": event_style,"Attendees": str(attendees),"Duration": f"{duration} day(s)","Event Date": formatted_date,"Event Start Time": formatted_time,"Budget Min": f"${budget_min}","Budget Max": f"${budget_max}","Special Requirements": special_requirements if special_requirements else "None specified","Event Goals": event_goals if event_goals else "Not provided","Company Website": website_url if website_url else "Not provided","Catering": "Yes" if catering else "No","Additional Services": ", ".join([service for service in ["Floral/Decor", "DJ/Entertainment", "Lighting", "Meeting Spaces/Breakouts", "AV Services"]if service in additional_services]),17 unmodified linesEvent Start Time: {formatted_time}Event Style: {event_style}Expected Attendees: {attendees}Duration: {duration} day(s)Budget Range: ${budget_min} - ${budget_max}Special Requirements: {special_requirements if special_requirements else 'None specified'}Event Goals: {event_goals if event_goals else 'Not provided'}"""recommendations = generate_venue_recommendations(event_info, zip_code, event_type, attendees, event_style, company_info, additional_services)if recommendations:st.markdown(recommendations)65 unmodified lines66676869707172737475164 unmodified lines24024124224324424518 unmodified lines26426526626726826927027127227327427527617 unmodified lines2942952962972982993003013023 unmodified lines30630730830931031131231331431531617 unmodified lines33433533633733833934034134234365 unmodified lines# Setup headers for the worksheetworksheet = sheet.sheet1worksheet.update("A1:O1", [["Timestamp", "Company Name", "Event Name", "Event Type", "Zip Code", "Event Style","Attendees", "Event Date", "Event Start Time", "Budget Min", "Budget Max","Special Requirements", "Catering", "Additional Services", "Service Details"]])worksheet.format("A1:O1", {"textFormat": {"bold": True}})# Get the first worksheetworksheet = sheet.sheet1164 unmodified linesprofessional = st.checkbox("Professional")attendees = st.number_input("Expected Number of Attendees*", min_value=1, value=100)col1, col2 = st.columns(2)with col1:18 unmodified linesother_services = st.text_input("Other Services Needed (if not listed above)")# Optional fieldsspecial_requirements = st.text_area("Special Requirements or Preferences",help="E.g., accessibility needs, catering preferences, technical requirements")if st.button("Generate Venue Recommendations"):if not all([company_name, event_name, event_type, attendees, zip_code, event_date, event_time]):st.error("Please fill in all required fields marked with *")else:# Collect all form dataevent_style = ', '.join([style for style, selected in zip(['Formal', 'Outdoor', 'Modern', 'Traditional', 'Creative', 'Professional'],[formal, outdoor, modern, traditional, creative, professional]) if selected])17 unmodified linesservice_details = ", ".join(additional_services) if additional_services else "None"# Format event date and time (12-hour format)formatted_date = event_date.strftime("%Y-%m-%d")formatted_time = event_time.strftime("%I:%M %p") # 12-hour clock with AM/PM# Format data for Google Sheetsform_data = {3 unmodified lines"Zip Code": zip_code,"Event Style": event_style,"Attendees": str(attendees),"Event Date": formatted_date,"Event Start Time": formatted_time,"Budget Min": f"${budget_min}","Budget Max": f"${budget_max}","Special Requirements": special_requirements if special_requirements else "None specified","Catering": "Yes" if catering else "No","Additional Services": ", ".join([service for service in ["Floral/Decor", "DJ/Entertainment", "Lighting", "Meeting Spaces/Breakouts", "AV Services"]if service in additional_services]),17 unmodified linesEvent Start Time: {formatted_time}Event Style: {event_style}Expected Attendees: {attendees}Budget Range: ${budget_min} - ${budget_max}Special Requirements: {special_requirements if special_requirements else 'None specified'}"""# Pass None for company_info since we removed the website scrapingrecommendations = generate_venue_recommendations(event_info, zip_code, event_type, attendees, event_style, None, additional_services)if recommendations:st.markdown(recommendations)
app.py+8-24