No limitations.
- Python2.7 or 3
- all modules are allowed
- --amount - amount which we want to convert - float
- --input_currency - input currency - 3 letters name or currency symbol
- --output_currency - requested/output currency - 3 letters name or currency symbol
- if output_currency param is missing, convert to all known currencies
- json with following structure.
{
"input": {
"amount": <float>,
"currency": <3 letter currency code>
}
"output": {
<3 letter currency code>: <float>
}
}
./currency_converter.py --amount 100.0 --input_currency EUR --output_currency CZK
{
"input": {
"amount": 100.0,
"currency": "EUR"
},
"output": {
"CZK": 2707.36,
}
}
./currency_converter.py --amount 0.9 --input_currency ¥ --output_currency AUD
{
"input": {
"amount": 0.9,
"currency": "CNY"
},
"output": {
"AUD": 0.20,
}
}
./currency_converter.py --amount 10.92 --input_currency £
{
"input": {
"amount": 10.92,
"currency": "GBP"
},
"output": {
"EUR": 14.95,
"USD": 17.05,
"CZK": 404.82,
.
.
.
}
}
Are you aware that multiple currencies use same symbols?
See World Currency Symbols
How is the program supposed to handle difference between Canadian Dollar and US Dollar ($) or between Japanese Yen and Chinese Yuan (¥) which use same symbol?
There are 24 currencies that use dollar sign as currency symbol so there is need for disambiguation.
I expect that some sort of online currency converter service was used which handles the conversion automatically. I suggest that you give us the link to the service, clearly define rules for disambiguation or drop the currency symbol option completely.
I look forward to your reply.