From 5a70c59cca41e1f638b91e40079ced141f61129c Mon Sep 17 00:00:00 2001 From: Zachary Blackwood Date: Thu, 14 Jul 2022 11:10:13 -0400 Subject: [PATCH] Switch to streamlit 1.10.0 and multi-page app without custom page switcher --- .gitignore | 2 + pages/about.py => about.py | 33 +++-- app.py | 46 ------- pages/__init__.py | 0 pages/edu.py | 52 ++++---- pages/projects.py | 29 ++--- pages/recommendations.py | 55 ++++---- pages/skills.py | 26 ++-- requirements.txt | 2 +- resources/__init__.py | 0 resources/__pycache__/__init__.cpython-37.pyc | Bin 173 -> 0 bytes resources/__pycache__/ast.cpython-37.pyc | Bin 4822 -> 0 bytes resources/ast.py | 118 ------------------ sidebar.py | 19 +++ 14 files changed, 105 insertions(+), 277 deletions(-) create mode 100644 .gitignore rename pages/about.py => about.py (71%) delete mode 100644 app.py delete mode 100644 pages/__init__.py delete mode 100644 resources/__init__.py delete mode 100644 resources/__pycache__/__init__.cpython-37.pyc delete mode 100644 resources/__pycache__/ast.cpython-37.pyc delete mode 100644 resources/ast.py create mode 100644 sidebar.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..09bf5d6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.pyc +__pycache__/ \ No newline at end of file diff --git a/pages/about.py b/about.py similarity index 71% rename from pages/about.py rename to about.py index dc3dc35..7326783 100644 --- a/pages/about.py +++ b/about.py @@ -1,34 +1,31 @@ -"""About page shown when the user enters the application""" +### Main page for streamlit resume import streamlit as st -def write(): - """Used to write the about page in the app.py file""" - st.title("Un Esprit Curieux - A curious mind! :sleuth_or_spy:") - st.markdown( - """## Who Am I? +from sidebar import add_sidebar + +add_sidebar() + +st.title("Un Esprit Curieux - A curious mind! :sleuth_or_spy:") + +""" +## Who Am I? "_I am a Random Forest in the World of Overfitting_" -A Data Scientist with 5 years of experience in solving Business Problems, -a constant learner and a firm believer of experimentation over expertise. +A Data Scientist with 5 years of experience in solving Business Problems, +a constant learner and a firm believer of experimentation over expertise. Always on the lookout for new technologies, I am passionate about designing Data driven solutions which are easy, economical and can be scaled. - + **Abhishek Gupta**\n **Data Science | Business Analytics | Project Management ** [**LinkedIn**](https://www.linkedin.com/in/abhishek-gupta-/) | [**Email**](mailto:abhishek.2.gupta@uconn.edu) ## The Project -I came across **Streamlit** last week while looking for solution to host python apps on AWS EC2. -The Framework boasts of being the easiest and the fastest way of creating interactive apps, and after spending just a -few hours creating this interactive resume, I can vouch for that. +I came across **Streamlit** last week while looking for solution to host python apps on AWS EC2. +The Framework boasts of being the easiest and the fastest way of creating interactive apps, and after spending just a +few hours creating this interactive resume, I can vouch for that. Check out my [**GitHub**]() for the implementation. Reach out to me for any project or a simple discussion on Streamlit. Also check out their [**page**](https://www.streamlit.io/) for more more information and updates. Also check out this amazing implementation of Streamlit by [**Marc Skov Madsen**](http://awesome-streamlit.org/) for streamlit inspiration. - - """, - unsafe_allow_html=True, - ) -if __name__ == "__main__": - main() diff --git a/app.py b/app.py deleted file mode 100644 index 9415355..0000000 --- a/app.py +++ /dev/null @@ -1,46 +0,0 @@ -### Main page for streamlit resume -import streamlit as st -import pages.about -import pages.skills -import pages.projects -import pages.edu -import pages.recommendations - -import resources.ast as ast - -PAGES = { - "About": pages.about, - "Education" : pages.edu, - "Skills": pages.skills, - "Projects": pages.projects, - "Recommendations": pages.recommendations -} - -def main(): - """Main function of App""" - st.sidebar.title("Navigation") - selection = st.sidebar.radio("Go to", list(PAGES.keys())) - - page = PAGES[selection] - - with st.spinner(f"Loading {selection} ..."): - ast.write_page(page) - - st.sidebar.title("Hire Me") - st.sidebar.info( - """ - If you are looking to hire a Data Scientist, - [email me](mailto:abhishek.2.gupta@uconn.edu) or reach out - to me on [LinkedIn](https://www.linkedin.com/in/abhishek-gupta-/) -""") - st.sidebar.title("Additional Info") - st.sidebar.info( - "This an interactive streamlit app completely created with Python's latest library **streamlit** " - "Do reach out to me on [LinkedIn](https://www.linkedin.com/in/abhishek-gupta-/) or " - "at [Mail me](mailto:abhishek.2.gupta@uconn.edu) to know more. " - "Also check the [source code](https://github.com/alphadatagamma/Streamlit-Resume-App) here. " - -) - -if __name__ == "__main__": - main() diff --git a/pages/__init__.py b/pages/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/pages/edu.py b/pages/edu.py index 04ae046..5a1672e 100644 --- a/pages/edu.py +++ b/pages/edu.py @@ -1,25 +1,24 @@ """Edu page shown when the user enters the application""" import streamlit as st +from sidebar import add_sidebar -def write(): - """Used to write the page in the app.py file""" - st.title("Education :books:") - st.markdown( - """### University of Connecticut School of Business +add_sidebar() +""" +### University of Connecticut School of Business **Master of Science in Business Analytics and Project Management | May 2020** | [**UConn**](https://www.business.uconn.edu/)\n -GPA 4.00/4.00 | Beta Gamma Sigma Honoree +GPA 4.00/4.00 | Beta Gamma Sigma Honoree -**Courses ** \n -- Statistics in Business Analytics \n -- Big Data Analytics with Hadoop \n -- Business Decision Modelling \n -- Predictive Analytics \n -- Data Mining and Business Analytics \n -- Introduction to Project Management \n -- Advanced Business Analytics and Project Management \n -- Adaptive Business Intelligence \n -- Project Risk and Cost Management \n -- Project Leadership and Communication \n +**Courses** +- Statistics in Business Analytics +- Big Data Analytics with Hadoop +- Business Decision Modelling +- Predictive Analytics +- Data Mining and Business Analytics +- Introduction to Project Management +- Advanced Business Analytics and Project Management +- Adaptive Business Intelligence +- Project Risk and Cost Management +- Project Leadership and Communication ### Distance Learning @@ -35,17 +34,12 @@ def write(): ### Manipal Institute of Technology **Bachelors of Technology in Mechanical Engineering | May 2015** | [**MIT**](https://manipal.edu/mit.html)\n -GPA 8.54/10.00 +GPA 8.54/10.00 -**Courses **\n -- Essentials of management\n -- Engineering Economics and Management \n -- Object Oriented Programming \n -- Business Communications \n +**Courses** +- Essentials of management +- Engineering Economics and Management +- Object Oriented Programming +- Business Communications - Operational Research - -""", - unsafe_allow_html=True, - ) -if __name__ == "__main__": - main() +""" diff --git a/pages/projects.py b/pages/projects.py index 046f76e..f735b3d 100644 --- a/pages/projects.py +++ b/pages/projects.py @@ -1,17 +1,17 @@ """Projects page shown when the user enters the application""" import streamlit as st +from sidebar import add_sidebar + +add_sidebar() + +""" +### Graduate Consultant, LIMRA | Aug 2019 – Dec 2019 -def write(): - """Used to write the page in the app.py file""" - st.title("Projects - :male-construction-worker: ") - st.markdown( - """### Graduate Consultant, LIMRA | Aug 2019 – Dec 2019 - **Life insurance Policy Lapse Study [AWS Sagemaker, S3, Python, MS Project]** - Performed exploratory data analysis on 9.6 million records of aggregated data about “premium persistency” and analyzed the frequency and causes of lapses using Tableau -- Built XGBoost classification model with 83% precision, 76% recall using AWS Sagemaker to predict customer churn +- Built XGBoost classification model with 83% precision, 76% recall using AWS Sagemaker to predict customer churn + - ### Decision Scientist, Mu Sigma Inc.| July 2015 - Dec 2020 **Web Application for a Major US Retailer [SQL- Teradata, HANA, HIVE, Agile-JIRA]** - Managed agile teams working on development of a web-based Business Intelligence dashboard to rate ~51k vendors based on key performance indicators like OTIF and In-stock Metrics @@ -30,20 +30,13 @@ def write(): ### Academic Projects [(GitHub)](https://github.com/alphadatagamma) **The Cricket Project [BeautifulSoup, Regex, AWS Sagemaker, S3, Redshift, Tableau]** -- Used BeautifulSoup and Regex to scrape cricket data for 10 countries and ~6000 players using AWS Sagemaker and EC2 +- Used BeautifulSoup and Regex to scrape cricket data for 10 countries and ~6000 players using AWS Sagemaker and EC2 - Created a data warehouse in AWS Redshift, and a tableau dashboard to visualize key trends **Advance House Price Prediction in Python [Kaggle Top 2%, Stacked Regression]** - Created a custom stacked regression model to predict sale price for 1500 houses and achieved a low RMSE of 0.11 for the final model and a top 2% rank on the leaderboard **IBM Attrition Analysis and Prediction [Python, Tableau, Decision Trees]** -- Performed exploratory data analysis and external research to identify the mix of drivers affecting employee attrition rates +- Performed exploratory data analysis and external research to identify the mix of drivers affecting employee attrition rates - Created a classification model using Decision trees and Gradient Boosting to identify employees that are likely to leave, so that the company can have a strategy for employee engagement - - - -""", - unsafe_allow_html=True, - ) -if __name__ == "__main__": - main() +""" diff --git a/pages/recommendations.py b/pages/recommendations.py index f0d1d94..404ed4c 100644 --- a/pages/recommendations.py +++ b/pages/recommendations.py @@ -1,45 +1,38 @@ """Recommendations page shown when the user enters the application""" import streamlit as st +from sidebar import add_sidebar -def write(): - """Used to write the page in the app.py file""" - st.title("Recommendations :memo:") - st.markdown( - """### Anantha Krishna Rajpurohit +add_sidebar() + + +st.title("Recommendations :memo:") +""" +### Anantha Krishna Rajpurohit **Senior Analyst | Boston Consulting Group(BCG) | April 5, 2020** | [**LinkedIn**](https://www.linkedin.com/in/anantha-krishna-rajpurohit/)\n -Abhishek joined as a fresher into the team. He brings in a lot of energy into the team and gives his -100%. He was reliable to finish the job at hand and actively reach out for help from peers and managers. -Always looked to up-skill on a regular basis and actively looked for new skills in the analytics space. -Since then he grew over three years at Mu Sigma to be able to move on the bigger responsibilities, -mentoring juniors, managing modules and delivering high quality results. With his recent addition of MS -in business analytics, I recommend him for any position that require depth in analytics, +Abhishek joined as a fresher into the team. He brings in a lot of energy into the team and gives his +100%. He was reliable to finish the job at hand and actively reach out for help from peers and managers. +Always looked to up-skill on a regular basis and actively looked for new skills in the analytics space. +Since then he grew over three years at Mu Sigma to be able to move on the bigger responsibilities, +mentoring juniors, managing modules and delivering high quality results. With his recent addition of MS +in business analytics, I recommend him for any position that require depth in analytics, reliability and project management skills - + ### Abhinav Dasgupta **Deputy Director | Myntra Jabong | April 5, 2020** | [**LinkedIn**](https://www.linkedin.com/in/abhinav-dasgupta-a0670422/) \n -Abhishek was part of the team working with a leading manufacturing giant which I was leading. -Abhishek brought a great sense of maturity and work ethic coupled with excellent analytical skills -to the team and ensured we constantly created a good experience for the client stakeholders. -We solved some of the most complex problems for the business and he was pivotal in making it happen. -In addition, he has a continuous zeal to learn and improve himself, which was also reflected in his -decision to pursue masters in the area of analytics. I really enjoyed working with Abhishek +Abhishek was part of the team working with a leading manufacturing giant which I was leading. +Abhishek brought a great sense of maturity and work ethic coupled with excellent analytical skills +to the team and ensured we constantly created a good experience for the client stakeholders. +We solved some of the most complex problems for the business and he was pivotal in making it happen. +In addition, he has a continuous zeal to learn and improve himself, which was also reflected in his +decision to pursue masters in the area of analytics. I really enjoyed working with Abhishek during his time at Mu Sigma and think he will be a top asset to any team that he will be part of. ### Tara Chamberlain **Senior Operations Manager| AT&T | February 5, 2020** | [**LinkedIn**](https://www.linkedin.com/in/tara-chamberlain-832b991a/) \n -Abhishek was a member of my Capstone team at UCONN and proved to be an invaluable asset. He was not +Abhishek was a member of my Capstone team at UCONN and proved to be an invaluable asset. He was not only adept at all data cleaning, modeling, and visualization methods that our team utilized, but - also took the lead in our research. He ended up uncovering key information that no one, not even our - professor or sponsors, was aware of. The team that I run at my current company doesn't + also took the lead in our research. He ended up uncovering key information that no one, not even our + professor or sponsors, was aware of. The team that I run at my current company doesn't have any openings, but it we did, I would be happy to have him join our organization. - - - - -""", - unsafe_allow_html=True, - ) -if __name__ == "__main__": - main() - +""" diff --git a/pages/skills.py b/pages/skills.py index d9fac9e..d67212a 100644 --- a/pages/skills.py +++ b/pages/skills.py @@ -1,14 +1,15 @@ """Skills page shown when the user enters the application""" import streamlit as st +from sidebar import add_sidebar -def write(): - """Used to write the page in the app.py file""" - st.title("Skills :hammer_and_wrench:") - st.markdown( - """## Languages +add_sidebar() + +st.title("Skills :hammer_and_wrench:") +""" +## Languages - R - Python -- SQL +- SQL - VBA ## Platforms and Libraries @@ -16,7 +17,7 @@ def write(): - **MS Office** - Excel, Powerpoint, Project, Word - **Python** - Pandas, Numpy, Skicit Learn,Scipy, NLTK, Tensorflow, Keras, Streamlit, Dash, Plotly, Matplotlib, Seaborn, etc. - **R** - Shiny, Dplyr -- **SQL** - MS SQL, PostgreSQL,HIVE, HANA, Teradata +- **SQL** - MS SQL, PostgreSQL,HIVE, HANA, Teradata - Tableau - PowerBI - Qlik View @@ -40,14 +41,7 @@ def write(): - Lex, Polly - Cloudfront - IAM - - -_I am a Random Forest in the World of Overfitting_ - -""", - unsafe_allow_html=True, - ) -if __name__ == "__main__": - main() +_I am a Random Forest in the World of Overfitting_ +""" diff --git a/requirements.txt b/requirements.txt index 4989ea8..68fd49d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -streamlit>=0.53.0 \ No newline at end of file +streamlit>=1.10.0 \ No newline at end of file diff --git a/resources/__init__.py b/resources/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/resources/__pycache__/__init__.cpython-37.pyc b/resources/__pycache__/__init__.cpython-37.pyc deleted file mode 100644 index 1a455932eb636cb53e5c744bc8f28aecf81d5a88..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 173 zcmZ?b<>g`kf@h{m@gVv!h=2h`Aj1KOi&=m~3PUi1CZpdI zlbDo|86V@4TAW>yUl8M-S)$;VUy_=XpPyYEsU|_Q;kd zwOlt}%bN*&p*A5h+mqbJc!FoYwy>Y$`G-briWm3<-qZYNVunwBWAbS}^DtXGDP~%x zm=SrAyI_ou{Ny(_pXH|jGm8_aapDX=`_QhP!s;AW=lM%mo#wBIGyDS9FY})Q_AIyV z8l_hUf8Gqby}%cKs8}nIEbIuju_si}73^*(h12!ikZtsO%<(x3@L94*3D$I!P?Oh! zo@hm$*Jlp%f{+C*ji7mqlkK^l#~Ol3(G7M5XHMI3edZ_)s74f=p37Xt#OI;#x!~VH zy2h=N6=yd5er(@xRXDhCan4cA(CvznVr6!5t}B#s+E@WD2j;s@7-v1PE4-#j=kc@f zkTN&%s7Dw=<1tiqWSYs$IxvnPe7&1FFhXlPvy-Ep{>!2LID24h=QOPSI1fmi`q=Q_ zw~er{Gb#UI8i&{!6!mF)3=_^BWBQm>n>#drZ+>F@*6^)Qu!iXKgWuf|Uf}Rl5|i@Ns45!kW~;(FVc1iv)oR-fJ5i$o zZC6K%9GkgHMM6~NR@p^0IJa0~*L|k?s*)1W+cTFd>|^PMuHR0; zmRsucRwG#%ttzW@0ZUv!e1i_Bl zx+Y|>6K#!rrhG>zsI3gw*^=<5NHzs9sIb!O$20YWbj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{iP6~J5q(w4$yf3H z8Fp)h)MD$k$q`khsid^!9GxN=$r6S&JWBUXr%t1OK^(O7KGbYC0^T3ppDGx-|0W$E zvq?&Fop-HoGgM^r3<8!t_!p`!DoZLl*Xv4^iVy9Sp&NRLPH0*#J>RbE6T!nv+FZ-5 z=S4|9g)NZ?UOlGWpzv;;4-JM|fCi)TK4~ZO$poA2u z%_zx{rhE&EOKfiBD)F>dNs*qpv|rvD>Cv7Re`RSzZwS z31n0zZKTkw86e}hJ`NI&B&`jyQP?W43`*;67u!_8a3^$D-7b~X0DJTEuD8}eH@tlL zt&6Hyr4mD4z-4Zga&a#C5KlCgFQbMDxQKJZHy5-X6KY0Qa4gOMHnyoOc~-s?NzDtQ zO#mhZNA|o~Fy#`~S0Ua>*RLy7qz$N({EU9|CP{05qeyUI$XO~L5;@-`scVTtp4Q;6 z*L}1)_-BB_I)QWtBodEFbfl8a>1uVoBd?%AVAt;5ypg1jA4p2a{4h9W;OQ)Ry~XZH zqvbM9>vdVBeF}1t$~8%?M4Usag~>?D zQj!FXFg=VMY2<|!xXsPLZ@KN*zJBZKZQax9W(6J*N?kDOXsP`~tCON;;Aw`&ZgK2v lh4rMHx", - unsafe_allow_html=True, - ) - - -def multiselect( - label: str, options: List[Any], default: List[Any], format_func=str -) -> List[Any]: - """multiselect extension that enables default to be a subset list of the list of objects - - not a list of strings. - Assumes that options have unique format_func representations - cf. https://github.com/streamlit/streamlit/issues/352 - Arguments: - label {str} -- A label to display above the multiselect - options {List[Any]} -- A list of objects - default {List[Any]} -- A list of objects to be selected by default - Keyword Arguments: - format_func {[type]} -- [description] (default: {str}) - Returns: - [type] -- [description] - """ - - options_ = {format_func(option): option for option in options} - default_ = [format_func(option) for option in default] - selections = st.multiselect( - label, options=list(options_.keys()), default=default_, format_func=format_func - ) - return [options_[format_func(selection)] for selection in selections] - - -def title_awesome(body: str): - """Uses st.write to write the title as f'Awesome Streamlit {body}' - - plus the awesome badge - - plus a link to the awesome-streamlit GitHub page - Arguments: - body {str} -- [description] - """ - st.write( - f"# Awesome Streamlit {body} " - "[![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/" - "d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)]" - "(https://github.com/MarcSkovMadsen/awesome-streamlit)" - ) - - -def write_svg(svg: str): - """Renders the given svg string. - Arguments: - svg {str} -- A string containing svgs - """ - b64 = base64.b64encode(svg.encode("utf-8")).decode("utf-8") - html = r'' % b64 - st.write(html, unsafe_allow_html=True) - - -def horizontal_ruler(in_sidebar: bool = False): - """Inserts a horizontal ruler (like
in HTML) - Keyword Arguments: - in_sidebar {bool} -- If True the ruler is inserted in the sidebar (default: {False}) - """ - if in_sidebar: - return st.sidebar.markdown("---") - - return st.markdown("---") - diff --git a/sidebar.py b/sidebar.py new file mode 100644 index 0000000..30874f1 --- /dev/null +++ b/sidebar.py @@ -0,0 +1,19 @@ +import streamlit as st + + +def add_sidebar(): + st.sidebar.title("Hire Me") + st.sidebar.info( + """ + If you are looking to hire a Data Scientist, + [email me](mailto:abhishek.2.gupta@uconn.edu) or reach out + to me on [LinkedIn](https://www.linkedin.com/in/abhishek-gupta-/) + """) + st.sidebar.title("Additional Info") + st.sidebar.info( + "This an interactive streamlit app completely created with Python's latest library **streamlit** " + "Do reach out to me on [LinkedIn](https://www.linkedin.com/in/abhishek-gupta-/) or " + "at [Mail me](mailto:abhishek.2.gupta@uconn.edu) to know more. " + "Also check the [source code](https://github.com/alphadatagamma/Streamlit-Resume-App) here. " + + )