0% found this document useful (0 votes)
47 views25 pages

Final Miniproject-1

This document describes a currency converter application created using Python. It allows users to convert amounts between different currencies by selecting the source and target currencies from dropdown lists. Real-time exchange rates are retrieved from an external API. The application features a graphical user interface built using the Tkinter library.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views25 pages

Final Miniproject-1

This document describes a currency converter application created using Python. It allows users to convert amounts between different currencies by selecting the source and target currencies from dropdown lists. Real-time exchange rates are retrieved from an external API. The application features a graphical user interface built using the Tkinter library.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

A MINI PROJECT REPORT ON

CURRENCY CONVERTER USING PYTHON


Submitted in partial fulfilment for the award of the degree of
BACHELOR OF TECHNOLOGY
In

Mechanical Engineering

By

K. Venkat(22A85A0321)
L.P. Surya Teja(22A85A0322)
M.Ganesh(22A85A0323)
M.Naga Srinivasu(22A85A0324)

Under the Esteemed Supervision of


MR.M.D.Nagendra Prasad , M-Tech

Department of Computer Science and Engineering (Accredited by N.B.A.)


SRI VASAVI ENGINEERING COLLEGE(Autonomous)
(Affiliated to JNTUK, Kakinada)
Pedatadepalli, Tadepalligudem-534101, A.P
2022-23
SRI VASAVI ENGINEERING COLLEGE (Autonomous)
Department Of Computer Science and Engineering
Pedatadepalli, Tadepalligudem

This is to certify by K. Venkat(22A85A0321), L.P. Surya Teja (22A85A0322),


M. Ganesh (22A85A0323), M.N. Srinivasu (22A85A0324) have submitted the
mini project course entitled “CURRENCY CONVENTER USING PYTHON”
impartial fulfilment of the requirements for the B. Tech Program in MECHANICAL
from Sri Vasavi Engineering College, Tadepalligudem, affiliated to Jawaharlal
Nehru Technological University Kakinada

Project Guide Head of the Department


Mr.M.D.Nagendra Prasad, Dr.M.V.Ramesh,
M-Tech Professor & HOD

External Examiner
DECLARATION

We hereby declare that the project report entitled “Currency Converter using python" submitted by
us to Sri Vasavi Engineering College (Autonomous), Tadepalligudem, affiliated to JNTUK Kakinada
in partial fulfilment of the requirement for the award of the degree of B.Tech in Mechanical
Engineering is a record of Bonafide project work carried out by us under the guidance of
MR.M.D.Nagendra Prasad, M-Tech We further declare that the work reported in this project has not
been submitted and will not be submitted, either in part or in full, for the award of any other degree in
this institute or any other institute or University.

Project Associate

K. Venkat(22A85A0321)
L.P. Surya Teja(22A85A0322)
M.Ganesh(22A85A0323)
M.Naga Srinivasu(22A85A0324)
ACKNOWLEDGEMENT

First and foremost, we sincerely salute to our esteemed institute SRI VASAVI ENGINEERING
COLLEGE, for giving us this golden opportunity to fulfil our warm dream to become an engineer.
Our sincere gratitude to our project guide Mr.M.D. Nagendra Prasad MTech, Department of
Mechanical Engineering, for her timely cooperation and valuable suggestions while carrying out this
project.

We express our sincere thanks and heartful gratitude to Dr.M.V.Ramesh, Professor & Head of the
Department of Computer Science and Engineering, for permitting us to do our project.
We express our sincere thanks and heartful gratitude to Dr. G.V.N.S.R. Ratnakara Rao, Principal,
for providing a favorable environment and supporting us during the development of this project.
Our special thanks to the management and all the teaching and non-teaching staff members,
Department of Computer Science and Engineering, for their support and cooperation in various ways
during our project work. It is our pleasure to acknowledge the help of all those respected individuals.
We would like to express our gratitude to our parents, friends who helped to complete this project.

Project Associate

K.Venkat(22A85A0321)
L.P. Surya Teja(22A85A0322)
M.Ganesh(22A85A0323)
M.Naga Srinivasu(22A85A0324)

2
ABSTRACT

The "Currency Converter Application" is a user-friendly desktop tool


developed in Python, leveraging the tkinter library for the graphical interface
and forex-python for real-time currency exchange rates. The application
allows users to seamlessly convert monetary amounts between different
currencies, providing a hassle-free solution for individuals dealing with
international transactions or travel.
The graphical user interface features labeled input fields for amount entry,
dropdown lists for source and target currencies, and a visually appealing
result display area. The application employs ttkthemes for enhanced styling,
including the addition of borders
to labels for improved visual clarity. Error handling mechanisms are
incorporated to notify users of invalid inputs, ensuring a robust and user-
friendly experience
One notable feature of the project is its ability to be converted into a stand-
alone executable file using PyInstaller. This enables users to run the
application without the need to install Python or any dependencies, making
it easily distributable. The Currency Converter Application serves as a
practical and efficient tool for users seeking a reliable means to perform
currency conversions effortlessly.

3
CONTENTS

01 . Introduction
02 . Design and implementation

03 . Results

04 . conclusion
05 . Snapshots
06 . Featural scope( reference links )

4
CHAPTER 1

INTRODUCTION

5
1 INTRODUCTION
In a world characterized by global connectivity and international
transactions, the need for efficient currency conversion tools has become
increasingly pronounced. The "Currency Converter Application" emerges as
a versatile and user-friendly solution to address this demand. Developed
using Python, the application seamlessly integrates essential libraries such as
tkinter for the graphical interface and forex-python for real- time currency
exchange rate retrieval.

2 Motivation
2.1 The motivation behind this project is to provide individuals, whether
engaged in international business or planning travel, with a straightforward
and accessible tool for converting monetary values between diverse
currencies. The user interface has been meticulously designed to cater to
users of varying technical backgrounds, featuring intuitive input fields,
dropdown lists for currency selection, and an aesthetically pleasing display
area for conversion results. The incorporation of ttkthemes allows for
enhanced styling, contributing to a visually appealing and user-centric
design.

6
CHAPTER 2

DESIGN AND IMPLETATION

7
1) Requirements: -
The currency conversion project requires how much amount u want to convert from
one currency to other.It is the only basic requirement needed to our project execution

2) Tools and Libraries: -


TKINTER for GUI

Forex_python library for exchange rates

3) Create new python project file:-

Example:- Mini project

4) Install required libraries:- install forex_python library

“pip install forex-python”

5) Import Necessary Modules:-

from tkinter import *

from forex_python.converter import CurrencyRates, BtcConverter from

PIL import Image

6) Code: -
from PIL import ImageTk,Image

from forex_python.converter import CurrencyRates

from forex_python.bitcoin import BtcConverter

import tkinter as tk

from tkinter import ttk

8
from ttkthemes import ThemedTk class

CurrencyConverter:

def _init_(self):

self.c = CurrencyRates()

root.iconbitmap("icon1.ico")

root['background']="blue" def convert(self, amount,

from_currency, to_currency):

exchange_rate = self.c.get_rate(from_currency, to_currency) converted

= amount * exchange_rate

return converted

class CurrencyConverterApp: global

converted_amount

def _init_(self, root): self.root = root

self.root.title("Currency Converter")

self.root.minsize(700, 200) # Set

minimum size

self.root.maxsize(700, 200) # Set

maximum size self.style = ttk.Style()

self.style.theme_use("clam") #

Choose a different theme if desired

9
self.converter =

CurrencyConverter()

# Amount

self.amount_label = ttk.Label(root, text="Amount:", style="MyLabel.TLabel",

font=("Arial",16), borderwidth=2, relief="solid") self.amount_label.grid(row=0,

column=0, padx=10, pady=10, sticky=tk.W) self.amount_entry = ttk.Entry(root,

style="MyEntry.TEntry", width=30) self.amount_entry.grid(row=0, column=1,

padx=10, pady=10)

# Frame for From Currency from_currency_frame = ttk.Frame(root)

from_currency_frame.grid(row=1, column=0, padx=5, pady=5, sticky=tk.W) #

Decreased gap

self.from_currency_label = ttk.Label(from_currency_frame, text="From


Currency:", style="MyLabel.TLabel")

self.from_currency_label.pack(side=tk.LEFT)

self.from_currency_combobox = ttk.Combobox(from_currency_frame,

state="readonly", height=3,style="NoDropdown.TCombobox")

self.from_currency_combobox.pack(side=tk.LEFT)

# Frame for To Currency


to_currency_frame = ttk.Frame(root)

to_currency_frame.grid(row=1, column=1, padx=5, pady=5, sticky=tk.W)

# Decreased gap self.to_currency_label = ttk.Label(to_currency_frame, text="To

Currency:",

10
style="MyLabel.TLabel") self.to_currency_label.pack(side=tk.LEFT)

self.to_currency_combobox =

ttk.Combobox(to_currency_frame,

state="readonly", height=3, style="NoDropdown.TCombobox")

self.to_currency_combobox.pack(side=tk.LEFT)

# Result

self.result_label = ttk.Label(root, text=" "

f ont=("Helvetica",12,"bold"), style="MyResult.TLabel")

self.result_label.grid(row=2, column=0, columnspan=2, pady=10)

# Convert Button

self.convert_button = ttk.Button(root,text="Convert",

command=self.perform_conversion, style="MyButton.TButton",="hand2")

self.convert_button.grid(row=3, column=0, columnspan=2, pady=10)

# Currency lists self.from_currency_list =

self.get_currency_list() self.to_currency_list =

self.get_currency_list()

# Listboxes and Scrollbars

self.from_currency_listbox=tk.Listbox(from_currency_frame,

selectmode=tk.SINGLE, exportselection=0, height=3, bg="lightblue")

self.from_currency_listbox.pack(side=tk.LEFT)

from_currency_scrollbar = ttk.Scrollbar(from_currency_frame, orient="vertical",

11
command=self.from_currency_listbox.yview)

from_currency_scrollbar.pack(side=tk.RIGHT, fill=tk.Y)

self.from_currency_listbox.config(yscrollcommand=from_currency_scrollbar.set)

self.from_currency_listbox.insert(tk.END, *self.from_currency_list)

self.from_currency_listbox.bind("<<ListboxSelect>>",

self.update_from_combobox)

self.to_currency_listbox=tk.Listbox(to_currency_frame,

selectmode=tk.SINGLE, exportselection=0, height=3, bg="lightblue")

self.to_currency_listbox.pack(side=tk.LEFT)

to_currency_scrollbar = ttk.Scrollbar(to_currency_frame, orient="vertical",

command=self.to_currency_listbox.yview)

to_currency_scrollbar.pack(side=tk.RIGHT, fill=tk.Y)

self.to_currency_listbox.config(yscrollcommand=to_currency_scrollbar.set)

self.to_currency_listbox.insert(tk.END, *self.to_currency_list)

self.to_currency_listbox.bind("<<ListboxSelect>>", self.update_to_combobox)

# Apply custom style to remove the dropdown arrow

self.style.layout("NoDropdown.TCombobox", [('Entry.combobox', {'children':

[('Entry.background', {'children': [('Entry.padding',{'children':[('Entry.textarea',


{

'sticky': 'nswe'})],

'sticky': 'nswe'})],

'sticky': 'nswe'})],

12
'sticky': 'nswe'})])

def get_currency_list(self):

# Add more currencies as needed, including Bitcoin

return ["USD", "INR", "IDR", "EUR", "GBP", "JPY", "GBP", "BRL", "THB",
"HKD", "AUD", "CAD", "CHF", "CNY", "SEK", "NZD", "BTC"]

