Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ˆ Stock Portfolio Tracker

A menu-driven Stock Portfolio Tracker developed in Python as part of the CodeAlpha Python Programming Internship.

This application helps users manage their stock investments by adding, removing, and updating stock holdings while calculating portfolio value and profit/loss. It also allows exporting reports in TXT or CSV format and automatically saves portfolio data between sessions.


✨ Features

  • πŸ“Š View available stocks and their prices
  • βž• Add (buy) stocks
  • βž– Remove (sell) stocks
  • πŸ’Ή Update stock prices
  • πŸ“ˆ Calculate total portfolio value
  • πŸ’° Track profit and loss (per stock and overall)
  • πŸ“‰ Visual portfolio allocation chart (ASCII bar chart)
  • πŸ“‚ Automatic portfolio data saving using JSON
  • πŸ“„ Export portfolio reports in TXT or CSV format
  • 🎨 Optional colored terminal interface (works without Colorama as well)
  • βœ… Input validation and user-friendly menu

πŸ› οΈ Technologies Used

  • Python 3
  • JSON
  • CSV
  • Datetime
  • OS Module
  • Colorama (Optional)

πŸ“‚ Project Structure

CodeAlpha_StockPortfolioTracker/
│── stock_portfolio_tracker.py
│── README.md
│── .gitignore

Note: portfolio_data.json is created automatically the first time you run the app (it stores your personal portfolio data). It is not included in the repository β€” see .gitignore.


▢️ How to Run

  1. Make sure Python 3 is installed.
  2. Download or clone this repository.
  3. Open the project folder in your terminal.
  4. Run the following command:
python stock_portfolio_tracker.py

Optional: Install Colorama for a colored terminal interface.

pip install colorama

The application also works correctly without Colorama (plain text mode).


🎯 Learning Outcomes

This project demonstrates the use of:

  • Dictionaries
  • Functions
  • Loops
  • Conditional Statements
  • File Handling (JSON & CSV)
  • Exception Handling
  • Modular Programming
  • User Input Validation

πŸ‘©β€πŸ’» Developed By

Saleha Shahid BS Electrical Engineering University of Management and Technology (UMT)


πŸ“Œ Internship

CodeAlpha – Python Programming Internship

About

A Python-based Stock Portfolio Tracker developed for the CodeAlpha Python Programming Internship.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages