diff --git a/src/pricehist/cli.py b/src/pricehist/cli.py index 2714592..9d9f127 100644 --- a/src/pricehist/cli.py +++ b/src/pricehist/cli.py @@ -88,6 +88,12 @@ def cmd_fetch(args): output = outputs.by_type[args.output]() start = args.start or source.start() + if start < source.start(): + logging.warn( + f"The start date {start} preceeds the {source.name()} " + f"source start date of {source.start()}." + ) + prices = source.fetch(args.pair, args.type, start, args.end) if args.renamebase or args.renamequote: diff --git a/src/pricehist/sources/coindesk.py b/src/pricehist/sources/coindesk.py index 82bafc5..6fb68aa 100644 --- a/src/pricehist/sources/coindesk.py +++ b/src/pricehist/sources/coindesk.py @@ -51,13 +51,6 @@ class CoinDesk: def fetch(self, pair, type, start, end): base, quote = pair.split("/") - min_start = self.start() - if start < min_start: - exit( - f"start {start} too early. The CoinDesk BPI only covers data" - f"from {min_start} onwards." - ) - url = "https://api.coindesk.com/v1/bpi/historical/close.json" params = { "currency": quote, diff --git a/src/pricehist/sources/ecb.py b/src/pricehist/sources/ecb.py index e226053..104fc18 100644 --- a/src/pricehist/sources/ecb.py +++ b/src/pricehist/sources/ecb.py @@ -49,10 +49,6 @@ class ECB: def fetch(self, pair, type, start, end): base, quote = pair.split("/") - min_start = self.start() - if start < min_start: - exit(f"start {start} too early. Minimum is {min_start}") - almost_90_days_ago = str(datetime.now().date() - timedelta(days=85)) data = self._raw_data(start < almost_90_days_ago) root = etree.fromstring(data)