Command line interface to MasterCard currency conversions.
It uses the currencies as can be found in the MasterCard Currency Conversion Tool.
-
Clone the repository.
-
Install the script's dependencies:
Linux:
python3 -m pip install --user pipenv pipenv install pipenv run ...
Windows:
py -3 -m pip install --user pipenv pipenv install pipenv run ...
To use it, simply call the script with the amount you're converting, and the currency before and after.
For example, if I had paid 10 US Dollars and wanted to know how much that was in British Pound Sterling:
pipenv run ./mastercardConvert.py 10 USD GBP
This project uses python3
.
This project uses pipenv
to isolate its environment. Install it with:
python3 -m pip install --user pipenv
Then install the project's dependencies:
pipenv install --dev
This project uses unittest
for testing. To run the tests:
pipenv run python -m unittest
Use pipenv run
to run commands inside the virtualenv from outside the virtualenv.
Use pipenv shell
to get a shell inside the virtualenv.
MasterCard don't tend to publish today's exchange rates until part way through the day; this is also affected by your time zone. This means that sometimes the exchange rates for today might not be available. If this happens, the script will automatically use yesterday's rates. While it means that the exchange rates my not accurately reflect what is used in your transaction, the differences tend to be small.
MasterCard don't publish new exchange rates on Saturdays or Sundays. Not much that can be done there!