The Currency Converter project allows you to convert from one currency to another with real-time exchange rates. It is built using Python and Exchange Rate Api that provides accurate and reliable currency conversion rates for 161 currencies. It provides integration for SaaS, Dashboards, and E-Commerce with exceptional uptime and support.
- Code
- UML Diagrams
- Requirements Engineering
- Analysis
- DDD
- Metrics
- Clean Code Development
- Build Management
- Unit Tests
- IDE
- Functional Programming
To access the code: Currency Conversion Code
- The activity diagram showcases a user-driven process, starting with entering source currency followed by target currency and then the amount. Once the valid data is entered, the conversion process is triggered and the converted amount with the applied exchange rate is displayed.
- Activity Diagram
- The use case diagram outlines how the users interact with the system. Users initiate the currency conversion process by specifying source currency, target currency and amount, while the system performs conversions and provides the results.
- Use Case Diagram
- The class diagram represents classes like Currency Converter, Currency Rates, GUI and Error Handling elements, illustrating their relationships and interactions in facilitating user input, data retrieval, and conversion processes within the application.
- Class Diagram
- Currency Conversion
- Real-Time Exchange Rates
- Graphical User Interface (GUI)
- User Input Handling
- Transaction History
- Performance
- User Experience (UX)
- Reliability
- Maintainability
- Quality Assurance
- Tasklist Screenshot
- Kanban Board Screenshot
You can find my Analysis for the Semester Project here
Domain-Driven Design (DDD) is an approach to software development that centers around a deep understanding of the business domain. PDF
Clean Code Development (CCD) focuses on writing code that is easy to read, understand, and maintain. PDF
Build management for the Currency Conversion project has been implemented using Github Actions
The unit tests has been done in 2 parts and is written using the unittest framework in Python.
- TestRealTimeCurrencyConverter: This is a test case class that inherits from 'unittest.TestCase'. It contains test methods for the 'RealTimeCurrencyConverter' class.
- test_get_exchange_rates: Checks if the 'get_exchange_rates' method of 'RealTimeCurrencyConverter' returns valid data.
- test_convert: Checks if the 'convert' method of 'RealTimeCurrencyConverter' behaves as expected.
- test_get_exchange_rates: Checks if the API request to obtain exchange rates for USD is successful and if the returned data contains the 'rates' key.
- test_convert: Tests the currency conversion functionality by converting 1 unit of USD to INR, ensuring that the result is not None and is of type float.
- TestCurrencyConverterApp: This is another test case class for the 'CurrencyConverterApp' class.
- setUp: A special method that is run before each test method. It creates instances of 'RealTimeCurrencyConverter' and 'CurrencyConverterApp'.
- test_restrict_number_only: Checks the 'restrict_number_only' method of 'CurrencyConverterApp' for different input cases.
- The main block ensures that if the script is run directly (not imported as a module), the 'unittest.main()' function is called, which discovers and runs the tests.
I have used Visual Studio Code IDE, mentioned below are my few favorite shortcuts:
- F5 : Run and Debug
- Ctrl + ] / Ctrl + [ : Indentation
- Ctrl + / : Comment/Uncomment code lines
- Ctrl + B : Show or hide the sidebar
- Ctrl + Shift + P : Open the command palette
In my Currency Conversion code, certain functional programming principles are applied. Here's how the code adheres to these principles:
-
Final Data Structures: The 'data' attribute in RealTimeCurrencyConverter is initialized with the final result of the API call ('response.json()'), representing exchange rates. It remains unmodified afterward.
-
Side-Effect-Free Functions: The get_exchange_rates function has no side effects, performing an HTTP GET request and returning the JSON response without modifying external state. The convert method is also side-effect-free.
-
Higher-Order Functions: The requests.get function in 'get_exchange_rates' is a higher-order function, taking a URL as an argument and returning a function ('get') that performs an HTTP GET request.
-
Functions as Parameters and Return Values: The 'convert' method takes parameters and returns a calculated value. Button widgets use functions like perform_conversion and show_transaction_history as parameters for the 'command' attribute.
-
Closures / Anonymous Functions: While 'lambda' functions are not explicitly used, functions passed to the command attribute of buttons can be considered as anonymous functions.