From 3c290abb95f62d76cb29635f7df14f0fc48514e5 Mon Sep 17 00:00:00 2001 From: Chris Berkhout Date: Thu, 24 Nov 2022 15:29:39 +0100 Subject: [PATCH] Note deprecation of Coindesk Bitcoin Price Index source. --- src/pricehist/sources/coindesk.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pricehist/sources/coindesk.py b/src/pricehist/sources/coindesk.py index 0170a99..7947d1a 100644 --- a/src/pricehist/sources/coindesk.py +++ b/src/pricehist/sources/coindesk.py @@ -1,5 +1,6 @@ import dataclasses import json +import logging from decimal import Decimal import requests @@ -19,7 +20,9 @@ class CoinDesk(BaseSource): def description(self): return ( - "An average of Bitcoin prices across leading global exchanges. \n" + "WARNING: This source is deprecated. Data stops at 2022-07-10.\n" + "The documentation URL now redirects to the main page.\n" + "An average of Bitcoin prices across leading global exchanges.\n" "Powered by CoinDesk, https://www.coindesk.com/price/bitcoin" ) @@ -64,6 +67,8 @@ class CoinDesk(BaseSource): return results def fetch(self, series): + logging.warning("This source is deprecated. Data stops at 2022-07-10.") + if series.base != "BTC" or series.quote in ["BTC", "XBT"]: # BTC is the only valid base. # BTC as the quote will return BTC/USD, which we don't want.