Skip to content

A Python console application that tracks live Cryptocurrency, Forex, and Metals Prices using APIs. Built as my CS50 Introduction to Programming with Python final project.

Notifications You must be signed in to change notification settings

AkilSweidan/CS50-Python-Final-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Crypto, Forex, and Metals Tracker

Description:

This project is a Python-based console application designed to track the prices and market information of cryptocurrencies, foreign exchange rates, and precious metals. The program allows users to choose which financial instrument they want to monitor and displays the relevant information in a clear and organized manner using formatted tables and colored text outputs. The primary goal of this project was to combine practical Python programming skills with API integration, data formatting, and user interaction design to create a functional and visually appealing console application.

The project consists of three main files: project.py, test_project.py, and requirements.txt. The project.py file contains the core logic of the application, including the main() function that drives user interaction, API functions for fetching data, and additional helper functions to handle formatting and conversions. The test_project.py file contains unit tests for three key helper functions: format_price, convert_usd_to_xau, and build_table. These tests ensure that critical parts of the program are functioning correctly and adhere to CS50’s requirement of testing at least three functions. Finally, the requirements.txt file lists all external dependencies required to run the project, including requests for API calls, tabulate for table formatting, colorama for colored console output, and pytest for testing.

When the program is executed, the user is presented with a menu to choose between tracking cryptocurrencies, forex rates, or metals. For cryptocurrencies, the program retrieves live data from the CoinGecko API and displays the top coins by market capitalization in a formatted table. For forex, the program uses the FastForex API to convert USD to other currencies, such as EUR or CAD. For metals, the program retrieves gold and silver prices via the GoldAPI. Additionally, the program includes a small conversion function that can calculate how much of a metal (in ounces) can be purchased with a given amount of USD, demonstrating practical applications of financial data.

The design choices for this project were focused on clarity, usability, and modularity. Each external API interaction is encapsulated within its own function to separate concerns and make the code easier to maintain. The helper functions, such as format_price and build_table, improve code readability and also provide functionality that can be tested independently. I chose to include color-coded output using colorama to enhance the user experience, making it easier to distinguish between different sections of data. Additionally, the program is fully interactive, with clear instructions and input validation to prevent errors and guide the user through the available options.

During the development process, I debated whether to include additional features such as historical price charts, multi-currency conversions, or automatic updates. Ultimately, I decided to keep the project focused on live tracking and conversions to ensure the program remained simple, functional, and testable within the scope of the CS50 final project. This decision allowed me to focus on implementing a robust, well-structured application with clear code and fully functional tests.

Overall, this project demonstrates proficiency in Python programming, API integration, data formatting, testing, and user interface design in a console environment. The resulting application is both practical and educational, providing users with real-time financial information in an accessible and visually appealing format.

About

A Python console application that tracks live Cryptocurrency, Forex, and Metals Prices using APIs. Built as my CS50 Introduction to Programming with Python final project.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages