Alejandro Cremades commited on
Commit
642bcd2
β€’
1 Parent(s): 2c2aaef

Show real card names in both languages when checking a card list

Browse files
Files changed (1) hide show
  1. pages/1_Check_Card_List.py +16 -2
pages/1_Check_Card_List.py CHANGED
@@ -5,6 +5,16 @@ import streamlit_common.lib as lib
5
 
6
  mslist_path = "output/middleschool.csv"
7
 
 
 
 
 
 
 
 
 
 
 
8
  st.set_page_config(
9
  page_title="Middle School | Check Card List",
10
  page_icon="πŸƒ",
@@ -35,11 +45,15 @@ for line in input_list.split("\n"):
35
  cardnames.append(lib.remove_number_of_copies(cardname))
36
 
37
  input_cards = pd.DataFrame(cardnames, columns=["cardname"])
38
- input_cards["legal"] = input_cards["cardname"].apply(
39
  lib.is_cardname_legal, args=[mslist_df]
40
  )
 
 
 
 
41
 
42
  col2.write("##### Middle School legality")
43
- col2.dataframe(input_cards[["legal", "cardname"]], use_container_width=True)
44
 
45
  streamlit_common.footer.write_footer()
 
5
 
6
  mslist_path = "output/middleschool.csv"
7
 
8
+
9
+ def split_names_list(row: pd.DataFrame):
10
+ if not isinstance(row["legalnames"], list):
11
+ return row
12
+ row["English"] = row["legalnames"][0]
13
+ if row["legalnames"][1] is not None:
14
+ row["ζ—₯本θͺž"] = row["legalnames"][1]
15
+ return row
16
+
17
+
18
  st.set_page_config(
19
  page_title="Middle School | Check Card List",
20
  page_icon="πŸƒ",
 
45
  cardnames.append(lib.remove_number_of_copies(cardname))
46
 
47
  input_cards = pd.DataFrame(cardnames, columns=["cardname"])
48
+ input_cards["Legal"] = input_cards["cardname"].apply(
49
  lib.is_cardname_legal, args=[mslist_df]
50
  )
51
+ input_cards["legalnames"] = input_cards["cardname"].apply(
52
+ lib.get_legal_cardnames, args=[mslist_df]
53
+ )
54
+ input_cards = input_cards.apply(split_names_list, axis=1)
55
 
56
  col2.write("##### Middle School legality")
57
+ col2.dataframe(input_cards[["Legal", "English", "ζ—₯本θͺž"]], use_container_width=True)
58
 
59
  streamlit_common.footer.write_footer()