def update_from_combobox(self, event):

selected_index = self.from_currency_listbox.curselection() if

selected_index:

selected_currency = self.from_currency_listbox.get(selected_index[0])

self.from_currency_combobox.set(selected_currency)

def update_to_combobox(self, event):

selected_index = self.to_currency_listbox.curselection() if

selected_index:

selected_currency = self.to_currency_listbox.get(selected_index[0])

self.to_currency_combobox.set(selected_currency) def

perform_conversion(self):

try:

amount = float(self.amount_entry.get())

from_currency = self.from_currency_combobox.get().upper() to_currency

= self.to_currency_combobox.get().upper()

if (from_currency != "BTC" and to_currency != "BTC"):

13
converted_amount = self.converter.convert(amount, from_currency,
to_currency)

else:
if (from_currency == "BTC" and to_currency != "BTC"):

converted_amount = BtcConverter().convert_btc_to_cur(amount,
to_currency)

if(from_currency!= "BTC" and to_currency == "BTC"):

converted_amount = BtcConverter().convert_to_btc(amount,
from_currency)

self.result_label.config(

text=f"{amount} {from_currency} is equal to {converted_amount:.2f}


{to_currency}")

except ValueError:

self.result_label.config(text="Please enter a valid number for the amount.")


if _name_ == "_main_":

root = ThemedTk(theme="clam") # Specify the theme you want app

= CurrencyConverterApp(root)

root.mainloop()

14
7) Test Your Application:

Run your Python file and test the currency converter application.

Make adjustments and refinements based on user experience

Testing and Error Handling

*Testing the Currency Conversion Functionality:-

Thoroughly testing the currency conversion functionality ensures accurate


results and provides a seamless user experience.

*Handling Errors and Exceptions

Implementing error handling mechanisms allows us to handle unexpected


scenarios and provide appropriate feedback to the user.

15
CHAPTER 3
Result

16
17
CHAPTER 4

CONCLUSION

18
CONCLUSION: -
.

The Currency Converter Application represents a significant contribution to the


realm of currency conversion tools, providing a user-friendly and efficient solution to
the challenges posed by global transactions and cross-border travel. Through the
seamless integration of Python libraries, including tkinter and forex-python, the
application achieves a harmonious balance between a sophisticated backend and an
accessible frontend.

The project's commitment to user experience is evident in the intuitive graphical


interface, where users can effortlessly navigate through input fields and dropdown
lists. The addition of ttkthemes not only enhances the visual appeal but also
contributes to a cohesive and polished design. By employing PyInstaller, the
application transcends traditional limitations, offering a stand-alone executable that
simplifies accessibility for users without compromising functionality.

The robustness of the Currency Converter Application is further underscored by its


error handling mechanisms, ensuring that users receive prompt notifications for any
invalid inputs. As a versatile tool, the project lays a solid foundation for future
enhancements. The potential for incorporating advanced features, such as historical
exchange rate tracking or real-time trend analysis, positions the application as a
dynamic and evolving resource for users engaged in the dynamic landscape of
international finance and travel.

In conclusion, the Currency Converter Application stands as a testament to the


intersection of technological innovation and practical utility. Its successful
implementation not only addresses the immediate needs of users requiring reliable
currency conversion but also opens avenues for continuous improvement and
expansion, reflecting a commitment to staying relevant in an ever-evolving global
landscape.

19
CHAPTER 5

SNAPSHOTS

20
STEP 1 :-Click on RUN

STEP 2 :- Enter amount and Select from and to Curriencies

STEP 3 :-Click on Convert.

21
“Same process for BITCOIN also”

22
CHAPTER 6

Featural scope( reference links )

Featural scope( reference links )

1) Tkinter Documentation:-

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

2)Youtube reference:-

https://youtube.com/playlist?list=PLCC34OHNcOtoC6GglhF3ncJ5rLwQrLGnV&si
=_CuYtTi7U88jf1Ec

23

You might also like