Py.Cafe

martin.kusy/

stainless-steel-tube-selector

Stainless Steel Tube Selector

DocsPricing
  • app.py
  • requirements.txt
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
import streamlit as st

# --- Profile Types ---
profiles = {
    "πŸ”΅ Round Tube": "Round Tube",
    "πŸŸ₯ Square Tube": "Square Tube",
    "🟨 Rectangular Tube": "Rectangular Tube",
    "🟫 Flat Bar": "Flat Bar",
    "πŸ“ Angle Bar (L-profile)": "Angle Bar",
    "🧱 Channel Bar (U-profile)": "Channel Bar",
    "πŸ— I-Beam / H-Beam": "Beam",
    "πŸ“„ Sheet / Plate": "Sheet",
    "🧡 Wire / Rod": "Wire"
}

# --- Diameter and Wall Thickness Data (from EN ISO 1127) ---
diameter_data = {
    "Series 1": {
        10.2: [1.0, 1.2, 1.6, 2.0],
        13.5: [1.0, 1.2, 1.6, 2.0],
        17.2: [1.0, 1.2, 1.6, 2.0],
        21.3: [1.0, 1.2, 1.6, 2.0, 2.6],
        26.9: [1.0, 1.2, 1.6, 2.0, 2.6],
        33.7: [1.0, 1.2, 1.6, 2.0, 2.6, 3.2],
        42.4: [1.0, 1.2, 1.6, 2.0, 2.6, 3.2],
        48.3: [1.0, 1.2, 1.6, 2.0, 2.6, 3.2],
        60.3: [1.6, 2.0, 2.6, 3.2, 4.0],
        76.1: [2.0, 2.6, 3.2, 4.0],
        88.9: [2.0, 2.6, 3.2, 4.0],
        114.3: [2.0, 2.6, 3.2, 4.0],
        139.7: [2.0, 2.6, 3.2, 4.0],
        168.3: [2.0, 2.6, 3.2, 4.0],
        219.1: [2.6, 3.2, 4.0, 5.0],
        273.0: [3.2, 4.0, 5.0, 6.3],
        323.9: [4.0, 5.0, 6.3, 8.0],
        355.6: [4.0, 5.0, 6.3, 8.0],
        406.4: [4.0, 5.0, 6.3, 8.0],
        457.0: [5.0, 6.3, 8.0],
        508.0: [5.0, 6.3, 8.0],
        610.0: [6.3, 8.0],
        711.0: [6.3, 8.0],
        813.0: [6.3, 8.0],
        914.0: [6.3, 8.0],
        1016.0: [6.3, 8.0]
    },
    "Series 2": {
        6.0: [1.0],
        8.0: [1.0],
        10.0: [1.0, 1.2],
        12.0: [1.0, 1.2],
        12.7: [1.0, 1.2],
        16.0: [1.0, 1.2],
        19.0: [1.0, 1.2],
        20.0: [1.0, 1.2],
        25.0: [1.0, 1.2, 1.6],
        31.8: [1.0, 1.2, 1.6],
        32.0: [1.0, 1.2, 1.6],
        38.0: [1.0, 1.2, 1.6],
        40.0: [1.0, 1.2, 1.6],
        51.0: [1.0, 1.2, 1.6],
        57.0: [1.0, 1.2, 1.6],
        63.5: [1.0, 1.2, 1.6],
        70.0: [1.0, 1.2, 1.6],
        101.6: [1.6, 2.0]
    },
    "Series 3": {
        14.0: [1.0],
        18.0: [1.0],
        22.0: [1.0],
        25.4: [1.0, 1.2],
        30.0: [1.0, 1.2],
        35.0: [1.0, 1.2],
        44.5: [1.0, 1.2, 1.6],
        54.0: [1.0, 1.2, 1.6],
        82.5: [1.6, 2.0]
    }
}

# --- UI ---
st.title("πŸ”© Stainless Steel Profile Selector")

# Level 1: Profile Selection
profile = st.selectbox("Select Profile Type:", [""] + list(profiles.values()))

# Level 2: Standard Selection
if profile == "Round Tube":
    standard = st.selectbox("Select Tube Standard:", ["", "EN 10296-2", "EN 10216-5", "EN 10217-7"])

    # Level 3: Diameter Logic
    if standard:
        od_logic = st.selectbox("Select Outer Diameter Logic:", ["", "EN ISO 1127", "Free diameter"])

        # Level 4: Series Selection
        if od_logic == "EN ISO 1127":
            series = st.selectbox("Select Diameter Series:", ["", "Series 1", "Series 2", "Series 3"])

            # Level 5: Diameter Selection
            if series:
                diameters = list(diameter_data[series].keys())
                diameter = st.selectbox("Select Outer Diameter (mm):", [""] + diameters)

                # Level 6: Wall Thickness Selection
                if diameter:
                    thicknesses = diameter_data[series][diameter]
                    thickness = st.selectbox("Select Wall Thickness (mm):", [""] + thicknesses)

                    # Summary
                    st.markdown("### βœ… Selection Summary")
                    st.write(f"**Profile Type:** {profile}")
                    st.write(f"**Standard:** {standard}")
                    st.write(f"**Diameter Logic:** {od_logic}")
                    st.write(f"**Series:** {series}")
                    st.write(f"**Outer Diameter:** {diameter} mm")
                    st.write(f"**Wall Thickness:** {thickness} mm")