StockMind is a Stock peer competitor and Stock Analysis tool that identifies peer competitors for a company and fetches its live stock prices.
✅ Competitor Analysis – Uses Gemini LLM to find peer competitors based on the company's industry.
✅ Real-Time Stock Prices – Fetches live stock data using the yfinance library.
✅ Automated Ticker Retrieval – Extracts the stock ticker symbol from Alpha Vantage API.
✅ Company Information Fetching – Uses Wikipedia API to gather company details.
✅ US Market Focused – Currently designed for United States stock exchanges.
- Python 🐍
- Wikipedia API – Fetches company descriptions
- Gemini LLM – Identifies peer competitors
- Alpha Vantage API – Retrieves stock ticker symbols
- yfinance – Fetches real-time stock prices
1️⃣ Clone the repository:
git clone https://github.com/sharathchandra-patil/StockMind.git
cd StockMind
2️⃣ Install dependencies:
pip install -r requirements.txt
3️⃣ Set up API keys:
- Get an Alpha Vantage API Key from Alpha Vantage.
- Store it in an
.env
file or set it in your environment variables:
ALPHA_VANTAGE_API_KEY=your_api_key
Run the script and input a company name:
python stockmind.py
Example Output:
Company: Apple Inc. (AAPL)
Industry: Technology
Peer Competitors: Microsoft, Google, Amazon
Current Stock Price: $180.32
When the user runs the script and inputs a company name, the following sequence of operations occurs, and the corresponding output is displayed:
-
📄 Company Description
- The system fetches a concise summary of the company from Wikipedia using the Wikipedia API.
- This description helps identify all business domains the company operates in (e.g., Tesla → automotive, battery tech, aerospace, AI).
-
🧠 Multi-Sector Peer Analysis
- The Wikipedia summary is sent to the Gemini LLM, which determines the sectors the company is involved in.
- For each sector, it returns a list of peer competitors relevant to that domain.
-
🔍 Ticker Symbol Extraction
- The Alpha Vantage API is used to extract the official stock ticker symbol of the company (e.g., Tesla → TSLA).
-
📈 Real-Time Stock Data
- The yfinance library fetches the current live stock price of the entered company.
- It also retrieves 3 months of historical stock price data for all competitors identified by the LLM.
-
🏆 Top 3 Competitors by Market Cap
- From the pool of peer competitors across all sectors, the top 3 are selected based on their market capitalization.
-
📊 Visual Graph Output
- A line chart is rendered showing the 3-month price trend of the top 3 competitors for visual comparison.
🔎 Example Output
Company: Tesla, Inc. (TSLA)
Wikipedia Summary: Tesla is an American multinational automotive and clean energy company that designs and manufactures electric vehicles, battery energy storage, solar panels, and more.
Identified Sectors:
- Automotive
- Battery Technology
- Aerospace
- Artificial Intelligence
Peer Competitors by Sector:
- Automotive: Ford, GM, Lucid
- Battery Tech: CATL, Panasonic, LG Chem
- Aerospace: Rocket Lab, Blue Origin
- AI: Waymo, Nvidia, Cruise
Current Stock Price: $167.44
Top 3 Competitors by Market Cap:
1. Nvidia (NVDA)
2. Ford (F)
3. Panasonic (PCRFY)
[Line chart showing 3-month stock trends of NVDA, F, PCRFY]
This layered output gives users a holistic and sector-aware view of a company’s competitive environment, backed by real-time financial insights and AI-powered analysis.
Contributions are welcome! Feel free to fork the repo and submit a pull request.
We welcome contributions from everyone! 🚀
If you're new to open-source, you can start with our Good First Issues.
- Fork this repository.
- Clone your forked repo locally.
- Create a new branch for your feature or fix.
- Make your changes.
- Test your changes locally.
- Commit your changes with a clear message.
- Push your branch and open a Pull Request (PR) to the
main
branch. - Wait for review and feedback!
- Solve an open Good First Issue
- Fix bugs
- Improve project documentation
- Add new features (Check open Feature Requests)
- Optimize performance or UI
📢 Need help? Open a Discussion or raise an Issue! We're happy to assist you.
- Fork this repository and clone it to your local machine.
- Create a new branch for your feature or bug fix.
- Write clear, concise commit messages.
- Ensure your code follows proper Python coding standards (use tools like
flake8
if needed). - Test your code properly before submitting a Pull Request (PR).
- Reference the related Issue ID (if applicable) in your PR description.
- Open a Pull Request and fill out the provided template.
- Be respectful in discussions and reviews — constructive feedback helps everyone!
- Sharathchandra Patil
- Srajan VN
- Srinandan M
- Vikas NR
This project is licensed under the MIT License.