mirror of
https://github.com/wassname/libcryptomarket.git
synced 2026-08-20 12:30:29 +08:00
Added back dependency and resolved flake8 errors.
This commit is contained in:
+1
-5
@@ -4,11 +4,7 @@
|
||||
language: python
|
||||
python:
|
||||
- 3.5
|
||||
- 3.4
|
||||
- 3.3
|
||||
- 2.7
|
||||
- 2.6
|
||||
|
||||
|
||||
# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
|
||||
install: pip install -U tox-travis
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#!/bin/python
|
||||
import requests
|
||||
import json
|
||||
from datetime import datetime
|
||||
|
||||
API_URL = "https://min-api.cryptocompare.com/data/"
|
||||
@@ -55,6 +54,7 @@ def get_coinlist():
|
||||
|
||||
return requests.get(url).json()
|
||||
|
||||
|
||||
def get_histo(period, fsym, tsym, e, limit=None, toTs=None):
|
||||
"""Return historical prices.
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ from libcryptomarket.api.cryptocompare_api import (
|
||||
get_histo, CryptocompareHisto
|
||||
)
|
||||
|
||||
|
||||
def get_historical_prices(source='cryptocompare', symbol=None, exchange=None,
|
||||
period=None, limit=0, from_time=None, to_time=None):
|
||||
"""Get historical prices.
|
||||
@@ -30,9 +31,9 @@ def get_historical_prices(source='cryptocompare', symbol=None, exchange=None,
|
||||
raise ValueError("Input parameter exchange cannot be None.")
|
||||
|
||||
if ((limit > 0) +
|
||||
((from_time is not None) or (to_time is not None)) > 1):
|
||||
raise ValuError("Only accept input parameter limit, or from_time"
|
||||
" and to_time pair.")
|
||||
((from_time is not None) or (to_time is not None)) > 1):
|
||||
raise ValueError("Only accept input parameter limit, or from_time"
|
||||
" and to_time pair.")
|
||||
|
||||
# Parse from (first 3) and to (last 3) symbol from the parameter
|
||||
# symbol.
|
||||
@@ -69,9 +70,3 @@ def get_historical_prices(source='cryptocompare', symbol=None, exchange=None,
|
||||
return data.sort_values(['r_time'])
|
||||
else:
|
||||
raise ValueError("No source is called {0}".format(source))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -10,4 +10,5 @@ Sphinx==1.4.8
|
||||
pytest==2.9.2
|
||||
pytest-runner==2.11.1
|
||||
|
||||
pandas>=0.20.0
|
||||
pandas>=0.20.0
|
||||
requests
|
||||
@@ -12,7 +12,8 @@ with open('HISTORY.rst') as history_file:
|
||||
history = history_file.read()
|
||||
|
||||
requirements = [
|
||||
'pandas>=0.20.0'
|
||||
'pandas>=0.20.0',
|
||||
'requests'
|
||||
]
|
||||
|
||||
setup_requirements = [
|
||||
|
||||
Reference in New Issue
Block a user