From 2841d5b8f14e5de4c3679e9acf6416bcbce14feb Mon Sep 17 00:00:00 2001 From: Chris Berkhout Date: Mon, 12 Apr 2021 17:33:12 +0200 Subject: [PATCH] Add source description and source_url. --- src/pricehist/cli.py | 6 ++++-- src/pricehist/sources/CoinMarketCap.py | 12 +++++++++++- src/pricehist/sources/ECB.py | 7 +++++++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/pricehist/cli.py b/src/pricehist/cli.py index 407ab14..28be090 100644 --- a/src/pricehist/cli.py +++ b/src/pricehist/cli.py @@ -22,8 +22,10 @@ def cmd_sources(args): def cmd_source(args): source = sources.by_id[args.identifier] - print(f'ID : {source.id()}') - print(f'Name : {source.name()}') + print(f'ID : {source.id()}') + print(f'Name : {source.name()}') + print(f'Description : {source.description()}') + print(f'URL : {source.source_url()}') pass def build_parser(): diff --git a/src/pricehist/sources/CoinMarketCap.py b/src/pricehist/sources/CoinMarketCap.py index ab9c666..d265322 100644 --- a/src/pricehist/sources/CoinMarketCap.py +++ b/src/pricehist/sources/CoinMarketCap.py @@ -6,4 +6,14 @@ class CoinMarketCap(): @staticmethod def name(): - return 'CoinMarketCap.com' + return 'CoinMarketCap' + + @staticmethod + def description(): + return 'CoinMarketCap historical price data' + + @staticmethod + def source_url(): + return 'https://coinmarketcap.com/' + + diff --git a/src/pricehist/sources/ECB.py b/src/pricehist/sources/ECB.py index f989e6b..1336cae 100644 --- a/src/pricehist/sources/ECB.py +++ b/src/pricehist/sources/ECB.py @@ -8,3 +8,10 @@ class ECB(): def name(): return 'European Central Bank' + @staticmethod + def description(): + return 'European Central Bank Euro foreign exchange reference rates' + + @staticmethod + def source_url(): + return 'https://www.ecb.europa.eu/stats/exchange/eurofxref/html/index.en.html'