{"id":28863141,"url":"https://github.com/prajwalamte/quantscope","last_synced_at":"2026-05-18T06:02:40.993Z","repository":{"id":299950007,"uuid":"1004706063","full_name":"PrajwalAmte/QuantScope","owner":"PrajwalAmte","description":"A Streamlit-based stock analysis application with real-time data, technical indicators, interactive charts, and AI-powered insights for global markets.","archived":false,"fork":false,"pushed_at":"2025-06-19T04:08:32.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-19T05:22:28.270Z","etag":null,"topics":["artificial-intelligence","langchain","llm","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PrajwalAmte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-19T04:02:43.000Z","updated_at":"2025-06-19T04:09:42.000Z","dependencies_parsed_at":"2025-06-19T05:22:30.533Z","dependency_job_id":"c1631d14-f840-476c-8c92-c8fe6303dd38","html_url":"https://github.com/PrajwalAmte/QuantScope","commit_stats":null,"previous_names":["prajwalamte/quantscope"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PrajwalAmte/QuantScope","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrajwalAmte%2FQuantScope","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrajwalAmte%2FQuantScope/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrajwalAmte%2FQuantScope/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrajwalAmte%2FQuantScope/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PrajwalAmte","download_url":"https://codeload.github.com/PrajwalAmte/QuantScope/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrajwalAmte%2FQuantScope/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001947,"owners_count":26083226,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["artificial-intelligence","langchain","llm","python"],"created_at":"2025-06-20T07:02:01.217Z","updated_at":"2026-05-18T06:02:40.986Z","avatar_url":"https://github.com/PrajwalAmte.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QuantScope\n\n\u003cdiv align=\"center\"\u003e\n\n[![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)\n[![Streamlit](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://streamlit.io)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n**AI-Powered Stock Analysis Platform — Bring Your Own Key**\n\nA modern Streamlit-based stock analysis application with real-time data, technical indicators, interactive charts, and AI-powered insights using your own API keys.\n\n[Features](#features) • [Quick Start](#quick-start) • [Architecture](#architecture) • [Usage](#usage)\n\n\u003c/div\u003e\n\n---\n\n## Overview\n\nQuantScope is a **bring-your-own-key (BYOK)** platform designed for independent traders and analysts. No shared API quotas, no rate limits imposed by the platform — you control your own infrastructure with your API keys.\n\n- **Real-time data** via Yahoo Finance (free, no key required)\n- **AI analysis** via your choice of Groq, OpenAI, Anthropic, or Ollama (bring your own key)\n- **Multi-market support** across 9 global exchanges\n- **Type-safe codebase** with full type hints and modern Python patterns\n- **Production-ready logging** and error handling\n\n## Features\n\n- **Multi-Market Support**: US, Indian, UK, Canada, Australia, Germany, France, Japan, Hong Kong\n- **Real-Time Data**: Live stock prices via Yahoo Finance API\n- **Technical Analysis**: RSI (14), SMA (20/50), Bollinger Bands\n- **Interactive Charts**: \n  - Price charts (line \u0026 candlestick)\n  - Volume analysis\n  - Technical indicators overlay\n  - RSI signals\n- **AI Chat Interface**: Ask questions about stocks using your choice of Groq, OpenAI, Anthropic, or local Ollama models (bring your key)\n- **Smart Parsing**: Natural language queries like \"AAPL 3 months\"\n- **Data Export**: Download analysis data as CSV\n\n## Quick Start\n\n### 1. Clone \u0026 Setup\n\n```bash\ngit clone https://github.com/yourusername/QuantScope.git\ncd QuantScope\npython -m venv venv\nsource venv/bin/activate  # On Windows: venv\\Scripts\\activate\npip install -r requirements.txt\n```\n\n### 2. Configure API Key\n\nChoose a provider and get your key:\n- **Groq** (free tier available): [console.groq.com](https://console.groq.com)\n- **OpenAI**: [platform.openai.com/api-keys](https://platform.openai.com/api-keys)\n- **Anthropic**: [console.anthropic.com](https://console.anthropic.com/settings/keys)\n- **Ollama** (local, no key needed): [ollama.com](https://ollama.com/download)\n\n**Option A: Session Input (Recommended)**\n- Run the app: `streamlit run main.py`\n- Select provider and enter your API key in the sidebar\n- Key stays for the session only\n\n**Option B: Environment Variable**\n```bash\ncp .env.example .env\n# Edit .env and fill in the keys you want to use\nstreamlit run main.py\n```\n\n### 3. Run\n\n```bash\nstreamlit run main.py\n```\n\nThe app opens at `http://localhost:8501`\n\n## Architecture\n\n```mermaid\ngraph TD\n    subgraph UI[\"Streamlit UI\"]\n        SB[Sidebar\\nProvider · Model · API Key · Test Connection]\n        IN[Main Input\\nStock query · Market selector]\n        CH[Charts\\nPrice · Technical · RSI · Volume]\n        AI[AI Chat\\nPersistent below charts]\n    end\n\n    subgraph Logic[\"Application Layer\"]\n        SA[StockAnalyzer\\nFetch · Indicators · Charts · Metrics]\n        AK[APIKeyManager\\nSession state · Provider routing]\n        MR[MarketRegistry\\nSuffix · Currency config]\n        PR[PROVIDERS dict\\nGroq · OpenAI · Anthropic · Ollama]\n        BL[_build_llm\\ncached LLM factory]\n    end\n\n    subgraph External[\"External Services\"]\n        YF[Yahoo Finance\\nFree · No key required]\n        GR[Groq API]\n        OA[OpenAI API]\n        AN[Anthropic API]\n        OL[Ollama\\nLocal]\n    end\n\n    SB --\u003e AK\n    IN --\u003e SA\n    SA --\u003e MR\n    CH --\u003e SA\n    AI --\u003e BL\n    AK --\u003e PR\n    PR --\u003e BL\n    SA --\u003e YF\n    BL --\u003e GR\n    BL --\u003e OA\n    BL --\u003e AN\n    BL --\u003e OL\n```\n\n### Key Design Decisions\n\n- **MarketRegistry**: Centralized market configuration (no magic strings scattered across the codebase)\n- **APIKeyManager**: Session-based key management (secure by default, never stored server-side)\n- **PROVIDERS dict**: Single source of truth for all LLM providers, models, and API endpoints\n- **`_build_llm()` with `@st.cache_resource`**: LLM instances are cached by (provider, credential, model) tuple — avoids re-initialising on every rerun\n- **`_self` in `@st.cache_data`**: Streamlit cannot hash `self`; prefixing with underscore tells the cache to exclude it\n- **Type Hints**: Full coverage for IDE support and documentation\n- **Caching**: `@st.cache_data(ttl=300)` on stock fetches — 5-minute TTL balances freshness and rate limits\n\n## Usage\n\n### Example Queries\n\n**Natural Language Parsing**\n```\nInput: \"AAPL 6 months\"\nOutput: Apple stock analysis | 6-month period\n\nInput: \"RELIANCE\"\nOutput: Reliance Industries | 3-month default\n```\n\n**Manual Input**\n- Use Advanced Settings to specify exact symbol, market, and period\n\n### Supported Markets \u0026 Symbols\n\n| Market | Suffix | Currency | Example |\n|--------|--------|----------|---------|\n| **US** | (none) | $ | `AAPL` |\n| **Indian** | `.NS` | ₹ | `RELIANCE` |\n| **UK** | `.L` | £ | `VODL` |\n| **Canada** | `.TO` | C$ | `SHOP` |\n| **Australia** | `.AX` | A$ | `CBA` |\n| **Germany** | `.DE` | € | `SAP` |\n| **France** | `.PA` | € | `MC` |\n| **Japan** | `.T` | ¥ | `7203` |\n| **Hong Kong** | `.HK` | HK$ | `0700` |\n\n### Technical Indicators\n\n- **RSI (14-period)**: Overbought (\u003e70), Neutral (30-70), Oversold (\u003c30)\n- **SMA**: 20-period (short-term) and 50-period (mid-term) trends\n- **Bollinger Bands**: 20-period with 2 standard deviations\n\n## BYOK Model\n\nQuantScope is designed for users who want complete control over their API usage:\n\n### Why BYOK?\n- **No quota limits** imposed by the platform\n- **Cost transparency** — you pay only for what you use\n- **Data privacy** — your keys, your data\n- **Flexibility** — upgrade/downgrade Groq plans independently\n\n### API Key Security\n- Keys stored **in-session only** (not persisted to server)\n- Optional browser localStorage for convenience (your domain, your storage)\n- No server-side key storage\n- Clear deletion when session ends\n\n## Development\n\n### Code Standards\n- **Type Hints**: Full coverage (`mypy` compatible)\n- **Logging**: All major operations logged at INFO level\n- **Error Handling**: Graceful degradation with user-friendly messages\n- **Docstrings**: Google-style format on all functions and classes\n\n### Testing\n```bash\n# Lint\nblack main.py\n\n# Type check\nmypy main.py --ignore-missing-imports\n```\n\n### Project Structure\n```\nQuantScope/\n├── main.py                 # Application entry point\n├── requirements.txt        # Python dependencies\n├── .streamlit/\n│   └── config.toml        # Streamlit configuration\n├── .env.example           # Environment variables template\n└── README.md              # This file\n```\n\n## Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| \"No data found\" | Check symbol format and correct market suffix |\n| \"AI Chat unavailable\" | Enter valid Groq API key in sidebar. Get one free at console.groq.com |\n| Charts not rendering | Verify internet connection and Plotly installation |\n| Slow data fetching | First load caches for 5 minutes. Yahoo Finance may rate-limit. |\n\n## Dependencies\n\n```\nCore:\n- streamlit        Web app framework\n- yfinance         Yahoo Finance API wrapper (free)\n- plotly           Interactive charts\n- pandas           Data manipulation\n- numpy            Numerical computing\n\nAI:\n- langchain-groq       Groq integration\n- langchain-openai     OpenAI integration\n- langchain-anthropic  Anthropic integration\n- langchain-ollama     Local Ollama integration\n- langchain            LLM orchestration\n\nConfiguration:\n- python-dotenv    Environment variable management\n```\n\n## Disclaimer\n\n**Educational Use Only**. QuantScope is a data and analysis tool, not financial advice. Always conduct independent research and consult qualified financial advisors before making investment decisions.\n\n## License\n\nMIT License — see [LICENSE](LICENSE) file for details.\n\n## Contributing\n\nContributions welcome! Please:\n1. Fork the repository\n2. Create a feature branch\n3. Submit a pull request with description\n4. Ensure code follows black/mypy standards\n\n## Roadmap\n\n- [ ] Watchlist persistence (Streamlit cloud)\n- [ ] Portfolio tracking\n- [ ] Alert notifications\n- [ ] Extended technical indicators (MACD, Stochastic)\n- [ ] Options analysis\n- [ ] Mobile responsiveness optimization\n\n## Support\n\n- **Issues**: GitHub Issues\n- **Documentation**: See [docs/](docs/) folder\n- **API Help**: [Groq Console](https://console.groq.com) | [yfinance Docs](https://yfinance.readthedocs.io)\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\nBuilt by Prajwal Amte\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprajwalamte%2Fquantscope","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprajwalamte%2Fquantscope","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprajwalamte%2Fquantscope/lists"}