Package: abstract-python-exchange-rates
AbstractAPI python-exchange-rates libraryIntegrate the powerfulExchange Rates API from Abstractin your Python project in a few lines of code.The Exchange Rate API is an REST API that allows you to:look up the latest exchange rates for 80+ currencies via theliveendpointget historical exchange rates using thehistoricalendpointconvert an arbitrary amount from one currency to another using theconvertendpointIt's very simple to use: you only need to submit your API key and a currency symbol (such as "USD"), and the API will respond with current exchange rate, historical data, or convertion rates.DocumentationSupported Python VersionsThis library supports thePython version 3.6and higher.InstallationYou can installpython-exchange-ratesvia PyPi or by downloading the source.Via PyPi:python-exchange-ratesis available on PyPi as theabstract-python-exchange-ratespackage:pipinstallabstract-python-exchange-ratesAPI keyGet your API key for free and without hassle from theAbstact website.QuickstartGet exchange ratesimportpprintfrompython_exchange_ratesimportAbstractExchangeRatesEXCHANGE_RATES_API_KEY="YYYYYY";# Get your API Key from https://app.abstractapi.com/api/exchange-rates/documentationAbstractExchangeRates.configure(EXCHANGE_RATES_API_KEY)# Get live exchange rates using Abstract's Exchange Rates API and Pythonresponse=AbstractExchangeRates.live("EUR")pprint(response)# Get historical exchange rates using Abstract's Exchange Rates API and Pythonresponse=AbstractExchangeRates.historical('EUR','2021-05-01');pprint(response)# Convert currency using Abstract's Exchange Rates API and Pythonresponse=AbstractExchangeRates.convert('EUR','USD');pprint(response)API responseThe API response contains the following fields:liveresponse parametersParameterTypeDetailsbaseStringThe base currency used to get the exchange rates.last_updatedStringThe Unix timestamp of when the returned data was last updated.exchange_ratesObjectA JSON Object containing each of the target currency as the key and its exchange rate versus the base currency as that key's value.historicalresponse parametersParameterTypeDetailsbaseStringThe base currency used to get the exchange rates.dateStringThe date the currencies were pulled from, per the successful request.exchange_ratesObjectA JSON Object containing each of the target currency as the key and its exchange rate versus the base currency as that key's value.convertresponse parametersParameterTypeDetailsbaseStringThe base currency used to get the exchange rates.targetStringThe target currency that the base_amount was converted into.dateStringThe date the currencies were pulled from, per the successful request.base_amountFloatThe amount of the base currency from the request.converted_amountFloatThe amount of the target currency that the base_amount has been converted intoexchange_rateFloatThe exchange rate used to convert the base_amount from the base currency to the target currencyDetailed documentationYou will find additional information and request examples in theAbstract help page.Getting helpIf you need help installing or using the library, please contactAbstract's Support.For bug report and feature suggestion, please usethis repository issues page.ContributionContributions are always welcome, as they improve the quality of the libraries we provide to the community.Please provide your changes covered by the appropriate unit tests, and post them in thepull requests page.SetupTo install the requirements, run:python3setup.pyinstall--userOnce you implementer all your changes and the unit tests, run the following command to run the tests:EXCHANGE_RATES_API_KEY=YYYYYYpython3tests/test_python_exchange_rates.py