diff --git a/NHANES_dash.py b/NHANES_dash.py index d0e0ed5..197d212 100644 --- a/NHANES_dash.py +++ b/NHANES_dash.py @@ -29,10 +29,10 @@ # clientid = config.reddit_reddit_clientid # clientsecret = config.reddit_clientsecret -username = st.secrets["reddit_username"] -password = st.secrets["reddit_password"] -clientid = st.secrets["reddit_clientid"] -clientsecret = st.secrets["reddit_clientsecret"] +# username = st.secrets["reddit_username"] +# password = st.secrets["reddit_password"] +# clientid = st.secrets["reddit_clientid"] +# clientsecret = st.secrets["reddit_clientsecret"] #################Twitter_AUTH########################## # API_Key = config.twitter_API_Key @@ -41,11 +41,11 @@ # Access_Token = config.twitter_Access_Token # Access_Token_Secret = config.twitter_Access_Token_Secret -API_Key = st.secrets["twitter_API_Key"] -API_Key_Secret = st.secrets["twitter_API_Key_Secret"] -Bearer_Token = st.secrets["twitter_Bearer_Token"] -Access_Token = st.secrets["twitter_Access_Token"] -Access_Token_Secret = st.secrets["twitter_Access_Token_Secret"] +# API_Key = st.secrets["twitter_API_Key"] +# API_Key_Secret = st.secrets["twitter_API_Key_Secret"] +# Bearer_Token = st.secrets["twitter_Bearer_Token"] +# Access_Token = st.secrets["twitter_Access_Token"] +# Access_Token_Secret = st.secrets["twitter_Access_Token_Secret"] ###################Database_AUTH######################### # host= config.host @@ -54,29 +54,29 @@ # port = config.port # database = config.database -host= st.secrets["host"] -user= st.secrets["user"] -db_password= st.secrets["password"] -port = st.secrets["port"] -database = st.secrets["database"] +# host= st.secrets["host"] +# user= st.secrets["user"] +# db_password= st.secrets["password"] +# port = st.secrets["port"] +# database = st.secrets["database"] ################################################################################################################ -#Twitter API Authentication -consumerKey = API_Key -consumerSecret = API_Key_Secret -accessToken = Access_Token -accessTokenSecret = Access_Token_Secret -auth = tweepy.OAuthHandler(consumerKey, consumerSecret) -auth.set_access_token(accessToken, accessTokenSecret) -api = tweepy.API(auth,wait_on_rate_limit=True) - -#Reddit API Authentication -reddit = praw.Reddit(client_id=clientid, - client_secret=clientsecret, - password=password, - user_agent='Reddit search data extractor by /u/' + username + '', - username=username) +# #Twitter API Authentication +# consumerKey = API_Key +# consumerSecret = API_Key_Secret +# accessToken = Access_Token +# accessTokenSecret = Access_Token_Secret +# auth = tweepy.OAuthHandler(consumerKey, consumerSecret) +# auth.set_access_token(accessToken, accessTokenSecret) +# api = tweepy.API(auth,wait_on_rate_limit=True) + +# #Reddit API Authentication +# reddit = praw.Reddit(client_id=clientid, +# client_secret=clientsecret, +# password=password, +# user_agent='Reddit search data extractor by /u/' + username + '', +# username=username) ################################################################################################################ import pickle as pkle @@ -116,7 +116,7 @@ with col2: st.markdown("

NHANES, Health Disparities Data Visualization Tool

", unsafe_allow_html=True) st.markdown("

Transformative Research to Address Health Disparities and Advance Health Equity at Minority Serving Institutions

