diff --git a/src/pricehist/cli.py b/src/pricehist/cli.py index 736148a..20c14df 100644 --- a/src/pricehist/cli.py +++ b/src/pricehist/cli.py @@ -65,6 +65,8 @@ def cmd_source(args): print_field("Name", source.name(), 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("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) diff --git a/src/pricehist/sources/coindesk.py b/src/pricehist/sources/coindesk.py index e63b781..82bafc5 100644 --- a/src/pricehist/sources/coindesk.py +++ b/src/pricehist/sources/coindesk.py @@ -26,6 +26,14 @@ class CoinDesk: def source_url(): return "https://www.coindesk.com/coindesk-api" + @staticmethod + def start(): + return "2010-07-17" + + @staticmethod + def types(): + return [] + @staticmethod def notes(): return "" @@ -43,7 +51,7 @@ class CoinDesk: def fetch(self, pair, type, start, end): base, quote = pair.split("/") - min_start = "2010-07-17" + min_start = self.start() if start < min_start: exit( f"start {start} too early. The CoinDesk BPI only covers data" diff --git a/src/pricehist/sources/coinmarketcap.py b/src/pricehist/sources/coinmarketcap.py index c672c9a..3318425 100644 --- a/src/pricehist/sources/coinmarketcap.py +++ b/src/pricehist/sources/coinmarketcap.py @@ -24,6 +24,14 @@ class CoinMarketCap: def source_url(): return "https://coinmarketcap.com/" + @staticmethod + def start(): + return "2013-04-28" + + @staticmethod + def types(): + return ["mid", "open", "high", "low", "close"] + @staticmethod def notes(): return ( diff --git a/src/pricehist/sources/ecb.py b/src/pricehist/sources/ecb.py index bbfebc3..e226053 100644 --- a/src/pricehist/sources/ecb.py +++ b/src/pricehist/sources/ecb.py @@ -25,6 +25,14 @@ class ECB: def source_url(): 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 def notes(): return "" @@ -41,7 +49,7 @@ class ECB: def fetch(self, pair, type, start, end): base, quote = pair.split("/") - min_start = "1999-01-04" + min_start = self.start() if start < min_start: exit(f"start {start} too early. Minimum is {min_start}")