time-series-insight-assistant


Nametime-series-insight-assistant JSON
Version 0.1.2 PyPI version JSON
download
home_pageNone
Summary一个智能的时间序列分析助手,提供自动模型识别、参数估计和可视化诊断功能
upload_time2025-07-21 12:09:00
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT
keywords analysis arima forecasting statistics time-series
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [English](README_EN.md) | [中文](README.md)

# 时间序列洞察助手 (Time Series Insight Assistant)

🔍 **智能的时间序列分析工具** - 提供自动模型识别、参数估计和可视化诊断功能

[![Python Version](https://img.shields.io/badge/python-3.9+-blue.svg)](https://python.org)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
[![Build Status](https://img.shields.io/badge/build-passing-brightgreen.svg)](https://github.com/yourusername/time-series-insight-assistant)

## ✨ 特性

- 🤖 **自动模型识别**: 基于ACF/PACF分析自动推荐最适合的ARIMA模型
- 📊 **智能数据处理**: 自动平稳性检验、差分处理和数据清洗
- ⚙️ **多种参数估计**: 支持矩估计法和最大似然估计,提供参数对比
- 🔬 **全面模型评估**: 残差分析、白噪声检验和模型适合度评估
- 📈 **丰富可视化**: ACF/PACF图、残差诊断图、预测图等
- 🖥️ **双重接口**: 命令行工具和Python库,满足不同使用场景
- 📋 **详细报告**: 生成完整的分析报告和模型推荐

## 🚀 快速开始

### 安装

使用uv包管理器安装(推荐):

```bash
uv add time-series-insight-assistant
```

或使用pip安装:

```bash
pip install time-series-insight-assistant
```

### 命令行使用

```bash
# 分析CSV文件中的时间序列数据
tsia analyze data.csv --date-col date --value-col value

# 快速检查数据
tsia quick-check data.csv

# 查看帮助
tsia --help
```

### FastAPI服务使用

```bash
# 启动开发服务器
python scripts/start_dev.py
# 或使用
./scripts/start.sh

# 启动生产服务器
python scripts/start_prod.py
# 或使用
./scripts/start.sh prod

# 访问API文档
# Swagger UI: http://localhost:8000/docs
# ReDoc: http://localhost:8000/redoc
```

### Python API使用

```python
import pandas as pd
from time_series_insight import analyze_time_series

# 一键分析
tsi = analyze_time_series('data.csv', date_column='date', value_column='value')

# 查看分析摘要
summary = tsi.get_summary()
print(f"推荐模型: {summary['best_model']['type']}")

# 生成预测
forecast = tsi.predict(steps=10)
print(forecast['forecast'])

# 生成可视化图表
tsi.plot_analysis(save_dir='output/')
```

### FastAPI服务API使用

```python
import requests

# API基础URL
BASE_URL = "http://localhost:8000/api/v1"

# 上传数据文件
with open('data.csv', 'rb') as f:
    files = {'file': f}
    data = {'date_column': 'date', 'value_column': 'value'}
    response = requests.post(f"{BASE_URL}/upload/file", files=files, data=data)
    upload_result = response.json()
    file_id = upload_result["file_id"]

# 执行分析
analysis_request = {
    "auto_diff": True,
    "max_p": 5,
    "max_q": 5,
    "n_models": 3
}
response = requests.post(f"{BASE_URL}/analysis/{file_id}", json=analysis_request)
analysis_result = response.json()
analysis_id = analysis_result["analysis_id"]

# 进行预测
prediction_request = {"steps": 10, "alpha": 0.05}
response = requests.post(f"{BASE_URL}/analysis/{analysis_id}/predict", json=prediction_request)
prediction_result = response.json()
print(f"预测值: {prediction_result['forecast_values']}")
```

## � Docker 部署

### 快速部署

使用Docker可以快速部署FastAPI服务,无需复杂的环境配置:

```bash
# 方法一:使用部署脚本(推荐)
chmod +x scripts/docker-deploy.sh
./scripts/docker-deploy.sh --build --run

# 方法二:使用Docker Compose
docker-compose up --build -d

# Windows PowerShell
.\scripts\docker-deploy.ps1 -Build -Run
```

### 验证部署

```bash
# 检查服务状态
curl http://localhost:8000/health

# 访问API文档
open http://localhost:8000/docs
```

### 高级部署选项

```bash
# 包含Redis缓存
./scripts/docker-deploy.sh --run --with-redis

# 包含PostgreSQL数据库
./scripts/docker-deploy.sh --run --with-db

# 查看日志
./scripts/docker-deploy.sh --logs

# 停止服务
./scripts/docker-deploy.sh --stop
```

详细的Docker部署指南请参考:[Docker部署文档](docs/DOCKER_DEPLOYMENT.md)

## �📖 核心功能

### 1. 模型自动识别与可视化诊断

- **平稳性检验**: ADF检验和KPSS检验
- **自动差分**: 根据检验结果自动确定差分阶数
- **ACF/PACF分析**: 计算并可视化自相关和偏自相关函数
- **模式识别**: 自动识别截尾和拖尾模式
- **模型推荐**: 基于统计特征推荐最适合的ARIMA模型

### 2. 参数快速估计与模型评估

- **矩估计法**: 快速计算模型参数的初始估计
- **最大似然估计**: 提供更精确的参数估计
- **参数对比**: 比较不同估计方法的结果
- **模型评估**: AIC/BIC信息准则、R²、残差分析
- **白噪声检验**: Ljung-Box检验验证模型充分性

## 📊 使用示例

### 基本分析流程

```python
from time_series_insight import TimeSeriesInsight
import pandas as pd

# 创建分析器
tsi = TimeSeriesInsight()

# 加载数据
data = pd.read_csv('your_data.csv')
tsi.load_data(data, date_column='date', value_column='value')

# 执行完整分析
results = tsi.analyze()

# 查看推荐模型
best_model = tsi.get_best_model()
print(f"推荐模型: ARIMA{best_model['order']}")
print(f"AIC: {best_model['evaluation']['fit_statistics']['aic']:.2f}")

# 生成预测
forecast_result = tsi.predict(steps=12)
forecast = forecast_result['forecast']

# 可视化分析
tsi.plot_analysis(save_dir='analysis_output/')
```

### 模型比较

```python
# 分析多个候选模型
results = tsi.analyze(n_models=5)

# 查看所有评估的模型
for model in results['model_evaluation']:
    order = model['order']
    aic = model['evaluation']['fit_statistics']['aic']
    r2 = model['evaluation']['fit_statistics']['r_squared']
    print(f"ARIMA{order}: AIC={aic:.2f}, R²={r2:.3f}")
```

### 导出结果

```python
# 导出完整分析结果
tsi.export_results('analysis_results.json', format='json')
tsi.export_results('analysis_results.xlsx', format='excel')

# 获取分析摘要
summary = tsi.get_summary()
```

## 🛠️ 技术栈

- **Python 3.9+**: 现代Python特性支持
- **pandas**: 数据处理和时间序列操作
- **numpy**: 数值计算
- **scipy**: 科学计算和统计检验
- **statsmodels**: 时间序列分析和ARIMA建模
- **matplotlib/seaborn**: 数据可视化
- **typer**: 现代命令行接口
- **rich**: 美观的终端输出

## 📁 项目结构

```
time-series-insight-assistant/
├── time_series_insight/          # 主包
│   ├── core/                     # 核心数据处理
│   ├── analysis/                 # 统计分析
│   ├── estimation/               # 参数估计
│   ├── evaluation/               # 模型评估
│   ├── visualization/            # 可视化
│   ├── cli/                      # 命令行接口
│   └── api.py                    # 高级API
├── tests/                        # 测试文件
├── examples/                     # 使用示例
└── docs/                         # 文档
```

## 🧪 运行测试

```bash
# 安装开发依赖
uv sync --dev

# 运行所有测试
pytest

# 运行特定测试
pytest tests/test_api.py

# 运行测试并生成覆盖率报告
pytest --cov=time_series_insight --cov-report=html
```

## 📚 示例和教程

### 生成示例数据

```bash
cd examples
python sample_data.py
```

### 运行基本示例

```bash
cd examples
python basic_usage.py
```

### 命令行示例

```bash
# 分析ARIMA示例数据
tsia analyze examples/data/arima_sample.csv

# 分析季节性数据
tsia analyze examples/data/seasonal_sample.csv

# 分析股价数据
tsia analyze examples/data/stock_sample.csv --value-col price

# 保存分析结果到指定目录
tsia analyze data.csv --output results/ --save-plots
```

## 🔧 开发

### 环境设置

```bash
# 克隆仓库
git clone https://github.com/yourusername/time-series-insight-assistant.git
cd time-series-insight-assistant

# 使用uv创建虚拟环境并安装依赖
uv sync --dev

# 激活虚拟环境
source .venv/bin/activate  # Linux/Mac
# 或
.venv\Scripts\activate     # Windows
```

### 代码质量

```bash
# 代码格式化
black time_series_insight/
isort time_series_insight/

# 代码检查
flake8 time_series_insight/
mypy time_series_insight/

# 运行所有质量检查
pre-commit run --all-files
```

## 📈 性能特点

- **快速分析**: 优化的算法确保快速处理中等规模数据集(< 10,000点)
- **内存效率**: 流式处理大型数据集,避免内存溢出
- **并行计算**: 支持多模型并行评估
- **缓存机制**: 智能缓存中间结果,避免重复计算

## 🤝 贡献

欢迎贡献代码!请遵循以下步骤:

1. Fork 项目
2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)
3. 提交更改 (`git commit -m 'Add some AmazingFeature'`)
4. 推送到分支 (`git push origin feature/AmazingFeature`)
5. 开启 Pull Request

### 贡献指南

- 遵循现有代码风格
- 添加适当的测试
- 更新相关文档
- 确保所有测试通过

## 📄 许可证

本项目采用 MIT 许可证 - 查看 [LICENSE](LICENSE) 文件了解详情。

## 🙏 致谢

- [statsmodels](https://www.statsmodels.org/) - 提供强大的统计建模功能
- [pandas](https://pandas.pydata.org/) - 优秀的数据处理库
- [matplotlib](https://matplotlib.org/) - 灵活的可视化工具
- [typer](https://typer.tiangolo.com/) - 现代命令行接口框架

## 📞 联系方式

- 项目主页: [https://github.com/zym9863/time-series-insight-assistant](https://github.com/zym9863/time-series-insight-assistant)
- 问题反馈: [Issues](https://github.com/zym9863/time-series-insight-assistant/issues)

## 🔮 路线图

- [ ] 支持更多时间序列模型(SARIMA、VAR等)
- [ ] 添加机器学习方法(LSTM、Prophet等)
- [ ] Web界面支持
- [ ] 实时数据流处理
- [ ] 多变量时间序列分析
- [ ] 异常检测功能

---

**如果这个项目对您有帮助,请给个 ⭐ Star!**
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "time-series-insight-assistant",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "analysis, arima, forecasting, statistics, time-series",
    "author": null,
    "author_email": "zym <ym214413520@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/0d/b8/5c0dd404b07282e0eafe481e821efb43f764bebab304f3f7b781f7bfdb98/time_series_insight_assistant-0.1.2.tar.gz",
    "platform": null,
    "description": "[English](README_EN.md) | [\u4e2d\u6587](README.md)\n\n# \u65f6\u95f4\u5e8f\u5217\u6d1e\u5bdf\u52a9\u624b (Time Series Insight Assistant)\n\n\ud83d\udd0d **\u667a\u80fd\u7684\u65f6\u95f4\u5e8f\u5217\u5206\u6790\u5de5\u5177** - \u63d0\u4f9b\u81ea\u52a8\u6a21\u578b\u8bc6\u522b\u3001\u53c2\u6570\u4f30\u8ba1\u548c\u53ef\u89c6\u5316\u8bca\u65ad\u529f\u80fd\n\n[![Python Version](https://img.shields.io/badge/python-3.9+-blue.svg)](https://python.org)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)\n[![Build Status](https://img.shields.io/badge/build-passing-brightgreen.svg)](https://github.com/yourusername/time-series-insight-assistant)\n\n## \u2728 \u7279\u6027\n\n- \ud83e\udd16 **\u81ea\u52a8\u6a21\u578b\u8bc6\u522b**: \u57fa\u4e8eACF/PACF\u5206\u6790\u81ea\u52a8\u63a8\u8350\u6700\u9002\u5408\u7684ARIMA\u6a21\u578b\n- \ud83d\udcca **\u667a\u80fd\u6570\u636e\u5904\u7406**: \u81ea\u52a8\u5e73\u7a33\u6027\u68c0\u9a8c\u3001\u5dee\u5206\u5904\u7406\u548c\u6570\u636e\u6e05\u6d17\n- \u2699\ufe0f **\u591a\u79cd\u53c2\u6570\u4f30\u8ba1**: \u652f\u6301\u77e9\u4f30\u8ba1\u6cd5\u548c\u6700\u5927\u4f3c\u7136\u4f30\u8ba1\uff0c\u63d0\u4f9b\u53c2\u6570\u5bf9\u6bd4\n- \ud83d\udd2c **\u5168\u9762\u6a21\u578b\u8bc4\u4f30**: \u6b8b\u5dee\u5206\u6790\u3001\u767d\u566a\u58f0\u68c0\u9a8c\u548c\u6a21\u578b\u9002\u5408\u5ea6\u8bc4\u4f30\n- \ud83d\udcc8 **\u4e30\u5bcc\u53ef\u89c6\u5316**: ACF/PACF\u56fe\u3001\u6b8b\u5dee\u8bca\u65ad\u56fe\u3001\u9884\u6d4b\u56fe\u7b49\n- \ud83d\udda5\ufe0f **\u53cc\u91cd\u63a5\u53e3**: \u547d\u4ee4\u884c\u5de5\u5177\u548cPython\u5e93\uff0c\u6ee1\u8db3\u4e0d\u540c\u4f7f\u7528\u573a\u666f\n- \ud83d\udccb **\u8be6\u7ec6\u62a5\u544a**: \u751f\u6210\u5b8c\u6574\u7684\u5206\u6790\u62a5\u544a\u548c\u6a21\u578b\u63a8\u8350\n\n## \ud83d\ude80 \u5feb\u901f\u5f00\u59cb\n\n### \u5b89\u88c5\n\n\u4f7f\u7528uv\u5305\u7ba1\u7406\u5668\u5b89\u88c5\uff08\u63a8\u8350\uff09\uff1a\n\n```bash\nuv add time-series-insight-assistant\n```\n\n\u6216\u4f7f\u7528pip\u5b89\u88c5\uff1a\n\n```bash\npip install time-series-insight-assistant\n```\n\n### \u547d\u4ee4\u884c\u4f7f\u7528\n\n```bash\n# \u5206\u6790CSV\u6587\u4ef6\u4e2d\u7684\u65f6\u95f4\u5e8f\u5217\u6570\u636e\ntsia analyze data.csv --date-col date --value-col value\n\n# \u5feb\u901f\u68c0\u67e5\u6570\u636e\ntsia quick-check data.csv\n\n# \u67e5\u770b\u5e2e\u52a9\ntsia --help\n```\n\n### FastAPI\u670d\u52a1\u4f7f\u7528\n\n```bash\n# \u542f\u52a8\u5f00\u53d1\u670d\u52a1\u5668\npython scripts/start_dev.py\n# \u6216\u4f7f\u7528\n./scripts/start.sh\n\n# \u542f\u52a8\u751f\u4ea7\u670d\u52a1\u5668\npython scripts/start_prod.py\n# \u6216\u4f7f\u7528\n./scripts/start.sh prod\n\n# \u8bbf\u95eeAPI\u6587\u6863\n# Swagger UI: http://localhost:8000/docs\n# ReDoc: http://localhost:8000/redoc\n```\n\n### Python API\u4f7f\u7528\n\n```python\nimport pandas as pd\nfrom time_series_insight import analyze_time_series\n\n# \u4e00\u952e\u5206\u6790\ntsi = analyze_time_series('data.csv', date_column='date', value_column='value')\n\n# \u67e5\u770b\u5206\u6790\u6458\u8981\nsummary = tsi.get_summary()\nprint(f\"\u63a8\u8350\u6a21\u578b: {summary['best_model']['type']}\")\n\n# \u751f\u6210\u9884\u6d4b\nforecast = tsi.predict(steps=10)\nprint(forecast['forecast'])\n\n# \u751f\u6210\u53ef\u89c6\u5316\u56fe\u8868\ntsi.plot_analysis(save_dir='output/')\n```\n\n### FastAPI\u670d\u52a1API\u4f7f\u7528\n\n```python\nimport requests\n\n# API\u57fa\u7840URL\nBASE_URL = \"http://localhost:8000/api/v1\"\n\n# \u4e0a\u4f20\u6570\u636e\u6587\u4ef6\nwith open('data.csv', 'rb') as f:\n    files = {'file': f}\n    data = {'date_column': 'date', 'value_column': 'value'}\n    response = requests.post(f\"{BASE_URL}/upload/file\", files=files, data=data)\n    upload_result = response.json()\n    file_id = upload_result[\"file_id\"]\n\n# \u6267\u884c\u5206\u6790\nanalysis_request = {\n    \"auto_diff\": True,\n    \"max_p\": 5,\n    \"max_q\": 5,\n    \"n_models\": 3\n}\nresponse = requests.post(f\"{BASE_URL}/analysis/{file_id}\", json=analysis_request)\nanalysis_result = response.json()\nanalysis_id = analysis_result[\"analysis_id\"]\n\n# \u8fdb\u884c\u9884\u6d4b\nprediction_request = {\"steps\": 10, \"alpha\": 0.05}\nresponse = requests.post(f\"{BASE_URL}/analysis/{analysis_id}/predict\", json=prediction_request)\nprediction_result = response.json()\nprint(f\"\u9884\u6d4b\u503c: {prediction_result['forecast_values']}\")\n```\n\n## \ufffd Docker \u90e8\u7f72\n\n### \u5feb\u901f\u90e8\u7f72\n\n\u4f7f\u7528Docker\u53ef\u4ee5\u5feb\u901f\u90e8\u7f72FastAPI\u670d\u52a1\uff0c\u65e0\u9700\u590d\u6742\u7684\u73af\u5883\u914d\u7f6e\uff1a\n\n```bash\n# \u65b9\u6cd5\u4e00\uff1a\u4f7f\u7528\u90e8\u7f72\u811a\u672c\uff08\u63a8\u8350\uff09\nchmod +x scripts/docker-deploy.sh\n./scripts/docker-deploy.sh --build --run\n\n# \u65b9\u6cd5\u4e8c\uff1a\u4f7f\u7528Docker Compose\ndocker-compose up --build -d\n\n# Windows PowerShell\n.\\scripts\\docker-deploy.ps1 -Build -Run\n```\n\n### \u9a8c\u8bc1\u90e8\u7f72\n\n```bash\n# \u68c0\u67e5\u670d\u52a1\u72b6\u6001\ncurl http://localhost:8000/health\n\n# \u8bbf\u95eeAPI\u6587\u6863\nopen http://localhost:8000/docs\n```\n\n### \u9ad8\u7ea7\u90e8\u7f72\u9009\u9879\n\n```bash\n# \u5305\u542bRedis\u7f13\u5b58\n./scripts/docker-deploy.sh --run --with-redis\n\n# \u5305\u542bPostgreSQL\u6570\u636e\u5e93\n./scripts/docker-deploy.sh --run --with-db\n\n# \u67e5\u770b\u65e5\u5fd7\n./scripts/docker-deploy.sh --logs\n\n# \u505c\u6b62\u670d\u52a1\n./scripts/docker-deploy.sh --stop\n```\n\n\u8be6\u7ec6\u7684Docker\u90e8\u7f72\u6307\u5357\u8bf7\u53c2\u8003\uff1a[Docker\u90e8\u7f72\u6587\u6863](docs/DOCKER_DEPLOYMENT.md)\n\n## \ufffd\ud83d\udcd6 \u6838\u5fc3\u529f\u80fd\n\n### 1. \u6a21\u578b\u81ea\u52a8\u8bc6\u522b\u4e0e\u53ef\u89c6\u5316\u8bca\u65ad\n\n- **\u5e73\u7a33\u6027\u68c0\u9a8c**: ADF\u68c0\u9a8c\u548cKPSS\u68c0\u9a8c\n- **\u81ea\u52a8\u5dee\u5206**: \u6839\u636e\u68c0\u9a8c\u7ed3\u679c\u81ea\u52a8\u786e\u5b9a\u5dee\u5206\u9636\u6570\n- **ACF/PACF\u5206\u6790**: \u8ba1\u7b97\u5e76\u53ef\u89c6\u5316\u81ea\u76f8\u5173\u548c\u504f\u81ea\u76f8\u5173\u51fd\u6570\n- **\u6a21\u5f0f\u8bc6\u522b**: \u81ea\u52a8\u8bc6\u522b\u622a\u5c3e\u548c\u62d6\u5c3e\u6a21\u5f0f\n- **\u6a21\u578b\u63a8\u8350**: \u57fa\u4e8e\u7edf\u8ba1\u7279\u5f81\u63a8\u8350\u6700\u9002\u5408\u7684ARIMA\u6a21\u578b\n\n### 2. \u53c2\u6570\u5feb\u901f\u4f30\u8ba1\u4e0e\u6a21\u578b\u8bc4\u4f30\n\n- **\u77e9\u4f30\u8ba1\u6cd5**: \u5feb\u901f\u8ba1\u7b97\u6a21\u578b\u53c2\u6570\u7684\u521d\u59cb\u4f30\u8ba1\n- **\u6700\u5927\u4f3c\u7136\u4f30\u8ba1**: \u63d0\u4f9b\u66f4\u7cbe\u786e\u7684\u53c2\u6570\u4f30\u8ba1\n- **\u53c2\u6570\u5bf9\u6bd4**: \u6bd4\u8f83\u4e0d\u540c\u4f30\u8ba1\u65b9\u6cd5\u7684\u7ed3\u679c\n- **\u6a21\u578b\u8bc4\u4f30**: AIC/BIC\u4fe1\u606f\u51c6\u5219\u3001R\u00b2\u3001\u6b8b\u5dee\u5206\u6790\n- **\u767d\u566a\u58f0\u68c0\u9a8c**: Ljung-Box\u68c0\u9a8c\u9a8c\u8bc1\u6a21\u578b\u5145\u5206\u6027\n\n## \ud83d\udcca \u4f7f\u7528\u793a\u4f8b\n\n### \u57fa\u672c\u5206\u6790\u6d41\u7a0b\n\n```python\nfrom time_series_insight import TimeSeriesInsight\nimport pandas as pd\n\n# \u521b\u5efa\u5206\u6790\u5668\ntsi = TimeSeriesInsight()\n\n# \u52a0\u8f7d\u6570\u636e\ndata = pd.read_csv('your_data.csv')\ntsi.load_data(data, date_column='date', value_column='value')\n\n# \u6267\u884c\u5b8c\u6574\u5206\u6790\nresults = tsi.analyze()\n\n# \u67e5\u770b\u63a8\u8350\u6a21\u578b\nbest_model = tsi.get_best_model()\nprint(f\"\u63a8\u8350\u6a21\u578b: ARIMA{best_model['order']}\")\nprint(f\"AIC: {best_model['evaluation']['fit_statistics']['aic']:.2f}\")\n\n# \u751f\u6210\u9884\u6d4b\nforecast_result = tsi.predict(steps=12)\nforecast = forecast_result['forecast']\n\n# \u53ef\u89c6\u5316\u5206\u6790\ntsi.plot_analysis(save_dir='analysis_output/')\n```\n\n### \u6a21\u578b\u6bd4\u8f83\n\n```python\n# \u5206\u6790\u591a\u4e2a\u5019\u9009\u6a21\u578b\nresults = tsi.analyze(n_models=5)\n\n# \u67e5\u770b\u6240\u6709\u8bc4\u4f30\u7684\u6a21\u578b\nfor model in results['model_evaluation']:\n    order = model['order']\n    aic = model['evaluation']['fit_statistics']['aic']\n    r2 = model['evaluation']['fit_statistics']['r_squared']\n    print(f\"ARIMA{order}: AIC={aic:.2f}, R\u00b2={r2:.3f}\")\n```\n\n### \u5bfc\u51fa\u7ed3\u679c\n\n```python\n# \u5bfc\u51fa\u5b8c\u6574\u5206\u6790\u7ed3\u679c\ntsi.export_results('analysis_results.json', format='json')\ntsi.export_results('analysis_results.xlsx', format='excel')\n\n# \u83b7\u53d6\u5206\u6790\u6458\u8981\nsummary = tsi.get_summary()\n```\n\n## \ud83d\udee0\ufe0f \u6280\u672f\u6808\n\n- **Python 3.9+**: \u73b0\u4ee3Python\u7279\u6027\u652f\u6301\n- **pandas**: \u6570\u636e\u5904\u7406\u548c\u65f6\u95f4\u5e8f\u5217\u64cd\u4f5c\n- **numpy**: \u6570\u503c\u8ba1\u7b97\n- **scipy**: \u79d1\u5b66\u8ba1\u7b97\u548c\u7edf\u8ba1\u68c0\u9a8c\n- **statsmodels**: \u65f6\u95f4\u5e8f\u5217\u5206\u6790\u548cARIMA\u5efa\u6a21\n- **matplotlib/seaborn**: \u6570\u636e\u53ef\u89c6\u5316\n- **typer**: \u73b0\u4ee3\u547d\u4ee4\u884c\u63a5\u53e3\n- **rich**: \u7f8e\u89c2\u7684\u7ec8\u7aef\u8f93\u51fa\n\n## \ud83d\udcc1 \u9879\u76ee\u7ed3\u6784\n\n```\ntime-series-insight-assistant/\n\u251c\u2500\u2500 time_series_insight/          # \u4e3b\u5305\n\u2502   \u251c\u2500\u2500 core/                     # \u6838\u5fc3\u6570\u636e\u5904\u7406\n\u2502   \u251c\u2500\u2500 analysis/                 # \u7edf\u8ba1\u5206\u6790\n\u2502   \u251c\u2500\u2500 estimation/               # \u53c2\u6570\u4f30\u8ba1\n\u2502   \u251c\u2500\u2500 evaluation/               # \u6a21\u578b\u8bc4\u4f30\n\u2502   \u251c\u2500\u2500 visualization/            # \u53ef\u89c6\u5316\n\u2502   \u251c\u2500\u2500 cli/                      # \u547d\u4ee4\u884c\u63a5\u53e3\n\u2502   \u2514\u2500\u2500 api.py                    # \u9ad8\u7ea7API\n\u251c\u2500\u2500 tests/                        # \u6d4b\u8bd5\u6587\u4ef6\n\u251c\u2500\u2500 examples/                     # \u4f7f\u7528\u793a\u4f8b\n\u2514\u2500\u2500 docs/                         # \u6587\u6863\n```\n\n## \ud83e\uddea \u8fd0\u884c\u6d4b\u8bd5\n\n```bash\n# \u5b89\u88c5\u5f00\u53d1\u4f9d\u8d56\nuv sync --dev\n\n# \u8fd0\u884c\u6240\u6709\u6d4b\u8bd5\npytest\n\n# \u8fd0\u884c\u7279\u5b9a\u6d4b\u8bd5\npytest tests/test_api.py\n\n# \u8fd0\u884c\u6d4b\u8bd5\u5e76\u751f\u6210\u8986\u76d6\u7387\u62a5\u544a\npytest --cov=time_series_insight --cov-report=html\n```\n\n## \ud83d\udcda \u793a\u4f8b\u548c\u6559\u7a0b\n\n### \u751f\u6210\u793a\u4f8b\u6570\u636e\n\n```bash\ncd examples\npython sample_data.py\n```\n\n### \u8fd0\u884c\u57fa\u672c\u793a\u4f8b\n\n```bash\ncd examples\npython basic_usage.py\n```\n\n### \u547d\u4ee4\u884c\u793a\u4f8b\n\n```bash\n# \u5206\u6790ARIMA\u793a\u4f8b\u6570\u636e\ntsia analyze examples/data/arima_sample.csv\n\n# \u5206\u6790\u5b63\u8282\u6027\u6570\u636e\ntsia analyze examples/data/seasonal_sample.csv\n\n# \u5206\u6790\u80a1\u4ef7\u6570\u636e\ntsia analyze examples/data/stock_sample.csv --value-col price\n\n# \u4fdd\u5b58\u5206\u6790\u7ed3\u679c\u5230\u6307\u5b9a\u76ee\u5f55\ntsia analyze data.csv --output results/ --save-plots\n```\n\n## \ud83d\udd27 \u5f00\u53d1\n\n### \u73af\u5883\u8bbe\u7f6e\n\n```bash\n# \u514b\u9686\u4ed3\u5e93\ngit clone https://github.com/yourusername/time-series-insight-assistant.git\ncd time-series-insight-assistant\n\n# \u4f7f\u7528uv\u521b\u5efa\u865a\u62df\u73af\u5883\u5e76\u5b89\u88c5\u4f9d\u8d56\nuv sync --dev\n\n# \u6fc0\u6d3b\u865a\u62df\u73af\u5883\nsource .venv/bin/activate  # Linux/Mac\n# \u6216\n.venv\\Scripts\\activate     # Windows\n```\n\n### \u4ee3\u7801\u8d28\u91cf\n\n```bash\n# \u4ee3\u7801\u683c\u5f0f\u5316\nblack time_series_insight/\nisort time_series_insight/\n\n# \u4ee3\u7801\u68c0\u67e5\nflake8 time_series_insight/\nmypy time_series_insight/\n\n# \u8fd0\u884c\u6240\u6709\u8d28\u91cf\u68c0\u67e5\npre-commit run --all-files\n```\n\n## \ud83d\udcc8 \u6027\u80fd\u7279\u70b9\n\n- **\u5feb\u901f\u5206\u6790**: \u4f18\u5316\u7684\u7b97\u6cd5\u786e\u4fdd\u5feb\u901f\u5904\u7406\u4e2d\u7b49\u89c4\u6a21\u6570\u636e\u96c6\uff08< 10,000\u70b9\uff09\n- **\u5185\u5b58\u6548\u7387**: \u6d41\u5f0f\u5904\u7406\u5927\u578b\u6570\u636e\u96c6\uff0c\u907f\u514d\u5185\u5b58\u6ea2\u51fa\n- **\u5e76\u884c\u8ba1\u7b97**: \u652f\u6301\u591a\u6a21\u578b\u5e76\u884c\u8bc4\u4f30\n- **\u7f13\u5b58\u673a\u5236**: \u667a\u80fd\u7f13\u5b58\u4e2d\u95f4\u7ed3\u679c\uff0c\u907f\u514d\u91cd\u590d\u8ba1\u7b97\n\n## \ud83e\udd1d \u8d21\u732e\n\n\u6b22\u8fce\u8d21\u732e\u4ee3\u7801\uff01\u8bf7\u9075\u5faa\u4ee5\u4e0b\u6b65\u9aa4\uff1a\n\n1. Fork \u9879\u76ee\n2. \u521b\u5efa\u7279\u6027\u5206\u652f (`git checkout -b feature/AmazingFeature`)\n3. \u63d0\u4ea4\u66f4\u6539 (`git commit -m 'Add some AmazingFeature'`)\n4. \u63a8\u9001\u5230\u5206\u652f (`git push origin feature/AmazingFeature`)\n5. \u5f00\u542f Pull Request\n\n### \u8d21\u732e\u6307\u5357\n\n- \u9075\u5faa\u73b0\u6709\u4ee3\u7801\u98ce\u683c\n- \u6dfb\u52a0\u9002\u5f53\u7684\u6d4b\u8bd5\n- \u66f4\u65b0\u76f8\u5173\u6587\u6863\n- \u786e\u4fdd\u6240\u6709\u6d4b\u8bd5\u901a\u8fc7\n\n## \ud83d\udcc4 \u8bb8\u53ef\u8bc1\n\n\u672c\u9879\u76ee\u91c7\u7528 MIT \u8bb8\u53ef\u8bc1 - \u67e5\u770b [LICENSE](LICENSE) \u6587\u4ef6\u4e86\u89e3\u8be6\u60c5\u3002\n\n## \ud83d\ude4f \u81f4\u8c22\n\n- [statsmodels](https://www.statsmodels.org/) - \u63d0\u4f9b\u5f3a\u5927\u7684\u7edf\u8ba1\u5efa\u6a21\u529f\u80fd\n- [pandas](https://pandas.pydata.org/) - \u4f18\u79c0\u7684\u6570\u636e\u5904\u7406\u5e93\n- [matplotlib](https://matplotlib.org/) - \u7075\u6d3b\u7684\u53ef\u89c6\u5316\u5de5\u5177\n- [typer](https://typer.tiangolo.com/) - \u73b0\u4ee3\u547d\u4ee4\u884c\u63a5\u53e3\u6846\u67b6\n\n## \ud83d\udcde \u8054\u7cfb\u65b9\u5f0f\n\n- \u9879\u76ee\u4e3b\u9875: [https://github.com/zym9863/time-series-insight-assistant](https://github.com/zym9863/time-series-insight-assistant)\n- \u95ee\u9898\u53cd\u9988: [Issues](https://github.com/zym9863/time-series-insight-assistant/issues)\n\n## \ud83d\udd2e \u8def\u7ebf\u56fe\n\n- [ ] \u652f\u6301\u66f4\u591a\u65f6\u95f4\u5e8f\u5217\u6a21\u578b\uff08SARIMA\u3001VAR\u7b49\uff09\n- [ ] \u6dfb\u52a0\u673a\u5668\u5b66\u4e60\u65b9\u6cd5\uff08LSTM\u3001Prophet\u7b49\uff09\n- [ ] Web\u754c\u9762\u652f\u6301\n- [ ] \u5b9e\u65f6\u6570\u636e\u6d41\u5904\u7406\n- [ ] \u591a\u53d8\u91cf\u65f6\u95f4\u5e8f\u5217\u5206\u6790\n- [ ] \u5f02\u5e38\u68c0\u6d4b\u529f\u80fd\n\n---\n\n**\u5982\u679c\u8fd9\u4e2a\u9879\u76ee\u5bf9\u60a8\u6709\u5e2e\u52a9\uff0c\u8bf7\u7ed9\u4e2a \u2b50 Star\uff01**",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "\u4e00\u4e2a\u667a\u80fd\u7684\u65f6\u95f4\u5e8f\u5217\u5206\u6790\u52a9\u624b\uff0c\u63d0\u4f9b\u81ea\u52a8\u6a21\u578b\u8bc6\u522b\u3001\u53c2\u6570\u4f30\u8ba1\u548c\u53ef\u89c6\u5316\u8bca\u65ad\u529f\u80fd",
    "version": "0.1.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/zym9863/time-series-insight-assistant/issues",
        "Homepage": "https://github.com/zym9863/time-series-insight-assistant",
        "Repository": "https://github.com/zym9863/time-series-insight-assistant"
    },
    "split_keywords": [
        "analysis",
        " arima",
        " forecasting",
        " statistics",
        " time-series"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "720527fe8a6a3bf136d19ff01ecf761902f72115bf0a91a52a7b0426353a48a8",
                "md5": "3a963d354ad05a4cbb67ca1ec69ee679",
                "sha256": "33609062428a391358991ac102fc6c8474b1f0b9b486a56377601f37c36354d9"
            },
            "downloads": -1,
            "filename": "time_series_insight_assistant-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3a963d354ad05a4cbb67ca1ec69ee679",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 37959,
            "upload_time": "2025-07-21T12:08:58",
            "upload_time_iso_8601": "2025-07-21T12:08:58.505390Z",
            "url": "https://files.pythonhosted.org/packages/72/05/27fe8a6a3bf136d19ff01ecf761902f72115bf0a91a52a7b0426353a48a8/time_series_insight_assistant-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "0db85c0dd404b07282e0eafe481e821efb43f764bebab304f3f7b781f7bfdb98",
                "md5": "077247b3ee6bf76062cef48c54026555",
                "sha256": "f15773bba1d5ce1b9f500fe7fa09212a854bbde7a10f95f9208ba171f639a07d"
            },
            "downloads": -1,
            "filename": "time_series_insight_assistant-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "077247b3ee6bf76062cef48c54026555",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 582782,
            "upload_time": "2025-07-21T12:09:00",
            "upload_time_iso_8601": "2025-07-21T12:09:00.325626Z",
            "url": "https://files.pythonhosted.org/packages/0d/b8/5c0dd404b07282e0eafe481e821efb43f764bebab304f3f7b781f7bfdb98/time_series_insight_assistant-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-21 12:09:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "zym9863",
    "github_project": "time-series-insight-assistant",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "time-series-insight-assistant"
}
        
Elapsed time: 0.50368s