Skip to content

Instantly share code, notes, and snippets.

@ereli
Last active February 15, 2022 11:51
Show Gist options
  • Save ereli/296d9e81e332458349ad759a5248cdfc to your computer and use it in GitHub Desktop.
Save ereli/296d9e81e332458349ad759a5248cdfc to your computer and use it in GitHub Desktop.
Contractor day-rate calculator
import streamlit as st
st.markdown("## Contractor day-rate calculator")
st.text("""This calculator is based on a blog post by Jonathan Sedar.
https://sedar.co/posts/on-contractor-day-rates/""")
currency = st.radio('currency',('$', '£', '€'))
salary = st.slider('Salary',min_value=35000, max_value=300000, value=90000, step=2500)
st.write("Desired yearly salary:", currency,salary)
days_off = st.slider('days off, including weekends, sick days and holidays',min_value=1, max_value=365, value=140, step=1)
work_days =365-days_off
st.write("Work days in a year:", work_days)
utilization = st.slider('predicted utilization',min_value=1, max_value=100, value=80, step=1)
st.write("Utilization: %", (utilization))
corp_tax_rate = st.slider('corp tax rate',min_value=1, max_value=100, value=20, step=1)
st.write("Corp tax rate: %", corp_tax_rate)
st.write("Your desired daily rate is",currency, (salary/work_days/(1-corp_tax_rate/100)/(utilization/100)))
web: streamlit run --server.enableCORS false --server.port $PORT calculator.py
streamlit==0.49.0
@ereli
Copy link
Author

ereli commented Oct 23, 2019

Run this script using streamlit

pip install streamlit
streamlit run calculator.py

Screen Shot 2019-10-23 at 18 45 00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment