Skip to content

samyakjainx/CodeAlpha_Stock_Portfolio_Tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

17 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“ˆ CodeAlpha Stock Portfolio Tracker

Python Status License CodeAlpha Open Source

A simple yet powerful command-line Stock Portfolio Tracker built with Python that allows users to calculate their investment value using predefined stock prices and optionally generate a portfolio report.


๐Ÿ“– Project Overview

The Stock Portfolio Tracker is a command-line application developed as part of the CodeAlpha Python Programming Internship.

The application enables users to:

  • View available stock prices
  • Add multiple stocks to their portfolio
  • Calculate total investment value
  • Generate a detailed investment report
  • Save the report as a text file

This project demonstrates the practical implementation of Python dictionaries, loops, functions, conditional statements, file handling, and user input validation.


โœจ Features

โœ… Interactive command-line interface

โœ… View available stocks and prices

โœ… Add multiple stocks to a portfolio

โœ… Automatic portfolio value calculation

โœ… Detailed investment summary

โœ… Optional report generation (.txt)

โœ… User-friendly menu system

โœ… Input validation and error handling


๐Ÿ› ๏ธ Technologies Used

Technology Purpose
Python Core Programming Language
Dictionary Store stock prices
Functions Modular programming
Loops Menu navigation
Conditional Statements Decision making
File Handling Report generation
CLI User interaction

๐Ÿ“‚ Project Structure

CodeAlpha_Stock_Portfolio_Tracker/

โ”‚
โ”œโ”€โ”€ portfolio_tracker.py
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ LICENSE
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ .gitignore
โ”‚
โ”œโ”€โ”€ screenshots/
โ”‚   โ”œโ”€โ”€ menu.png
โ”‚   โ”œโ”€โ”€ stocks.png
โ”‚   โ”œโ”€โ”€ report.png
โ”‚   โ””โ”€โ”€ save_report.png
โ”‚
โ””โ”€โ”€ assets/
    โ””โ”€โ”€ demo.gif

๐Ÿš€ Getting Started

Clone the Repository

git clone https://github.com/samyakjainx/CodeAlpha_Stock_Portfolio_Tracker.git

Navigate to the Project Folder

cd CodeAlpha_Stock_Portfolio_Tracker

Run the Program

python portfolio_tracker.py

๐Ÿ’ป Usage

Main Menu

===================================
   STOCK PORTFOLIO TRACKER MENU
===================================

1. View Available Stocks & Prices

2. Calculate Total Investment

3. Exit Program

===================================

Available Stocks

AAPL : $180

TSLA : $250

GOOG : $150

MSFT : $420

AMZN : $175

Portfolio Report

****************************************

         YOUR INVESTMENT REPORT

****************************************

AAPL : 5 shares x $180 = $900

TSLA : 2 shares x $250 = $500

----------------------------------------

Total Portfolio Value : $1400

****************************************

๐Ÿ“ธ Screenshots

Main Menu

menu
screenshots/menu.png

Available Stocks

stocks
screenshots/stocks.png

Portfolio Report

report
screenshots/report.png

Report Saved Successfully

save_report
screenshots/save_report.png

๐ŸŽฅ Demo

demo
assets/demo.gif

๐ŸŽฏ Learning Outcomes

This project helped in understanding:

  • Python dictionaries

  • Functions and modular programming

  • Loops and menu-driven applications

  • Conditional statements

  • File handling

  • User input validation

  • Basic financial calculations

  • Command-line application development


๐Ÿ“„ Sample Report File

=== CODEALPHA STOCK PORTFOLIO REPORT ===

AAPL: 5 shares x $180 = $900

TSLA: 2 shares x $250 = $500

----------------------------------------

Total Portfolio Value: $1400

๐Ÿ”ฎ Future Improvements

Some exciting features that can be added in future versions:

  • ๐Ÿ“ก Live stock prices using APIs

  • ๐Ÿ“Š Portfolio performance charts

  • ๐Ÿ“ CSV and Excel export support

  • ๐Ÿ’พ Database integration

  • ๐Ÿ” Search and edit portfolio

  • ๐Ÿ–ฅ๏ธ GUI version using Tkinter or PyQt

  • ๐ŸŒ Web version using Flask or Django


๐Ÿค Contributing

Contributions are welcome!

If you'd like to improve this project:

  1. Fork the repository

  2. Create a new branch

  3. Make your changes

  4. Commit your changes

  5. Open a Pull Request


๐Ÿ‘จโ€๐Ÿ’ป Author

Samyak Jain

AI & ML Enthusiast | Python Developer | Open Source Learner

GitHub: https://github.com/samyakjainx/

LinkedIn: https://www.linkedin.com/in/samyakjain-ai/


๐Ÿ“œ License

This project is licensed under the MIT License.

Feel free to use, modify, and distribute this project for educational purposes.


โญ Support

If you found this project helpful, consider giving it a โญ Star on GitHub.

It motivates me to build and share more open-source projects.


Made with โค๏ธ using Python

About

A Python-based Stock Portfolio Tracker that calculates investment values using predefined stock prices and generates portfolio reports with optional file export functionality.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages