0% found this document useful (0 votes)
4 views2 pages

Arun Kumar 2

Uploaded by

hhop9051
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)
4 views2 pages

Arun Kumar 2

Uploaded by

hhop9051
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/ 2

ABSTRACT

This script implements a simple currency converter bot that utilizes the Exchange Rate-API to
fetch the latest exchange rates. The bot allows users to convert a specified amount of one currency to
another through a command-line interface. It supports a wide range of currencies and provides a
user-friendly interaction experience. The script demonstrates a basic application of API
integration and data processing in Python
Key Features of a Chatbot :-
1. Real-Time Exchange Rates: The bot fetches the latest exchange rates from the
Exchange Rate-API, ensuring accurate currency conversion.
2. Multi-Currency Support: Users can convert between various currencies, as long as
the currency codes are valid and available in the fetched rates.
3. User -Friendly Interface: The bot provides a simple command-line interface that
allows users to input their conversion requests in an easy-to-understand format.
4. Error Handling: The bot includes error handling for invalid currency codes and
incorrect input formats, guiding users to provide the correct information.
5. Conversion Logic: The conversion process first converts the input amount to USD (as
a base currency) and then to the target currency, ensuring accurate calculations.
6. Exit Option: Users can exit the program gracefully by typing 'exit', enhancing the
overall user experience.
7. Modular Design: The bot is structured in a way that separates the concerns of
fetching exchange rates, converting currencies, and handling user interactions, making it
easy to maintain and extend.
PROJECT MODULES

DESIGN AND ARCHITECTURE :-


The architecture of the Currency Converter Bot is built around a single class that handles all
functionalities, making it modular and easy to maintain. The bot interacts with an external API to
fetch real-time exchange rates and processes user input to perform currency conversions. The
architecture can be broken down into several key components:
1. User Interface Layer: This layer consists of the command-line interface that allows
users to interact with the bot, inputting their conversion requests and receiving results.
2. Business Logic Layer: This layer contains the core functionality of the bot, including
methods for fetching exchange rates and converting currencies. It processes the user input,
performs calculations, and handles errors.
3. Data Access Layer: This layer is responsible for interacting with the Exchange Rate-
API to retrieve the latest currency exchange rates. It abstracts the details of API
communication and data retrieval.

How it works:
1. Initialization: When the bot is initialized, it fetches the latest exchange rates from the
API and stores them in a dictionary for quick access.
2. User Interaction: The bot prompts the user to enter a conversion request in a specific
format. It continues to accept input until the user decides to exit.
3. Input Parsing: The bot parses the user input to extract the amount, source currency,
and target currency.
4. Currency Conversion: The bot checks if the provided currency codes are valid. If
they are, it converts the specified amount from the source currency to USD, and then from
USD to the target currency using the fetched rates.
5. Output: The converted amount is displayed to the user, formatted to two decimal
places. If there are errors (e.g., invalid currency codes or incorrect input format), the bot
provides appropriate feedback.

You might also like