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

Owner
Arthur Diniz
Studying Science in Computational Systems at Zayed University, Dubai campus.
Arthur Diniz
Offline reverse geocoder in Python using sqlite3

rgeocode Offline reverse geocoder rgeocode accepts a geographic coordinate pair (latitude and longitude) and returns a list containing the name of: A

Venkat 7 Dec 01, 2021
Python library for generating sequences with uniform stimulus history

Sampling Euler tours for uniform stimulus history Table of Contents About Examples Experiment 1 Experiment 2 Experiment 3 Experiment 4 Experiment 5 Co

5 Nov 11, 2021
The official source code for Ghost Discord selfbot.

👻 Ghost Selfbot The official code for Ghost which was recently discontinued and released to the public. Feel free to use any of the code found in thi

Ghost 121 Nov 09, 2022
A continued fork of Disco

Orca Orca is an extensive and extendable Python 3.x library for the Discord API. orca boasts the following major features: Expressive, functional inte

RPS 4 Apr 03, 2022
Materials for the AMS 2022 Student Conference Python Workshop.

AMS 2022 Student Conference Python Workshop Let's talk MetPy! Here you will find a collection of notebooks we will be demonstrating and working throug

Unidata 4 Dec 13, 2022
A pyrogram simple bot for Educational purpose.

A pyrogram simple bot for Educational purpose. To Learn More check at @PyrogramBot or on Documentation Mandatory variables API_ID - Get It From my.tel

SpamShield 10 Dec 06, 2022
Software com interface gráfica para criar postagens anônimas no Telegra.ph do Telegram e compartilhar onde quiser...

Software com interface gráfica para criar postagens anônimas no Telegra.ph do Telegram e compartilhar onde quiser...

Elizeu Barbosa Abreu 4 Feb 05, 2022
A Simple Voice Music Player

📀 𝐕𝐂𝐔𝐬𝐞𝐫𝐁𝐨𝐭 √𝙏𝙚𝙖𝙢✘𝙊𝙘𝙩𝙖𝙫𝙚 NOTE JUST AN ENGLISH VERSION OF OUR PRIVATE SOURCE WAIT FOR LATEST UPDATES JOIN @𝐒𝐔𝐏𝐏𝐎𝐑𝐓 JOIN @𝐂?

TeamOctave 8 May 08, 2022
⚡ PoC: Hide a c&c botnet in the discord client. (Proof Of Concept)

👨‍💻 Discord Self Bot 👨‍💻 A Discord Self-Bot in Python by natrix Installation Run: selfbot.bat Python: version : 3.8 Modules

0хVιcнy#1337 37 Oct 21, 2022
Bitbucket Server API Wrapper

A simple wrapper for the Atlassian's Bitbucket Server / Bitbucket Datacenter (formerly Stash) REST API, written in Python.

Schweitzer Engineering Laboratories 4 Jan 06, 2023
Most Simple & Powefull web3 Trade Bot (WINDOWS LINUX) Suport BSC ETH

Most Simple & Powefull Trade Bot (WINDOWS LINUX) What Are Some Pros And Cons Of Owning A Sniper Bot? While having a sniper bot is typically an advanta

GUI BOT 6 Jan 30, 2022
A customizable, multilanguage Telegram shop bot with Telegram Payments support

Greed A customizable, multilanguage Telegram shop bot with Telegram Payments support! Demo Send a message to @greedtestbot on Telegram to view a demo

Stefano Pigozzi 328 Dec 29, 2022
Pls give vaccine.

Pls Give Vaccine A script to spam yourself with vaccine notifications. Explore the docs » View Demo · Report Bug · Request Feature Table of Contents A

Rohan Mukherjee 3 Oct 27, 2021
:snake: Python SDK to query Scaleway APIs.

Scaleway SDK Python SDK to query Scaleway's APIs. Stable release: Development: Installation The package is available on pip. To install it in a virtua

Scaleway 114 Dec 11, 2022
Apps related to Odoo it's calendar features

calendar Apps related to Odoo it's calendar/appointments features: online_appointment_locations: allow setting an online URL per employee online_appoi

Yenthe Van Ginneken 3 Oct 27, 2022
Cord Python API Client

Cord Python API Client The data programming platform for AI 💻 Features Minimal low-level Python client that allows you to interact with Cord's API Su

Cord 52 Nov 25, 2022
Analog clock that shows the weather instead of the actual numerical hour it points to.

Eli's weatherClock An digital analog clock but instead of showing the hours, the clock shows the weather at that hour of the day. So instead of showin

Kovin 154 Dec 01, 2022
Ap lokit lokit

🎵 FANDA PROJECT 🎵 HAI AKU FANDA! Requirements 📝 FFmpeg NodeJS nodesource.com Python 3.8 or higher PyTgCalls MongoDB Get STRING_SESSION from below:

Fatur 2 Nov 18, 2021
ResolveURL - Fork of UrlResolver by eldorados, tknorris and jsergio123

ResolveURL Fork of UrlResolver by eldorados, tknorris and jsergio123 I am in no

gujal 60 Jan 03, 2023
Telegram bot for stream music or video on telegram

KYURA MUSIC Telegram bot for stream music or video on telegram, powered by PyTgCalls and Pyrogram Help Need Help me to translate this repo, click the

0 Dec 08, 2022