Spaces:
Sleeping
Sleeping
Commit ·
c88a648
1
Parent(s): 7371f5f
Add button demo tab and Excel check utility
Browse filesAdd tab8.py with interactive button demo feature
Update app.py to integrate new tab8
Add check_excel.py for Excel file validation
- app.py +8 -4
- check_excel.py +28 -0
- tab8.py +8 -0
app.py
CHANGED
|
@@ -6,6 +6,7 @@ from tab4 import pdf_generator_tool
|
|
| 6 |
from tab5 import brand_renamer_tool
|
| 7 |
from tab6 import resize_with_transparent_canvas_tool
|
| 8 |
from tab7 import center_on_canvas_tool
|
|
|
|
| 9 |
|
| 10 |
# Configure Streamlit page
|
| 11 |
st.set_page_config(
|
|
@@ -18,14 +19,15 @@ st.set_page_config(
|
|
| 18 |
def main():
|
| 19 |
st.title("🔧 Brand Assets Tools")
|
| 20 |
|
| 21 |
-
tab1, tab2, tab3, tab4, tab5, tab6, tab7 = st.tabs([
|
| 22 |
-
"Extract Images from Excel",
|
| 23 |
"Name assets by brand",
|
| 24 |
"Canvas white to Transparent",
|
| 25 |
-
"Asset Overview",
|
| 26 |
"Name stims by block + create output files",
|
| 27 |
"Resize",
|
| 28 |
-
"Place on Canvas"
|
|
|
|
| 29 |
|
| 30 |
])
|
| 31 |
|
|
@@ -43,6 +45,8 @@ def main():
|
|
| 43 |
resize_with_transparent_canvas_tool()
|
| 44 |
with tab7:
|
| 45 |
center_on_canvas_tool()
|
|
|
|
|
|
|
| 46 |
|
| 47 |
if __name__ == "__main__":
|
| 48 |
main()
|
|
|
|
| 6 |
from tab5 import brand_renamer_tool
|
| 7 |
from tab6 import resize_with_transparent_canvas_tool
|
| 8 |
from tab7 import center_on_canvas_tool
|
| 9 |
+
from tab8 import render as tab8_render
|
| 10 |
|
| 11 |
# Configure Streamlit page
|
| 12 |
st.set_page_config(
|
|
|
|
| 19 |
def main():
|
| 20 |
st.title("🔧 Brand Assets Tools")
|
| 21 |
|
| 22 |
+
tab1, tab2, tab3, tab4, tab5, tab6, tab7, tab8 = st.tabs([
|
| 23 |
+
"Extract Images from Excel",
|
| 24 |
"Name assets by brand",
|
| 25 |
"Canvas white to Transparent",
|
| 26 |
+
"Asset Overview",
|
| 27 |
"Name stims by block + create output files",
|
| 28 |
"Resize",
|
| 29 |
+
"Place on Canvas",
|
| 30 |
+
"Button Demo"
|
| 31 |
|
| 32 |
])
|
| 33 |
|
|
|
|
| 45 |
resize_with_transparent_canvas_tool()
|
| 46 |
with tab7:
|
| 47 |
center_on_canvas_tool()
|
| 48 |
+
with tab8:
|
| 49 |
+
tab8_render()
|
| 50 |
|
| 51 |
if __name__ == "__main__":
|
| 52 |
main()
|
check_excel.py
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import openpyxl
|
| 2 |
+
|
| 3 |
+
wb = openpyxl.load_workbook(r'C:\Users\JulianeMatussek\Documents\IcAt\Fruchtzwerge\output\IcAt_Overview_Final.xlsx')
|
| 4 |
+
ws_assets = wb['Assets']
|
| 5 |
+
ws_reordered = wb['Reordered']
|
| 6 |
+
|
| 7 |
+
print('=== ASSETS SHEET ===')
|
| 8 |
+
print('Row | factor | factorgroup | ID | Language | Yellow?')
|
| 9 |
+
for row in range(2, min(15, ws_assets.max_row + 1)):
|
| 10 |
+
factor = ws_assets.cell(row, 1).value
|
| 11 |
+
factorgroup = ws_assets.cell(row, 2).value
|
| 12 |
+
id_val = ws_assets.cell(row, 3).value
|
| 13 |
+
lang = ws_assets.cell(row, 4).value
|
| 14 |
+
fill = ws_assets.cell(row, 4).fill
|
| 15 |
+
is_yellow = 'FFFF00' in str(fill.start_color.rgb) if fill.start_color else False
|
| 16 |
+
print(f'{row} | {factor} | {factorgroup} | {id_val} | {lang} | {is_yellow}')
|
| 17 |
+
|
| 18 |
+
print('\n=== REORDERED SHEET ===')
|
| 19 |
+
print('Row | Group | factor | factorgroup | ID | Language | Yellow?')
|
| 20 |
+
for row in range(2, min(15, ws_reordered.max_row + 1)):
|
| 21 |
+
group = ws_reordered.cell(row, 1).value
|
| 22 |
+
factor = ws_reordered.cell(row, 2).value
|
| 23 |
+
factorgroup = ws_reordered.cell(row, 3).value
|
| 24 |
+
id_val = ws_reordered.cell(row, 4).value
|
| 25 |
+
lang = ws_reordered.cell(row, 5).value
|
| 26 |
+
fill = ws_reordered.cell(row, 5).fill
|
| 27 |
+
is_yellow = 'FFFF00' in str(fill.start_color.rgb) if fill.start_color else False
|
| 28 |
+
print(f'{row} | {group} | {factor} | {factorgroup} | {id_val} | {lang} | {is_yellow}')
|
tab8.py
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
|
| 3 |
+
def render():
|
| 4 |
+
st.title("Tab 8 - Button Demo")
|
| 5 |
+
|
| 6 |
+
# Create a button
|
| 7 |
+
if st.button("Click me"):
|
| 8 |
+
st.write("TEST")
|