From 1fbdfb34c07b33a33f04f847f30390de08904404 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Tue, 11 Jun 2024 13:34:49 +0200 Subject: [PATCH] replace currecny package, use set not list --- xexe/constants.py | 2 +- xexe/inputs_handling.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xexe/constants.py b/xexe/constants.py index c68206f..051b84b 100644 --- a/xexe/constants.py +++ b/xexe/constants.py @@ -1,7 +1,7 @@ import pathlib from dataclasses import dataclass -from currencies import Currency +from money.currency import Currency DEFAULT_CURRENCIES = {Currency("EUR"), Currency("GBP"), Currency("USD")} diff --git a/xexe/inputs_handling.py b/xexe/inputs_handling.py index dc6731b..f199733 100644 --- a/xexe/inputs_handling.py +++ b/xexe/inputs_handling.py @@ -3,7 +3,7 @@ import logging import pathlib from typing import Union -from currencies import Currency +from money.currency import Currency from xexe.constants import DEFAULT_CURRENCIES from xexe.utils import DateRange @@ -26,9 +26,9 @@ def handle_get_rates_inputs( date_range.end_date = datetime.datetime.today().date() if currencies: - # CLI input comes as string of comma-separated currency codes - currencies = [currency_code.strip() for currency_code in currencies.split(",")] - tmp = [Currency(currency_code) for currency_code in currencies] + # CLI input comes as a string of comma-separated currency codes + currencies = {currency_code.strip() for currency_code in currencies.split(",")} + tmp = {Currency(currency_code) for currency_code in currencies} currencies = tmp if currencies is None: