|
import gradio as gr |
|
import pandas as pd |
|
from io import BytesIO |
|
|
|
def upload_files(workshop_file, participants_file): |
|
|
|
workshop_path = f"workshop_itinerary.pdf" |
|
with open(workshop_path, "wb") as f: |
|
f.write(workshop_file) |
|
workshop_itinerary = f"Workshop Itinerary uploaded as {workshop_path}" |
|
|
|
|
|
participants_df = pd.read_csv(BytesIO(participants_file)) |
|
|
|
|
|
participants = len(participants_df) |
|
rate_per_participant = 75 |
|
total_earnings = participants * rate_per_participant |
|
earnings_info = f"Total Earnings for the Workshop: ${total_earnings}" |
|
|
|
|
|
skills_videos = { |
|
"Supine Lying": "https://www.youtube.com/watch?v=7D_A3LHIxS8", |
|
"Side Roll": "https://www.youtube.com/watch?v=A0KxeAmoPtg", |
|
"Prone Lying": "https://www.youtube.com/watch?v=KhWeLb4XTcY", |
|
"Sit to Backward Roll": "https://www.youtube.com/watch?v=Z3GGSgEO-0M", |
|
"Knee Hand Crawl": "https://www.youtube.com/watch?v=YoOULK3KQTk", |
|
|
|
} |
|
|
|
video_links = "\n".join([f"{skill}: {url}" for skill, url in skills_videos.items()]) |
|
|
|
return workshop_itinerary, participants_df, earnings_info, video_links |
|
|
|
|
|
interface = gr.Interface( |
|
fn=upload_files, |
|
inputs=[ |
|
gr.File(label="Upload MovNat INTRO Workshop Itinerary PDF", type="binary"), |
|
gr.File(label="Upload Participants CSV File", type="binary"), |
|
], |
|
outputs=[ |
|
gr.Textbox(label="Workshop Itinerary"), |
|
gr.Dataframe(label="Participant Information"), |
|
gr.Textbox(label="Total Earnings"), |
|
gr.Textbox(label="Links to MovNat Skills and Videos"), |
|
], |
|
title="MovNat Workshop Manager", |
|
description="Upload your MovNat workshop itinerary and participant information to manage your workshop efficiently." |
|
) |
|
|
|
|
|
interface.launch() |