Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Stock Portfolio Tracker

Python Project Status CodeAlpha

A practical console-based Stock Portfolio Tracker built with Python.
Calculate investment values based on predefined stock prices and securely store portfolio records.


📖 Overview

The Stock Portfolio Tracker is a lightweight Python application designed to help users calculate the total value of their stock investments.

The program uses a predefined dictionary containing stock prices and allows users to enter stock symbols along with quantities owned. Based on the provided input, it computes the total investment value and stores the transaction details in an external text file for future reference.

This project demonstrates essential Python programming concepts such as dictionary operations, file handling, input processing, and basic financial calculations.


✨ Features

  • Predefined Stock Price Database using a hardcoded dictionary of stock values.
  • Case-Insensitive Ticker Input allowing users to enter stock symbols in any letter case.
  • Automatic Investment Calculation to instantly determine total portfolio value.
  • Persistent Record Storage by saving portfolio details to portfolio.txt.
  • Input Validation that gracefully handles unavailable stock symbols.

🖥️ Application Preview

Terminal Interface

Enter stock name: aapl
Enter quantity: 6

Total investment value: 1080
Result saved in portfolio.txt

Sample Output (portfolio.txt)

Stock: AAPL
Quantity: 6
Investment Value: 1080

🛠️ Tech Stack

Technology Purpose
Python 3 Core programming language
Dictionaries Store stock prices and mappings
File I/O Save portfolio records permanently
Type Casting Process and validate user inputs

📂 Project Structure

Task2_Stock Portfolio Tracker/
│
├── main.py           # Main application script
├── portfolio.txt     # Stores portfolio records
└── README.md         # Project documentation

🚀 Getting Started

1️⃣ Clone the Repository

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

2️⃣ Navigate to the Project Directory

cd CodeAlpha_Stock_Portfolio_Tracker

3️⃣ Run the Application

python main.py

📚 Concepts Demonstrated

This project showcases several fundamental Python concepts, including:

  • Dictionary Data Structures
  • User Input Handling
  • String Manipulation (.upper())
  • Type Conversion (int())
  • Conditional Statements (if-else)
  • Basic Arithmetic Operations
  • File Handling using with open()
  • Data Persistence using Append Mode ("a")

🎓 Internship Information

This project was completed as Task 2 of the Python Programming Internship offered by CodeAlpha.


👩‍💻 Author

Aqsa Jamali

GitHub


⭐ If you found this project useful, consider giving it a star!