leadingbridge commited on
Commit
522a27f
1 Parent(s): 3decae1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -1,9 +1,10 @@
 
1
  import gradio as gr
2
  import pandas as pd
3
  from datetime import datetime
4
  import pytz # This library is used for timezone conversions
5
 
6
- def display_csv(file, supplier, order_number):
7
  df = pd.read_csv(file.name)
8
 
9
  # Define supplier-specific filters
@@ -11,8 +12,8 @@ def display_csv(file, supplier, order_number):
11
  "Supplier 1": lambda df: df[~df['Vendor'].isin(["Seed", "EverColor", "Candy Magic", "OLENS", "Fairy", "Shobido", "Geo Medical", "Ann365", "Lenstown", "LensVery"])],
12
  "Supplier 2": lambda df: df[df['Vendor'].isin(["Candy Magic", "OLENS", "Fairy", "Shobido"])],
13
  "Supplier 3": lambda df: df[df['Vendor'].isin(["Seed", "EverColor"])],
14
- "Supplier 4": lambda df: df[df['Vendor'] == "Geo Medical", "Lenstown"],
15
- "Supplier 5": lambda df: df[df['Vendor'] == "Ann365", "LensVery"]
16
  }
17
 
18
  # Apply supplier filter if selected
@@ -60,7 +61,7 @@ with gr.Blocks() as demo:
60
  output_file = gr.File(label="Download Filtered CSV")
61
 
62
  # Bind the function to inputs and outputs using the button
63
- load_button.click(fn=display_csv, inputs=[file_input, supplier_input, order_number_input], outputs=[output_df, output_file])
64
 
65
  # Run the interface
66
  demo.launch()
 
1
+ ###ORDER###
2
  import gradio as gr
3
  import pandas as pd
4
  from datetime import datetime
5
  import pytz # This library is used for timezone conversions
6
 
7
+ def order_csv(file, supplier, order_number):
8
  df = pd.read_csv(file.name)
9
 
10
  # Define supplier-specific filters
 
12
  "Supplier 1": lambda df: df[~df['Vendor'].isin(["Seed", "EverColor", "Candy Magic", "OLENS", "Fairy", "Shobido", "Geo Medical", "Ann365", "Lenstown", "LensVery"])],
13
  "Supplier 2": lambda df: df[df['Vendor'].isin(["Candy Magic", "OLENS", "Fairy", "Shobido"])],
14
  "Supplier 3": lambda df: df[df['Vendor'].isin(["Seed", "EverColor"])],
15
+ "Supplier 4": lambda df: df[df['Vendor'].isin(["Geo Medical", "Lenstown"])],
16
+ "Supplier 5": lambda df: df[df['Vendor'].isin(["Ann365", "LensVery"])]
17
  }
18
 
19
  # Apply supplier filter if selected
 
61
  output_file = gr.File(label="Download Filtered CSV")
62
 
63
  # Bind the function to inputs and outputs using the button
64
+ load_button.click(fn=order_csv, inputs=[file_input, supplier_input, order_number_input], outputs=[output_df, output_file])
65
 
66
  # Run the interface
67
  demo.launch()