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:
Michael Currin 2022-01-28 08:52:42 +02:00 committed by GitHub
parent 7423875cef
commit c15a4d5af6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,9 +10,11 @@ import requests
URL_BASE = "https://www.amdoren.com/api/currency.php"
TESTING = os.getenv("CI", False)
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
list_of_currencies = """