From 5db76e0ce865d64fc1ffc257aaf5922db5938ece Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Sun, 27 Aug 2017 07:21:56 -0400 Subject: [PATCH] changes --- Pipfile | 7 +++++++ requirements.txt | 16 +++++++++++++++- server.py | 6 ++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/Pipfile b/Pipfile index f645bbd..6032067 100644 --- a/Pipfile +++ b/Pipfile @@ -18,3 +18,10 @@ flask-cache = "*" flask-common = "*" aiohttp = "<2.0.0" crayons = "*" +scikit-learn = "*" +scipy = "*" +pandas-datareader = "*" +numpy = "*" +tablib = "==0.12.0" +fbprophet = "*" +cython = "*" diff --git a/requirements.txt b/requirements.txt index 3991dd9..003a8d1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,9 +9,12 @@ coinmarketcap==3.0.1 colorama==0.3.9 crayons==0.1.2 cssselect==1.0.1 +cycler==0.10.0 +Cython==0.26 dateparser==0.6.0 docopt==0.6.2 et-xmlfile==1.0.1 +fbprophet==0.1.1 Flask==0.12.2 Flask-Cache==0.13.1 Flask-Common==0.2.0 @@ -26,6 +29,7 @@ jdcal==1.3 Jinja2==2.9.6 lxml==3.8.0 MarkupSafe==1.0 +matplotlib==2.0.2 maya==0.3.2 meinheld==0.6.1 multidict==3.1.3 @@ -33,9 +37,14 @@ numpy==1.13.1 odfpy==1.3.5 openpyxl==2.4.8 pandas==0.20.3 +pandas-datareader==0.5.0 +patsy==0.4.1 +pbr==3.1.1 pendulum==1.2.4 psycopg2==2.7.3.1 +pyparsing==2.2.0 pyquery==1.2.17 +pystan==2.16.0.0 python-dateutil==2.6.1 pytz==2017.2 pytzdata==2017.2 @@ -43,11 +52,16 @@ PyYAML==3.12 records==0.5.0 regex==2017.7.28 requests==2.18.4 +requests-file==1.4.2 +requests-ftp==0.3.1 ruamel.yaml==0.15.32 +scikit-learn==0.19.0 +scipy==0.19.1 simplejson==3.11.1 six==1.10.0 SQLAlchemy==1.1.13 -tablib==0.11.5 +statsmodels==0.8.0 +tablib==0.12.0 tzlocal==1.4 unicodecsv==0.14.1 urllib3==1.22 diff --git a/server.py b/server.py index 4a4d989..cbc1b7d 100644 --- a/server.py +++ b/server.py @@ -1,6 +1,7 @@ import os from scraper import get_coins, get_coin, Coin, convert_to_decimal +from predictions import get_predictions from flask import Flask, jsonify, render_template, request from flask_cache import Cache @@ -52,6 +53,11 @@ def get_coin(coin): }) +@app.route('//forecast') +def get_forecast(coin): + return jsonify(forecast=get_predictions(coin.lower())) + + @app.route('//') def get_value(coin, n): c = Coin(coin.lower())