mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-03-11 00:59:49 +00:00
Refactor currency_converter.py (#5917)
* Update currency_converter.py * refactor: add types and remove reserved keyword "from" usage * feat: update text * Update web_programming/currency_converter.py Co-authored-by: xcodz-dot <71920621+xcodz-dot@users.noreply.github.com> * Update web_programming/currency_converter.py Co-authored-by: xcodz-dot <71920621+xcodz-dot@users.noreply.github.com> * fix: update currency_converter.py * updating DIRECTORY.md * Update currency_converter.py Co-authored-by: xcodz-dot <71920621+xcodz-dot@users.noreply.github.com> Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Co-authored-by: Christian Clauss <cclauss@me.com>
This commit is contained in:
parent
7423875cef
commit
c15a4d5af6
@ -10,9 +10,11 @@ import requests
|
|||||||
URL_BASE = "https://www.amdoren.com/api/currency.php"
|
URL_BASE = "https://www.amdoren.com/api/currency.php"
|
||||||
TESTING = os.getenv("CI", False)
|
TESTING = os.getenv("CI", False)
|
||||||
API_KEY = os.getenv("AMDOREN_API_KEY", "")
|
API_KEY = os.getenv("AMDOREN_API_KEY", "")
|
||||||
if not API_KEY and not TESTING:
|
|
||||||
raise KeyError("Please put your API key in an environment variable.")
|
|
||||||
|
|
||||||
|
if not API_KEY and not TESTING:
|
||||||
|
raise KeyError(
|
||||||
|
"API key must be provided in the 'AMDOREN_API_KEY' environment variable."
|
||||||
|
)
|
||||||
|
|
||||||
# Currency and their description
|
# Currency and their description
|
||||||
list_of_currencies = """
|
list_of_currencies = """
|
||||||
|
Loading…
x
Reference in New Issue
Block a user