Currency Merger is a simple tool for joining values in different currencies

Overview

Currency Merger

Description

Currency Merger is a simple tool for joining values in different currencies. For example, if I have money in USD, EUR, BRL and AED, I could use this tool to see how much I have in total in USD.

This is my first project ever, I did it for an Applied Algorithmic Thinking class. It was made in Python with the libraries TKinter and Requests, as well as the API ExchangeRate. This being said, for the program to work properly you need to install the libraries used before running it.

Algorithm explanation

The algorithm gets the currency exchange rates from the ExchangeRate-API, and stores them in a dictionary called currency_rates, with the name of the currency as the key and exchange rate as the value. Then I have two main functions to perform the operations: currencyConvert() and convertAndAdd(). currencyConvert() will take a value, a “FromCurrency”, a “ToCurrency” and the conversion rates as arguments, and return the converted value. convertAndAdd() will call currencyConvert() and add the returned value in a variable called “total”, which will be accumulative (will start at 0 and we will keep adding to its value) and visible on the screen. Then, the function will update the GUI (which I will talk about next). This function’s purpose is to be called by a button in the GUI. The interaction with the user will be made through a GUI I built with the library Tkinter. It has an entry for the value, option boxes for the currencies, a button to call convertAndAdd(), a text object for the total value, and a button to reset the program (if the user wants to start adding from 0 again). The functions will take the values in the entry box and options menus as arguments, and the “total” that they’ll generate will go to the text object, which will be shown on the screen.

Algorithm Flowchart

Flowcharts to understand the important functions.

Screen Shot 2021-12-13 at 1 30 26 PM

Screen Shot 2021-12-13 at 1 30 42 PM

Testing

To test my algorithm, I started by testing the function currencyConvert() with assert statements. If it is working properly, then the main operation, which is the conversion, is working.

testvalue = currencyConvert(10, 'USD', 'AED', conversion_rates)
assert f'{testvalue:.2f}' == '36.73'

This code runs with no problems, which means the function is working. If you want to test it by yourself, first check the current value of the currency and edit the assert statement, because it changes every time. The function convertAndAdd() doesn't return anything. It is called by a button in the GUI, and then it updates the values that are shown. Because of this, it is harder to test with assertions, so I tested it manually by running the GUI main loop and using it.

First, I tried to convert 50 USD into BRL, and as the image below shows, it worked.

Screen Shot 2021-12-13 at 3 44 49 PM

Then, I tried to add another value to the total, but now in AED, to test the accumulative part of my algorithm. It also worked.

Screen Shot 2021-12-13 at 3 46 03 PM

I also tested the reset button manually. It just restarts the application, and it is working fine. With all tests done, I concluded that all functionalities are working properly, and the application is ready to be used by anyone.

References

These are the sources I relied on while studying the libraries and implementation of my idea:

https://www.dataquest.io/blog/python-api-tutorial/

https://www.tutorialspoint.com/python-get-the-real-time-currency-exchange-rate

https://www.exchangerate-api.com/docs/overview

https://realpython.com/python-gui-tkinter/

https://docs.python.org/3/library/tk.html

https://www.tutorialspoint.com/python3/python_gui_programming.htm

You might also like...
Signs the target email up to over 1000 different mailing lists to get spammed each day.

Email Bomber Say goodbye to that email Features Signs up to over 1k different mailing lists Written in python so the program is lightweight Easy to us

Many discord bots serving different purposes

Discord_Botlari Farklı amaçlara hizmet eden bir çok discord botu En kapsamlı Bot Game Bottur. bir oyun botudur discord sunucularında kullanılır. (tüm

CryptoApp - Python code to pull wallet balances from a variety of different chains through nothing other than your public key.

CryptoApp - Python code to pull wallet balances from a variety of different chains through nothing other than your public key.

A Python wrapper around the Pushbullet API to send different types of push notifications to your phone or/and computer.

pushbullet-python A Python wrapper around the Pushbullet API to send different types of push notifications to your phone or/and computer. Installation

Simple yet efficient tool used to check and sort tokens in terms of there validation.
Simple yet efficient tool used to check and sort tokens in terms of there validation.

Discord Token Checker Simple yet efficient tool used to check and sort tokens in terms of there validation.When the program is done,go to the "output"

A Simple modular tool to fetch and parse data related to the stock market.

🐒 stonks-o-fetcher A Simple modular tool to fetch and parse data related to the stock market. Getting started For the moment the only source is this

Simple tool to gather domains from crt.sh using the organization name
Simple tool to gather domains from crt.sh using the organization name

Domain Collector: _ _ ___ _ _ _ __| | ___ _ __ ___ __ _(_)_ __ / __\___ | |

A simple tool that allows you to change your default AWS CLI profile.
A simple tool that allows you to change your default AWS CLI profile.

Select AWS Profile Select AWS Profile (slapr) is a simple tool that lets you select which AWS Profile you want to use and sets it as the default AWS p

EZPZ-PGP: This is a simple and easy to use PGP tool.

EZPZ-PGP This is a simple and easy to use PGP tool. Features [X] Create new PGP Keypairs, able to choose between 4096 and 8192 bit keys.\n [X] Import

Owner
Arthur Diniz
Studying Science in Computational Systems at Zayed University, Dubai campus.
Arthur Diniz
A tool for transferring server variable values from one intersect gamedata.db to another

Server Variable Transfer Tool Purpose This tool exists for use with the Intersect Engine (Ascension Game Dev GitHub). Its purpose is to UPDATE one sql

AVild 2 Oct 27, 2021
A Discord bot for viewing any currency you want comfortably.

Dost Dost is a Discord bot for viewing currencies. Getting Started These instructions will get you a copy of the project up and running on your local

Baran Gökalp 2 Jan 18, 2022
A Slack bot for playing Texas Hold 'Em where the currency is various workout tasks e.g. pushups

A Slack app/bot for playing Texas Hold 'Em where the currency is various workout tasks e.g. pushups. The intent is to make the workday more fun & active for remote teams.

Kyle McIntyre 3 Sep 19, 2022
A simple Telegram bot which handles images in whole different way

zeroimagebot thezeroimagebot ?? I Can Edit Dimension Of An image which is required by @stickers ?? I Can Extract Text From An Image ?? !!! New Updates

RAVEEN KUMAR 4 Jul 1, 2021
A simple Facebook Account generator, written in python (needs different Email so Accounts do not get banned)

FacebookAccountGenerator FAB is a Facebook-Account generating script, written in python Installation Use the package manager pip to install selenium p

MrOverload 7 Jan 5, 2023
ignorant allows you to check if a phone number is used on different sites like snapchat, instagram.

Ignorant For BTC Donations : 1FHDM49QfZX6pJmhjLE5tB2K6CaTLMZpXZ ignorant does not alert the target phone number ignorant allows you to check if a phon

Palenath 513 Dec 31, 2022
search different Streaming Platforms for movie titles.

Install git clone and cd to directory install Selenium download chromedriver.exe to same directory First Run Use --setup True for the first run. Platf

null 34 Dec 25, 2022
Telegram bot to provide links of different types of files you send

File To Link Bot - IDN-C-X Telegram bot to provide links of different types of files you send. WHAT CAN THIS BOT DO Is it a nuisance to send huge file

IDNCoderX 3 Oct 26, 2021