这是一个基于akshare库的美股数据分析工具,支持交互式查询任意美股股票代码,并生成可视化图表。该项目从IBM数据科学专业课程的Jupyter notebook重构而来,转换为独立的Python脚本,并增强了交互性和错误处理能力。
- 🚀 简单易用: 交互式命令行界面,输入股票代码即可分析
- 📊 数据可视化: 使用Plotly生成交互式股票价格走势图
- 🔧 智能适配: 自动处理不同数据源的列名格式
- 🌐 网络友好: 使用akshare库,解决了yfinance在中国大陆的网络问题
- ⚡ 错误处理: 完善的异常处理机制,提升用户体验
- 📈 实时数据: 获取最新的美股历史数据
- 数据获取: akshare
- 数据处理: pandas
- 数据可视化: Plotly
- 开发语言: Python 3.x
pip install akshare pandas plotly- 克隆仓库:
git clone https://github.com/ColdSpellhere/StockAnalysis_akshare.git
cd StockAnalysis_akshare- 运行程序:
python stock_analysis_akshare.py- 输入股票代码(如TSLA, AAPL, GME等)并回车
支持所有在akshare库中可查询的美股股票代码,包括但不限于:
- TSLA (特斯拉)
- AAPL (苹果)
- GME (GameStop)
- MSFT (微软)
- GOOGL (谷歌)
- AMZN (亚马逊)
本项目基于作者在Coursera完成的IBM数据科学专业课程第四节实践作业进行重构:
主要改进:
- 使用akshare库替代yfinance,解决网络访问问题
- 增加交互式用户输入支持
- 简化数据获取流程,移除手动网页抓取
- 增强错误处理和用户体验
本项目采用 MIT 许可证 - 详见 LICENSE 文件
- Coldspell - 项目作者
- 协助工具: Claude Sonnet 4.5
This is a US stock data analysis tool based on the akshare library, supporting interactive querying of any US stock symbol and generating visualization charts. This project is refactored from a Jupyter notebook from IBM's Data Science Professional Certificate course, converted to a standalone Python script with enhanced interactivity and error handling.
- 🚀 Easy to Use: Interactive command-line interface, analyze stocks by simply entering symbols
- 📊 Data Visualization: Generate interactive stock price charts using Plotly
- 🔧 Smart Adaptation: Automatically handles different column name formats from various data sources
- 🌐 Network Friendly: Uses akshare library, solving yfinance network issues in mainland China
- ⚡ Error Handling: Comprehensive exception handling for better user experience
- 📈 Real-time Data: Access to latest US stock historical data
- Data Retrieval: akshare
- Data Processing: pandas
- Data Visualization: Plotly
- Programming Language: Python 3.x
pip install akshare pandas plotly- Clone the repository:
git clone https://github.com/ColdSpellhere/StockAnalysis_akshare.git
cd StockAnalysis_akshare- Run the program:
python stock_analysis_akshare.py- Enter a stock symbol (e.g., TSLA, AAPL, GME) and press Enter
Supports all US stock symbols available in the akshare library, including but not limited to:
- TSLA (Tesla)
- AAPL (Apple)
- GME (GameStop)
- MSFT (Microsoft)
- GOOGL (Google)
- AMZN (Amazon)
This project is refactored from the author's practice assignment in the IBM Data Science Professional Certificate Course 4 on Coursera:
Key Improvements:
- Replaced yfinance with akshare library to solve network access issues
- Added interactive user input support
- Simplified data retrieval process, removed manual web scraping
- Enhanced error handling and user experience
This project is licensed under the MIT License - see the LICENSE file for details
- Coldspell - Project Author
- Assistant Tool: Claude Sonnet 4.5
Interactive stock price chart generated by the tool
Happy Analyzing! 📈