currency rates Japanese yen calculation Python script

Python Script to Calculate Japanese Yen Amount Based on Exchange Rates

Created a Python script that calculates how much something is in Japanese yen based on currency exchange rates. It supports almost all currencies.

Shou Arisaka
1 min read
Nov 3, 2025

Although I say I created it, it's a simple script, but there aren't many tools that do currency calculations, so I thought I had no choice but to create it myself, so I reluctantly made it.

It supports almost all currencies.

It converts to Japanese yen, but if you modify the code, you can also do dollar conversions and such.

from forex_python.converter import CurrencyRates
c = CurrencyRates()

import sys
args = sys.argv

# print(c.convert('CNY', 'JPY', 10))
print(c.convert(args[1], 'JPY', float(args[2])))

Usage

Do pip3 install forex-python, then do something like python3 script.py USD 100.

The output looks like this.

yuis@DESKTOP-UHU8FSH:/mnt/c/pg$ python3 /mnt/c/pg/calc_rate/calc_rate.py CNY 10
174.14999999999998
yuis@DESKTOP-UHU8FSH:/mnt/c/pg$ python3 /mnt/c/pg/calc_rate/calc_rate.py USD 10
1096.6

Summary

This was an introduction to an article about creating a Python script that calculates how much something is in Japanese yen based on currency exchange rates.

Thank you for reading to the end.

Share this article

Shou Arisaka Nov 3, 2025

๐Ÿ”— Copy Links