", unsafe_allow_html=True) - st.markdown("
", unsafe_allow_html=True) + st.markdown("
", unsafe_allow_html=True) with col3: st.write("") diff --git a/Rnext.p b/Rnext.p index 518737c..68bd359 100644 --- a/Rnext.p +++ b/Rnext.p @@ -1 +1 @@ -€K. \ No newline at end of file +€K. \ No newline at end of file diff --git a/commennext.p b/commennext.p index 9a0a2cb..e50b705 100644 Binary files a/commennext.p and b/commennext.p differ diff --git a/next.p b/next.p index e50b705..68bd359 100644 Binary files a/next.p and b/next.p differ diff --git a/test.py b/test.py new file mode 100644 index 0000000..cf8cb62 --- /dev/null +++ b/test.py @@ -0,0 +1,132 @@ + +from streamlit_option_menu import option_menu +import streamlit as st +import plotly.express as px +from plotly.subplots import make_subplots +import plotly.graph_objects as go + +import matplotlib.pyplot as plt +from wordcloud import WordCloud + +import json +from bs4 import BeautifulSoup +import pandas as pd +import datetime +import random +# Import date class from datetime module +from datetime import date + +import datetime +#import config + +import pickle as pkle +import os.path + +from streamlit_server_state import server_state, server_state_lock + +import requests +import streamlit.components.v1 as components + +from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer + + +st.set_page_config(page_title="YouTube_comment_Analysis_Dash_App", page_icon="", layout="wide") + + +with st.sidebar: + choose = option_menu("Dash Menu", ["About the Project", "Video Summery Stats", "Topic Search", "Sentiment Analysis", "WordCloud"], + icons=['','', '','', ''], + menu_icon="youtube", default_index=0, + styles={ + "container": {"padding": "5!important", "background-color": "#fafafa"}, + "icon": {"color": "black", "font-size": "25px"}, + "nav-link": {"font-size": "16px", "text-align": "left", "margin":"0px", "--hover-color": "#eee"}, + "nav-link-selected": {"background-color": "#636EFA"}, + } + ) + + +if choose == "About the Project": +#Add the cover image for the cover page. Used a little trick to center the image + col1, col2, col3 = st.columns((.1,1,.1)) + + with col1: + st.write("") + + with col2: + st.markdown("

YouTube Comment Analyser

", unsafe_allow_html=True) + st.markdown("

YouTube-comments-Analyzer is a tool to analyze audience sentiment, " + "perspective, topics, and engagement of YouTube video comments. It collects and preprocesses comments, performs " + "sentiment analysis and topic modeling, and visualizes findings through an interactive dashboard. Beneficial for " + "content creators, marketers, and researchers.

", unsafe_allow_html=True) + st.markdown("
", unsafe_allow_html=True) + + with col3: + st.write("") + + col1, col2 = st.columns( [0.8, 0.2]) + with col1: # To display the header text using css style + st.markdown("#### **About the Project:**") + + st.markdown(""" + + ##### **Abstract** + + + """) + + st.markdown("##### ***Project Contributors:***") + st.markdown("Kuzi Rusere") + + +elif choose == "Video Summery Stats": + col1, col2 = st.columns( [0.8, 0.2]) + with col1: # To display the header text using css style + st.markdown(""" """, unsafe_allow_html=True) + st.markdown('

Video Summery Stats

', unsafe_allow_html=True) + keywords = ["Sentiment-Analysis"] # this is going to be our keyword + + + + st.markdown("---") + ###################################################################### + + +#######################################################*******************************************************#################################################################### + +elif choose == "Topic Search": + #Add a file uploader to allow users to upload their project plan file + st.markdown(""" """, unsafe_allow_html=True) + st.markdown('

Topic Search

', unsafe_allow_html=True) + #creating a list of the survey cycles that we are going to be collecting the data + + + st.markdown("---") + ###################################################################### + +############################################################*******************************************######################################################## + +elif choose == "Sentiment Analysis": + st.markdown(""" """, unsafe_allow_html=True) + st.markdown('

Sentiment Analysis

', unsafe_allow_html=True) + + st.markdown("---") + ###################################################################### + +#######################################################*******************************************############################################################### + + +elif choose == "WordCloud": + st.markdown(""" """, unsafe_allow_html=True) + st.markdown('

WordCloud

', unsafe_allow_html=True) + + st.markdown("---") + ###################################################################### \ No newline at end of file