Skip to content

Commit

Permalink
update app
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie W committed Jul 10, 2017
1 parent b04ac79 commit 66e8f05
Show file tree
Hide file tree
Showing 9 changed files with 199,308 additions and 77 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
"source": [
"1. set up the main page for the dashboard on Heroku at http://jupyter-metrics.herokuapp.com/index\n",
"2. I've used the GitHub API to pull down data from the main Jupyter org\n",
"3. I've performed initial data exploration and topic modeling of all comments in all repos for that org"
"3. I've performed initial data exploration and topic modeling of all comments in all repos for that org\n",
"4. Currently working on the underlying visualization architecture"
]
},
{
Expand Down Expand Up @@ -132,7 +133,9 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
"collapsed": true,
"deletable": true,
"editable": true
},
"outputs": [],
"source": []
Expand Down
81 changes: 72 additions & 9 deletions Jupyter_Metrics_Final_Project_2_CleanExploreData.ipynb

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions Weekly_Final_Project_Update.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
"source": [
"1. set up the main page for the dashboard on Heroku at http://jupyter-metrics.herokuapp.com/index\n",
"2. I've used the GitHub API to pull down data from the main Jupyter org\n",
"3. I've performed initial data exploration and topic modeling of all comments in all repos for that org"
"3. I've performed initial data exploration and topic modeling of all comments in all repos for that org\n",
"4. Currently working on the underlying visualization architecture"
]
},
{
Expand Down Expand Up @@ -132,7 +133,9 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
"collapsed": true,
"deletable": true,
"editable": true
},
"outputs": [],
"source": []
Expand Down
44 changes: 30 additions & 14 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
from flask import Flask, render_template, request, redirect
from bokeh.plotting import figure
from bokeh.models.glyphs import HBar
from bokeh.embed import components
import requests
import os
import Quandl
import pandas as pd
import seaborn as sns

app = Flask(__name__)

Expand All @@ -12,25 +15,38 @@ def main():
return redirect('/index')

#Original GET request from ticker
@app.route('/index', methods = ["GET", "POST"])
@app.route('/index', methods = ["GET"])
def index():
if request.method =="GET":
return render_template('index.html')
elif request.method == "POST":
ticker = request.form["ticker"]
print "Ticker is:", ticker
#ticker = request.form["ticker"]
#print "Ticker is:", ticker

#data = Quandl.get("WIKI/%s" % ticker)
df = pd.read_csv('issue_comments.csv', sep=',')
#print "Got dataframe with", data.size, "elements"

df['org'] = df['org'].astype('str')
df['repo'] = df['repo'].astype('str')
df['comments'] = df['comments'].astype('str')
df['user'] = df['user'].astype('str')

counts_per_repo = df.groupby(['org', 'repo']).count()

plt.figure(figsize=(5,5))

sns.countplot(y='repo', data=df, color ='c').set_title('Count of Jupyter GitHub Comments per Repo')
plt.show()

data = Quandl.get("WIKI/%s" % ticker)
print "Got dataframe with", data.size, "elements"
plot = figure(
title='Jupyter GitHub Metrics',
x_axis_label='date',
x_axis_type='datetime')
print "Created plot"
plot.line(data.index, data['Close'])
print "plot.line"
title='Count of Jupyter GitHub Comments per Repo',
x_axis_label='count',
x_axis_type='repo')
# print "Created plot"
#plot.hbar(data.index, data['Close'])
plot = hbar(df, 'count', values='repo', title="Comments per Repo")
#print "plot.line"
script, div = components(plot)
return render_template('index.html', tickerout = request.form["ticker"], script=script, div=div)
return render_template('index.html', script=script, div=div)

#New get from GitHub API - comment out, do not run
# @app.route('/index', methods = ["GET", "POST"])
Expand Down
92,871 changes: 92,871 additions & 0 deletions issue_comments.csv

Large diffs are not rendered by default.

106,320 changes: 106,320 additions & 0 deletions issue_comments_jupyter_copy.csv

Large diffs are not rendered by default.

19 changes: 0 additions & 19 deletions static/style_lulu.css

This file was deleted.

9 changes: 5 additions & 4 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
<body>
<div>
<h1>Jupyter Metrics</h1>
{{ div | safe }}
{{ script | safe }}
</div>
<!--<form id="input" method="post" action="index">
<p>
Expand All @@ -24,13 +26,12 @@ <h1>Jupyter Metrics</h1>
<input type="submit" value="Submit">
</p>
</form>-->
<!--<div>
<!-- <div>
{% if tickerout %}
<h3>{{tickerout}}</h3>
{{ div | safe }}
{{ script | safe }}
{% endif %}
</div>-->
</div> -->

</body>
</html>
Expand Down
27 changes: 0 additions & 27 deletions templates/userinfo_lulu.html

This file was deleted.

0 comments on commit 66e8f05

Please sign in to comment.