-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f453e45
commit bdc9146
Showing
7,885 changed files
with
1,423,345 additions
and
0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
FLASK_APP=main.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"python.pythonPath": "f:\\Python-SS\\venv\\Scripts\\python.exe", | ||
"workbench.colorCustomizations": { | ||
"activityBar.background": "#143410", | ||
"titleBar.activeBackground": "#1B4916", | ||
"titleBar.activeForeground": "#F6FCF5" | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from flask import Flask | ||
|
||
app = Flask(__name__) | ||
|
||
from app import routes |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Pos Team Matches Points Rating | ||
1 India 39 4659 119 | ||
2 New Zealand 26 2829 109 | ||
3 England 42 4366 104 | ||
4 South Africa 31 3177 102 | ||
5 Australia 33 3270 99 | ||
6 Sri Lanka 40 3795 95 | ||
7 Pakistan 27 2263 84 | ||
8 West Indies 32 2570 80 | ||
9 Bangladesh 23 1413 61 | ||
10 Afghanistan 3 165 55 | ||
11 Zimbabwe 9 140 16 | ||
12 Ireland 3 0 0 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from urllib import request | ||
from bs4 import BeautifulSoup | ||
import pandas as pd | ||
import re | ||
|
||
def getTestRanks(url): | ||
link = url | ||
html_page = request.urlopen(link); | ||
soup = BeautifulSoup(html_page,'lxml') | ||
table = soup.find_all('table',class_="StoryengineTable") | ||
data = table[0].get_text() | ||
#Rough cleaning to store as an excel file | ||
clean_data = re.sub('(\\n)',',',data) | ||
clean_data = re.sub('(,,,,|,,,|,,)',' \n ',clean_data) | ||
clean_data = re.sub(',',' \t ',clean_data) | ||
with open('TestRanks.xslx','w') as f: | ||
f.write(clean_data) | ||
print("Successfully got the data.") | ||
|
||
url = "http://www.espncricinfo.com/rankings/content/page/211271.html" | ||
getTestRanks(url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from app import app | ||
from flask import render_template | ||
import pandas as pd | ||
from pandas_highcharts.core import serialize | ||
|
||
@app.route("/") | ||
@app.route("/index") | ||
def index(): | ||
return(render_template("index.html")) | ||
|
||
@app.route("/dashboard") | ||
def dashboard(): | ||
return(render_template("dashboard.html")) | ||
|
||
@app.route("/test/rankings") | ||
def test_rankings(): | ||
df1 = pd.read_csv("app\data\TestRanks.xslx",sep="\t") | ||
df1.dropna(inplace=True) | ||
table1 = df1.to_html(header=False,index=False,border=0) | ||
with open("app/templates/testrankings.html","r") as ht1: | ||
ht11 = ht1.read() | ||
return(ht11+table1+ | ||
''' </div> | ||
</section> | ||
</body> | ||
</html>''') | ||
|
||
@app.route('/test/graph') | ||
def graph(chartID = 'chart_ID', chart_type = 'column', chart_height = 500): | ||
df1 = pd.read_csv("app/data/TestRanks.xslx",sep="\t") | ||
df1.dropna(inplace=True) | ||
df2 = df1[[' Points ',' Team ']] | ||
df2.set_axis(df2[' Team '],axis=0,inplace=True) | ||
chart = serialize(df2, render_to='my-chart', output_type='json',kind="bar",title=" ICC Test Rankings") | ||
return render_template('graph1.html', chart=chart) | ||
|
||
|
||
|
Oops, something went wrong.