# fdp **Repository Path**: pyedog/fdp ## Basic Information - **Project Name**: fdp - **Description**: 金融数据平台 (Financial Data Platform) 基于akshare、pandas、pandas_ta和PostgreSQL的全面金融数据采集、处理和分析系统。该平台支持多种投资标的的数据采集、解析、加工和入库,为量化投资和金融研究提供强大的数据支持。 - **Primary Language**: Python - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 5 - **Created**: 2025-11-26 - **Last Updated**: 2025-11-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 金融数据平台 (Financial Data Platform) ![License](https://img.shields.io/badge/license-MIT-blue.svg) ![Python Version](https://img.shields.io/badge/python-3.8%2B-green.svg) ![PostgreSQL](https://img.shields.io/badge/database-PostgreSQL-blue.svg) 基于akshare、pandas、pandas_ta和PostgreSQL的全面金融数据采集、处理和分析系统。该平台支持多种投资标的的数据采集、解析、加工和入库,为量化投资和金融研究提供强大的数据支持。 ## 功能特点 - **多种数据源**:支持股票、期货、加密货币、ETF/指数、基金等多种投资标的数据采集 - **全面数据类型**:行情数据、基本面数据、宏观经济数据、新闻资讯等全方位数据支持 - **自动化处理**:数据自动采集、清洗、标准化和入库 - **技术指标计算**:集成pandas_ta库,支持上百种技术指标计算 - **分布式任务系统**:基于Celery的高性能任务调度和执行系统 - **可视化监控**:直观的数据展示和任务监控界面 - **API接口**:提供RESTful API访问所有数据 ## 数据库迁移指南 ### 生产环境迁移步骤 1. 安装Alembic迁移工具 ```bash pip install alembic ``` 2. 生成迁移脚本(开发环境) ```bash alembic revision --autogenerate -m "add_macro_models" ``` 3. 检查生成的迁移脚本 ```bash # 查看migrations/versions目录下新生成的迁移文件 cat migrations/versions/{版本号}_add_macro_models.py ``` 4. 执行数据库迁移(生产环境) ```bash alembic upgrade head ``` ### Docker环境集成 在docker-compose.yml中添加迁移服务: ```yaml services: db-migrate: build: . command: alembic upgrade head depends_on: - db environment: DATABASE_URL: postgresql://user:password@db:5432/fdp ``` ## 安装指南 ### 环境要求 - Python 3.8+ - PostgreSQL 12+ - Redis (可选,用于Celery任务队列) ### 安装步骤 1. 克隆代码库 ```bash git clone https://github.com/yourusername/financial-data-platform.git cd financial-data-platform ``` 2. 创建并激活虚拟环境 ```bash python -m venv venv source venv/bin/activate # Linux/Mac venv\Scripts\activate # Windows ``` 3. 安装依赖包 ```bash pip install -r requirements.txt ``` 4. 配置环境变量 ```bash cp .env.example .env # 配置数据库连接信息: # DATABASE_URL=postgresql://user:password@localhost:5432/fdp ``` 5. 初始化数据库(包含迁移) ```bash alembic upgrade head python app.py ``` [保持原有文档其他部分不变...]