nguyenthanhasia commited on
Commit
96b6fe9
Β·
verified Β·
1 Parent(s): bb48128

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +75 -75
app.py CHANGED
@@ -16,19 +16,19 @@ def calculate_equity_dilution(pre_money_valuation, investment_amount, current_ow
16
  investor_ownership = (investment_amount / post_money_valuation) * 100
17
 
18
  return f"""
19
- πŸ’° **EQUITY DILUTION RESULTS**
20
 
21
- πŸ“Š **Pre-money Valuation:** ${pre_money_valuation:,.0f}
22
- πŸ’΅ **Investment Amount:** ${investment_amount:,.0f}
23
- πŸ“ˆ **Post-money Valuation:** ${post_money_valuation:,.0f}
24
 
25
- πŸ‘₯ **Ownership Changes:**
26
- β€’ **Your ownership before:** {current_ownership:.2f}%
27
- β€’ **Your ownership after:** {new_ownership:.2f}%
28
- β€’ **Dilution:** {dilution_percentage:.2f}%
29
- β€’ **Investor ownership:** {investor_ownership:.2f}%
30
 
31
- πŸ“ **Key Insights:**
32
  β€’ You retain {new_ownership:.1f}% of the company
33
  β€’ Investor gets {investor_ownership:.1f}% for ${investment_amount:,.0f}
34
  β€’ Your stake is diluted by {dilution_percentage:.1f} percentage points
@@ -43,14 +43,14 @@ def calculate_runway(current_cash, monthly_burn, monthly_revenue=0):
43
 
44
  if net_burn <= 0:
45
  return f"""
46
- πŸŽ‰ **CONGRATULATIONS! YOU'RE PROFITABLE**
47
 
48
- πŸ’° **Current Cash:** ${current_cash:,.0f}
49
- πŸ“ˆ **Monthly Revenue:** ${monthly_revenue:,.0f}
50
- πŸ’Έ **Monthly Burn:** ${monthly_burn:,.0f}
51
- πŸ’š **Net Cash Flow:** +${abs(net_burn):,.0f}/month
52
 
53
- πŸš€ **You're generating positive cash flow!**
54
  Your business is sustainable and growing.
55
  """
56
 
@@ -77,21 +77,21 @@ def calculate_runway(current_cash, monthly_burn, monthly_revenue=0):
77
  advice = "Strong position. Focus on growth and product development."
78
 
79
  return f"""
80
- ⏰ **RUNWAY CALCULATION**
81
 
82
- πŸ’° **Current Cash:** ${current_cash:,.0f}
83
- πŸ“ˆ **Monthly Revenue:** ${monthly_revenue:,.0f}
84
- πŸ’Έ **Monthly Burn:** ${monthly_burn:,.0f}
85
- πŸ“‰ **Net Burn:** ${net_burn:,.0f}/month
86
 
87
- 🎯 **Runway Results:**
88
- β€’ **Runway:** {runway_months:.1f} months ({runway_days:.0f} days)
89
- β€’ **Cash depletes on:** {cash_out_date.strftime('%B %d, %Y')}
90
- β€’ **Status:** {status}
91
 
92
- πŸ’‘ **Recommendation:** {advice}
93
 
94
- πŸ“Š **Burn Rate Optimization:**
95
  β€’ To extend runway to 12 months: Reduce burn to ${current_cash/12:,.0f}/month
96
  β€’ To extend runway to 18 months: Reduce burn to ${current_cash/18:,.0f}/month
97
  """
@@ -132,26 +132,26 @@ def calculate_berkus_valuation(idea_score, prototype_score, team_score, market_s
132
  risk_level = "πŸ”΄ VERY HIGH RISK"
133
  investment_advice = "Major concerns across multiple areas"
134
 
135
- breakdown = "\n".join([f"β€’ **{factor}:** {score}/5 β†’ ${score * max_per_factor:,.0f}"
136
  for factor, score in factors.items()])
137
 
138
  return f"""
139
- πŸ“Š **BERKUS METHOD VALUATION**
140
 
141
  {breakdown}
142
 
143
- πŸ’° **Total Valuation:** ${total_valuation:,.0f}
144
- πŸ“ˆ **Average Score:** {avg_score:.1f}/5
145
- ⚠️ **Risk Level:** {risk_level}
146
 
147
- πŸ’‘ **Investment Advice:** {investment_advice}
148
 
149
- πŸ“‹ **Valuation Breakdown:**
150
  β€’ Maximum possible: $2,500,000 (5/5 on all factors)
151
  β€’ Your valuation: ${total_valuation:,.0f} ({total_score}/25 points)
152
  β€’ Percentile: {(total_valuation/2500000)*100:.1f}% of maximum
153
 
154
- πŸ“ **Note:** Berkus Method is ideal for pre-revenue startups.
155
  Consider other methods (DCF, Market Multiple) for revenue-generating companies.
156
  """
157
 
@@ -189,29 +189,29 @@ def calculate_investment_returns(investment_amount, exit_valuation, ownership_pe
189
  grade = "C"
190
 
191
  return f"""
192
- πŸ’° **INVESTMENT RETURN ANALYSIS**
193
 
194
- πŸ“Š **Investment Details:**
195
- β€’ **Initial Investment:** ${investment_amount:,.0f}
196
- β€’ **Exit Valuation:** ${exit_valuation:,.0f}
197
- β€’ **Your Ownership:** {ownership_percentage:.2f}%
198
- β€’ **Time to Exit:** {years_to_exit} years
199
 
200
- 🎯 **Return Metrics:**
201
- β€’ **Exit Value:** ${exit_value:,.0f}
202
- β€’ **Total Return:** ${total_return:,.0f}
203
- β€’ **ROI:** {roi_percentage:.1f}%
204
- β€’ **Multiple:** {multiple:.1f}x
205
- β€’ **IRR:** {irr:.1f}% per year
206
 
207
- πŸ“ˆ **Performance:** {performance} (Grade: {grade})
208
 
209
- πŸ“Š **Benchmarks:**
210
  β€’ Top-tier VC target: 10x+ multiple, 25%+ IRR
211
  β€’ Good VC return: 3-10x multiple, 15-25% IRR
212
  β€’ Acceptable return: 2-3x multiple, 10-15% IRR
213
 
214
- πŸ’‘ **Analysis:**
215
  {"This exceeds top-tier VC expectations!" if multiple >= 10 else
216
  "Strong return meeting VC expectations." if multiple >= 3 else
217
  "Below typical VC return expectations." if multiple >= 2 else
@@ -249,31 +249,31 @@ def calculate_cap_table(founders_shares, employee_pool_percent, series_a_investm
249
  founders_dilution = 100 - founders_ownership - employee_ownership
250
 
251
  return f"""
252
- πŸ“Š **CAP TABLE ANALYSIS**
253
-
254
- 🏒 **Pre-Series A Structure:**
255
- β€’ **Founders:** {founders_shares:,.0f} shares
256
- β€’ **Employee Pool:** {employee_shares:,.0f} shares ({employee_pool_percent}%)
257
- β€’ **Total Pre-Series A:** {pre_series_a_shares:,.0f} shares
258
-
259
- πŸ’° **Series A Details:**
260
- β€’ **Investment:** ${series_a_investment:,.0f}
261
- β€’ **Pre-money Valuation:** ${series_a_pre_money:,.0f}
262
- β€’ **Post-money Valuation:** ${post_money_valuation:,.0f}
263
- β€’ **Price per Share:** ${series_a_price_per_share:.2f}
264
- β€’ **New Shares Issued:** {series_a_shares:,.0f}
265
-
266
- πŸ‘₯ **Post-Series A Ownership:**
267
- β€’ **Founders:** {founders_ownership:.1f}% ({founders_shares:,.0f} shares)
268
- β€’ **Employee Pool:** {employee_ownership:.1f}% ({employee_shares:,.0f} shares)
269
- β€’ **Series A Investors:** {investor_ownership:.1f}% ({series_a_shares:,.0f} shares)
270
- β€’ **Total Shares:** {total_shares:,.0f}
271
-
272
- πŸ“‰ **Dilution Impact:**
273
- β€’ **Founders diluted by:** {founders_dilution:.1f} percentage points
274
- β€’ **Founders retain:** {founders_ownership:.1f}% ownership
275
-
276
- πŸ’‘ **Key Insights:**
277
  β€’ Each founder share is now worth ${series_a_price_per_share:.2f}
278
  β€’ Total founder equity value: ${(founders_shares * series_a_price_per_share):,.0f}
279
  β€’ Employee pool value: ${(employee_shares * series_a_price_per_share):,.0f}
 
16
  investor_ownership = (investment_amount / post_money_valuation) * 100
17
 
18
  return f"""
19
+ πŸ’° EQUITY DILUTION RESULTS
20
 
21
+ πŸ“Š Pre-money Valuation: ${pre_money_valuation:,.0f}
22
+ πŸ’΅ Investment Amount: ${investment_amount:,.0f}
23
+ πŸ“ˆ Post-money Valuation: ${post_money_valuation:,.0f}
24
 
25
+ πŸ‘₯ Ownership Changes:
26
+ β€’ Your ownership before: {current_ownership:.2f}%
27
+ β€’ Your ownership after: {new_ownership:.2f}%
28
+ β€’ Dilution: {dilution_percentage:.2f}%
29
+ β€’ Investor ownership: {investor_ownership:.2f}%
30
 
31
+ πŸ“ Key Insights:
32
  β€’ You retain {new_ownership:.1f}% of the company
33
  β€’ Investor gets {investor_ownership:.1f}% for ${investment_amount:,.0f}
34
  β€’ Your stake is diluted by {dilution_percentage:.1f} percentage points
 
43
 
44
  if net_burn <= 0:
45
  return f"""
46
+ πŸŽ‰ CONGRATULATIONS! YOU'RE PROFITABLE
47
 
48
+ πŸ’° Current Cash: ${current_cash:,.0f}
49
+ πŸ“ˆ Monthly Revenue: ${monthly_revenue:,.0f}
50
+ πŸ’Έ Monthly Burn: ${monthly_burn:,.0f}
51
+ πŸ’š Net Cash Flow: +${abs(net_burn):,.0f}/month
52
 
53
+ πŸš€ You're generating positive cash flow!
54
  Your business is sustainable and growing.
55
  """
56
 
 
77
  advice = "Strong position. Focus on growth and product development."
78
 
79
  return f"""
80
+ ⏰ RUNWAY CALCULATION
81
 
82
+ πŸ’° Current Cash: ${current_cash:,.0f}
83
+ πŸ“ˆ Monthly Revenue: ${monthly_revenue:,.0f}
84
+ πŸ’Έ Monthly Burn: ${monthly_burn:,.0f}
85
+ πŸ“‰ Net Burn: ${net_burn:,.0f}/month
86
 
87
+ 🎯 Runway Results:
88
+ β€’ Runway: {runway_months:.1f} months ({runway_days:.0f} days)
89
+ β€’ Cash depletes on: {cash_out_date.strftime('%B %d, %Y')}
90
+ β€’ Status: {status}
91
 
92
+ πŸ’‘ Recommendation: {advice}
93
 
94
+ πŸ“Š Burn Rate Optimization:
95
  β€’ To extend runway to 12 months: Reduce burn to ${current_cash/12:,.0f}/month
96
  β€’ To extend runway to 18 months: Reduce burn to ${current_cash/18:,.0f}/month
97
  """
 
132
  risk_level = "πŸ”΄ VERY HIGH RISK"
133
  investment_advice = "Major concerns across multiple areas"
134
 
135
+ breakdown = "\n".join([f"β€’ {factor}: {score}/5 β†’ ${score * max_per_factor:,.0f}"
136
  for factor, score in factors.items()])
137
 
138
  return f"""
139
+ πŸ“Š BERKUS METHOD VALUATION
140
 
141
  {breakdown}
142
 
143
+ πŸ’° Total Valuation: ${total_valuation:,.0f}
144
+ πŸ“ˆ Average Score: {avg_score:.1f}/5
145
+ ⚠️ Risk Level: {risk_level}
146
 
147
+ πŸ’‘ Investment Advice: {investment_advice}
148
 
149
+ πŸ“‹ Valuation Breakdown:
150
  β€’ Maximum possible: $2,500,000 (5/5 on all factors)
151
  β€’ Your valuation: ${total_valuation:,.0f} ({total_score}/25 points)
152
  β€’ Percentile: {(total_valuation/2500000)*100:.1f}% of maximum
153
 
154
+ πŸ“ Note: Berkus Method is ideal for pre-revenue startups.
155
  Consider other methods (DCF, Market Multiple) for revenue-generating companies.
156
  """
157
 
 
189
  grade = "C"
190
 
191
  return f"""
192
+ πŸ’° INVESTMENT RETURN ANALYSIS
193
 
194
+ πŸ“Š Investment Details:
195
+ β€’ Initial Investment: ${investment_amount:,.0f}
196
+ β€’ Exit Valuation: ${exit_valuation:,.0f}
197
+ β€’ Your Ownership: {ownership_percentage:.2f}%
198
+ β€’ Time to Exit: {years_to_exit} years
199
 
200
+ 🎯 Return Metrics:
201
+ β€’ Exit Value: ${exit_value:,.0f}
202
+ β€’ Total Return: ${total_return:,.0f}
203
+ β€’ ROI: {roi_percentage:.1f}%
204
+ β€’ Multiple: {multiple:.1f}x
205
+ β€’ IRR: {irr:.1f}% per year
206
 
207
+ πŸ“ˆ Performance: {performance} (Grade: {grade})
208
 
209
+ πŸ“Š Benchmarks:
210
  β€’ Top-tier VC target: 10x+ multiple, 25%+ IRR
211
  β€’ Good VC return: 3-10x multiple, 15-25% IRR
212
  β€’ Acceptable return: 2-3x multiple, 10-15% IRR
213
 
214
+ πŸ’‘ Analysis:
215
  {"This exceeds top-tier VC expectations!" if multiple >= 10 else
216
  "Strong return meeting VC expectations." if multiple >= 3 else
217
  "Below typical VC return expectations." if multiple >= 2 else
 
249
  founders_dilution = 100 - founders_ownership - employee_ownership
250
 
251
  return f"""
252
+ πŸ“Š CAP TABLE ANALYSIS
253
+
254
+ 🏒 Pre-Series A Structure:
255
+ β€’ Founders: {founders_shares:,.0f} shares
256
+ β€’ Employee Pool: {employee_shares:,.0f} shares ({employee_pool_percent}%)
257
+ β€’ Total Pre-Series A: {pre_series_a_shares:,.0f} shares
258
+
259
+ πŸ’° Series A Details:
260
+ β€’ Investment: ${series_a_investment:,.0f}
261
+ β€’ Pre-money Valuation: ${series_a_pre_money:,.0f}
262
+ β€’ Post-money Valuation: ${post_money_valuation:,.0f}
263
+ β€’ Price per Share: ${series_a_price_per_share:.2f}
264
+ β€’ New Shares Issued: {series_a_shares:,.0f}
265
+
266
+ πŸ‘₯ Post-Series A Ownership:
267
+ β€’ Founders: {founders_ownership:.1f}% ({founders_shares:,.0f} shares)
268
+ β€’ Employee Pool: {employee_ownership:.1f}% ({employee_shares:,.0f} shares)
269
+ β€’ Series A Investors: {investor_ownership:.1f}% ({series_a_shares:,.0f} shares)
270
+ β€’ Total Shares: {total_shares:,.0f}
271
+
272
+ πŸ“‰ Dilution Impact:
273
+ β€’ Founders diluted by: {founders_dilution:.1f} percentage points
274
+ β€’ Founders retain: {founders_ownership:.1f}% ownership
275
+
276
+ πŸ’‘ Key Insights:
277
  β€’ Each founder share is now worth ${series_a_price_per_share:.2f}
278
  β€’ Total founder equity value: ${(founders_shares * series_a_price_per_share):,.0f}
279
  β€’ Employee pool value: ${(employee_shares * series_a_price_per_share):,.0f}