Py.Cafe

jharrington907/

project-hours-tracking

Project Hours Tracking

DocsPricing
  • TestEst
  • 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
import streamlit as st
import numpy as np
import pandas as pd


print("\x1b[1;92mStreamlit script running...\x1b[0m")

import streamlit as st
import pandas as pd

# Set page configuration
st.set_page_config(page_title="Project Hours Tracker", layout="wide")

# Sidebar - Project selection
st.sidebar.title("Project Selection")
project_name = st.sidebar.selectbox("Choose a project:", ["TSMC AP1", "TSMC AP1 South Complex Gas Yard"])

# Main title
st.title("Project Hours Tracking Application")

# Section: Hour Input
st.header("Enter Estimated Hours")

roles = ["LEA", "LEI"]
disciplines = [
     "Process & Systems Engineering - A1BP",
    "Process & Environmental Safety - A1CS",
    "Control Systems - A1CF",
    "Fill Zone - A1FZ",
    "Instrumentation - A1BJ",
    "Electrical Engineering - A1EE",
    "Engineering Management - A1AE",
    "Information Management - A1AD",
    "Rotating Equipment - A1DM",
    "Static Equipment -A1DB",
    "Engineering & Application Management - A1KA",
    "Plant Layout & Piping Design - A1KL",
    "Piping Materials & Pipe Stress Analysis - A1KR",
    "Civil, Steel Structures & Buildings - A1KC",
    "Quality Assurance/Quality Control - A1DT",
    "Control Systems - F1CF",
    "Electrical Engineering - F1EE",
    "Engineering Management - F1AE",
    "Fill zone - F1FZ",
    "Instrumentation - F1BJ",
    "Plant Components - F1DM",
    "Plant Design - F1KL",
    "Process & Systems Engineering - F1BP"
]

# Create a dataframe to store hours
hours_data = []

for discipline in disciplines:
    row = {"Discipline": discipline}
    for role in roles:
        row[role] = st.number_input(f"{discipline} - {role}", min_value=0, step=1, key=f"{discipline}_{role}")
    row["Total"] = row["LEA"] + row["LEI"]
    hours_data.append(row)

hours_df = pd.DataFrame(hours_data)

# Display hours table
st.subheader("Hours Summary")
st.dataframe(hours_df)

# Section: Third-Party Costs
st.header("Enter Third-Party Support Costs (USD)")

third_party_items = [
    "3rd Party Plant Design",
    "Tie-in laser scan",
    "Geotech (settlement analysis & recommendations)",
    "Permitting",
    "PE Mechanical Completion assessment site visits",
    "QA / QC Support",
    "China 3rd Party Support - CDA Buffer Vessels",
    "China 3rd Party Support - Vacuum Insulated Tanks",
    "China 3rd Party Support - FADV",
    "Local 3rd Party Support - ENC Purifier Onsite QA/QC (2 trips/purifier)",
    "APAC Region Support - ENC High Pressure Buffer QA/QC (4 trips)",
    "APAC Region Support - ENC UHP LOX TM QA/QC (1 trip)",
    "APAC Region Support - ENC NIC Testing + Final (2 trips)",
    "EMEA Region Support",
    "PE Mechanical Completion assessment site visits"
]

third_party_costs = {}
for item in third_party_items:
    cost = st.number_input(f"{item}", min_value=0.0, step=100.0, format="%.2f", key=item)
    third_party_costs[item] = cost

# Display third-party costs
st.subheader("Third-Party Costs Summary")
costs_df = pd.DataFrame(list(third_party_costs.items()), columns=["Item", "Cost (USD)"])
st.dataframe(costs_df)

# Totals
total_hours = hours_df["Total"].sum()
total_costs = costs_df["Cost (USD)"].sum()

st.markdown("---")
st.metric("Total Estimated Hours", total_hours)
st.metric("Total Third-Party Costs (USD)", f"${total_costs:,.2f}")