Sources define a start date and price types.
This commit is contained in:
parent
d0cad8d650
commit
f69ecf8adb
4 changed files with 28 additions and 2 deletions
|
@ -65,6 +65,8 @@ def cmd_source(args):
|
||||||
print_field("Name", source.name(), key_width, output_width)
|
print_field("Name", source.name(), key_width, output_width)
|
||||||
print_field("Description", source.description(), key_width, output_width)
|
print_field("Description", source.description(), key_width, output_width)
|
||||||
print_field("URL", source.source_url(), key_width, output_width, force=False)
|
print_field("URL", source.source_url(), key_width, output_width, force=False)
|
||||||
|
print_field("Start", source.start(), key_width, output_width)
|
||||||
|
print_field("Types", ", ".join(source.types()), key_width, output_width)
|
||||||
print_field("Notes", source.notes(), key_width, output_width)
|
print_field("Notes", source.notes(), key_width, output_width)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,14 @@ class CoinDesk:
|
||||||
def source_url():
|
def source_url():
|
||||||
return "https://www.coindesk.com/coindesk-api"
|
return "https://www.coindesk.com/coindesk-api"
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def start():
|
||||||
|
return "2010-07-17"
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def types():
|
||||||
|
return []
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def notes():
|
def notes():
|
||||||
return ""
|
return ""
|
||||||
|
@ -43,7 +51,7 @@ class CoinDesk:
|
||||||
def fetch(self, pair, type, start, end):
|
def fetch(self, pair, type, start, end):
|
||||||
base, quote = pair.split("/")
|
base, quote = pair.split("/")
|
||||||
|
|
||||||
min_start = "2010-07-17"
|
min_start = self.start()
|
||||||
if start < min_start:
|
if start < min_start:
|
||||||
exit(
|
exit(
|
||||||
f"start {start} too early. The CoinDesk BPI only covers data"
|
f"start {start} too early. The CoinDesk BPI only covers data"
|
||||||
|
|
|
@ -24,6 +24,14 @@ class CoinMarketCap:
|
||||||
def source_url():
|
def source_url():
|
||||||
return "https://coinmarketcap.com/"
|
return "https://coinmarketcap.com/"
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def start():
|
||||||
|
return "2013-04-28"
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def types():
|
||||||
|
return ["mid", "open", "high", "low", "close"]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def notes():
|
def notes():
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -25,6 +25,14 @@ class ECB:
|
||||||
def source_url():
|
def source_url():
|
||||||
return "https://www.ecb.europa.eu/stats/exchange/eurofxref/html/index.en.html"
|
return "https://www.ecb.europa.eu/stats/exchange/eurofxref/html/index.en.html"
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def start():
|
||||||
|
return "1999-01-04"
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def types():
|
||||||
|
return []
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def notes():
|
def notes():
|
||||||
return ""
|
return ""
|
||||||
|
@ -41,7 +49,7 @@ class ECB:
|
||||||
def fetch(self, pair, type, start, end):
|
def fetch(self, pair, type, start, end):
|
||||||
base, quote = pair.split("/")
|
base, quote = pair.split("/")
|
||||||
|
|
||||||
min_start = "1999-01-04"
|
min_start = self.start()
|
||||||
if start < min_start:
|
if start < min_start:
|
||||||
exit(f"start {start} too early. Minimum is {min_start}")
|
exit(f"start {start} too early. Minimum is {min_start}")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue