mirror of
https://github.com/kennethreitz/coinbin.org.git
synced 2026-06-05 23:10:17 +00:00
improvements
This commit is contained in:
@@ -17,3 +17,4 @@ simplejson = "*"
|
||||
flask-cache = "*"
|
||||
flask-common = "*"
|
||||
aiohttp = "<2.0.0"
|
||||
crayons = "*"
|
||||
|
||||
+1
-43
@@ -1,58 +1,16 @@
|
||||
aiohttp==1.3.5
|
||||
async-timeout==1.3.0
|
||||
beautifulsoup4==4.6.0
|
||||
bleach==2.0.0
|
||||
bs4==0.0.1
|
||||
certifi==2017.7.27.1
|
||||
chardet==3.0.4
|
||||
click==6.7
|
||||
colorama==0.3.9
|
||||
crayons==0.1.2
|
||||
cssselect==1.0.1
|
||||
dateparser==0.6.0
|
||||
docopt==0.6.2
|
||||
et-xmlfile==1.0.1
|
||||
Flask==0.12.2
|
||||
Flask-Cache==0.13.1
|
||||
Flask-Common==0.2.0
|
||||
Flask-SSLify==0.1.5
|
||||
greenlet==0.4.12
|
||||
gunicorn==19.7.1
|
||||
html5lib==0.999999999
|
||||
humanize==0.5.1
|
||||
idna==2.6
|
||||
itsdangerous==0.24
|
||||
jdcal==1.3
|
||||
Jinja2==2.9.6
|
||||
lxml==3.8.0
|
||||
MarkupSafe==1.0
|
||||
maya==0.3.2
|
||||
meinheld==0.6.1
|
||||
multidict==3.1.3
|
||||
numpy==1.13.1
|
||||
odfpy==1.3.5
|
||||
openpyxl==2.4.8
|
||||
pandas==0.20.3
|
||||
pendulum==1.2.4
|
||||
psycopg2==2.7.3
|
||||
pyquery==1.2.17
|
||||
python-dateutil==2.6.1
|
||||
pytz==2017.2
|
||||
pytzdata==2017.2
|
||||
PyYAML==3.12
|
||||
records==0.5.0
|
||||
regex==2017.7.28
|
||||
requests==2.18.4
|
||||
ruamel.yaml==0.15.32
|
||||
simplejson==3.11.1
|
||||
six==1.10.0
|
||||
SQLAlchemy==1.1.13
|
||||
tablib==0.11.5
|
||||
tzlocal==1.4
|
||||
unicodecsv==0.14.1
|
||||
urllib3==1.22
|
||||
webencodings==0.5.1
|
||||
Werkzeug==0.12.2
|
||||
whitenoise==3.3.0
|
||||
xlrd==1.1.0
|
||||
xlwt==1.3.0
|
||||
yarl==0.9.8
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
import pandas
|
||||
import requests
|
||||
|
||||
import crayons
|
||||
from pyquery import PyQuery as pq
|
||||
|
||||
import time
|
||||
@@ -64,7 +65,7 @@ class Coin():
|
||||
|
||||
def update(self):
|
||||
coins = get_coins()
|
||||
print(f'Fetching data on {self.ticker}')
|
||||
print(f'Fetching data on {crayons.cyan(self.ticker)}...')
|
||||
|
||||
self.name = coins[self.ticker]['name']
|
||||
self.rank = coins[self.ticker]['rank']
|
||||
|
||||
@@ -8,6 +8,7 @@ from flask_cache import Cache
|
||||
from flask_common import Common
|
||||
from flask_sslify import SSLify
|
||||
|
||||
import crayons
|
||||
import maya
|
||||
import requests
|
||||
import records
|
||||
@@ -78,7 +79,7 @@ def get_history(coin):
|
||||
q = "SELECT * from api_coin WHERE name=:coin ORDER BY date desc"
|
||||
|
||||
if request.args.get('key') in API_KEYS:
|
||||
print('Pro request!')
|
||||
print(crayons.red('Pro request!'))
|
||||
rows = pro_db.query(q, coin=c.name)
|
||||
else:
|
||||
rows = db.query(q, coin=c.name)
|
||||
@@ -88,7 +89,7 @@ def get_history(coin):
|
||||
'value': r.value,
|
||||
'value.currency': 'USD',
|
||||
'timestamp': maya.MayaDT.from_datetime(r.date).iso8601(),
|
||||
'when': maya.MayaDT.from_datetime(r.date).slang_date()
|
||||
'when': maya.MayaDT.from_datetime(r.date).slang_time()
|
||||
} for r in rows]
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user