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
Telegram Userbot built with Pyrogram

Pyrogram Userbot A Telegram Userbot based on Pyrogram This repository contains the source code of a Telegram Userbot and the instructions for running

Athfan Khaleel 113 Jan 03, 2023
Create a Neo4J graph of users and roles trust policies within an AWS Organization.

AWS_ORG_MAPPER This tool uses sso-oidc to authenticate to the AWS organization. Once authenticated the tool will attempt to enumerate all users and ro

Ruse 24 Jul 28, 2022
A Bot To Get Info Of Telegram messages , Media , Channel id Group ID etc.

Info-Bot A Bot To Get Info Of Telegram messages , Media , Channel id Group ID etc. Get Info Of Your And Messages , Channels , Groups ETC... How to mak

Vɪᴠᴇᴋ 23 Nov 12, 2022
Code done for/during the course

Serverless Course Autumn 2021 - Code This repository contains a set of examples developed during, but not limited to the live coding sessions. Lesson

Alexandru Burlacu 4 Dec 21, 2021
New developed moderation discord bot by archisha

Monitor42 New developed moderation discord bot by αrchιshα#5518. Details Prefix: 42! Commands: Moderation Use 42!help to get command list. Invite http

Kamilla Youver 0 Jun 29, 2022
Discord Panel is an AIO panel for Discord that aims to have all the needed tools related to user token interactions, as in nuking and also everything you could possibly need for raids

Discord Panel Discord Panel is an AIO panel for Discord that aims to have all the needed tools related to user token interactions, as in nuking and al

11 Mar 30, 2022
Source code for Profile REST API

PROJECT PROFILE REST API Creating local development server: We will create a local development server that can run and test our API as we build it. We

1 Mar 29, 2022
ML-Test-Client

ML-Test-Client Introduction What is this? This Test Client App is to be used to crowd-test machine learning models with the goal of finding the best c

11 Jul 15, 2022
Valorant store offer discord-bot

Valorant store checker - Discord Bot Discord bot that shows your daily store offer without open the VALORANT by using the Ingame API. written using Py

STACIA 226 Jan 02, 2023
A Telegram Bot for searching any channel messages from Inline by @AbirHasan2005

Message-Search-Bot A Telegram Bot for searching any channel messages from Inline by @AbirHasan2005. I made this for @AHListBot. You can use this for s

Abir Hasan 44 Dec 27, 2022
Project for the discipline of Visual Data Analysis at EMAp FGV.

Analysis of the dissemination of fake news about COVID-19 on Twitter This project was the final work for the discipline of Visual Data Analysis of the

Giovani Valdrighi 2 Jan 17, 2022
Video Bot: an Advanced Telegram Bot that's allow you to play Video & Music on Telegram Group Video Chat

Video Bot is an Advanced Telegram Bot that's allow you to play Video & Music on

5 Jan 26, 2022
Robust and blazing fast open-redirect vulnerability scanner with ability of recursevely crawling all of web-forms, entry points, or links with data.

After Golismero project got dead there is no more any up to date open-source tool that can collect links with parametrs and web-forms and then test th

railway zeppelin 34 Aug 25, 2022
Python package for Calendly API v2

PyCalendly Python package to use Calendly API-v2. Installation Install with pip $ pip install PyCalendly Usage Getting Started See Getting Started wi

Lakshmanan Meiyappan 20 Dec 05, 2022
❤️ Hi There Im EzilaX ❤️ A next gen powerful telegram group manager bot 😱 for manage your groups and have fun with other cool modules Made By Sadew Jayasekara 🔥

❤️ EzilaX v1 ❤️ Unmaintained. The new repo of @EzilaXBot is Public. (It is no longer based on this source code. The completely rewritten bot available

Sadew Jayasekara 18 Nov 24, 2021
A taskbar clock for secondary taskbars on Windows 11

ElevenClock A taskbar clock for secondary taskbars on Windows 11. When microsoft's engineers were creating Windows 11, they forgot to add a clock on t

Martí Climent 1.7k Jan 07, 2023
Discord bot ( discord.py ), uses pandas library from python for data-management.

Discord_bot A Best and the most easy-to-use Discord bot !! Some simple basic auto moderations, Chat functions. It includes a game similar to Casino, g

Jaitej 4 Aug 30, 2022
A Python library for the Discourse API

pydiscourse A Python library for working with Discourse. This is a fork of the original Tindie version. It was forked to include fixes, additional fun

Ben Lopatin 72 Oct 14, 2022
This repository contains unofficial code reproducing Agent57

Agent57 This repository contains unofficial code reproducing Agent57, which outp

19 Dec 29, 2022
Unarchive Bot for Telegram

Telegram UnArchiver Bot UnArchiveBot: 🇬🇧 Bot that allows you to extract supported archive formats in telegram. 🇹🇷 Desteklenen arşiv biçimleri tele

Hüzünlü Artemis [HuzunluArtemis] 25 May 07, 2022