Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 复制此文件为 .env,填入你的真实 Key,不要提交 .env 到版本库
TUSHARE_TOKEN=你的TushareToken
GEMINI_API_KEY=你的GeminiApiKey
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ pip-wheel-metadata/
# Local environment/config secrets
.env
.env.*
!.env.example

# OS files
.DS_Store
Expand Down
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,20 @@ pip install -r requirements.txt

### 3.3 设置环境变量

Windows PowerShell(永久写入)
在项目根目录复制模板文件,填入你的真实 Key

~~~powershell
[Environment]::SetEnvironmentVariable("TUSHARE_TOKEN", "你的TushareToken", "User")
[Environment]::SetEnvironmentVariable("GEMINI_API_KEY", "你的GeminiApiKey", "User")
~~~bash
cp .env.example .env
~~~

编辑 `.env`:

~~~
TUSHARE_TOKEN=你的TushareToken
GEMINI_API_KEY=你的GeminiApiKey
~~~

写入后请重开终端,环境变量才会在新会话中生效
项目启动时会自动加载 `.env`,无需手动设置系统环境变量,跨平台通用。`.env` 已在 `.gitignore` 中,不会被提交到版本库

### 3.4 运行一键脚本

Expand Down
3 changes: 3 additions & 0 deletions agent/gemini_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@
from pathlib import Path
from typing import Any

from dotenv import load_dotenv
from google import genai
from google.genai import types
import yaml

load_dotenv()

from base_reviewer import BaseReviewer

# ────────────────────────────────────────────────
Expand Down
3 changes: 3 additions & 0 deletions pipeline/fetch_kline.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@
import pandas as pd
import tushare as ts
import yaml
from dotenv import load_dotenv
from tqdm import tqdm

load_dotenv()

warnings.filterwarnings("ignore")

# --------------------------- pandas 兼容补丁 --------------------------- #
Expand Down
7 changes: 5 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
numba==0.64.0
python-dotenv>=1.0
numpy==2.4.3
pandas==3.0.1
# streamlit 1.55.0 要求 pandas < 3;项目代码已对 tushare 做了 pandas 2.2+ 兼容补丁
pandas>=2.2,<3
plotly==6.5.0
protobuf==7.34.0
# streamlit 1.55.0 要求 protobuf < 7
protobuf>=3.20,<7
PyYAML==6.0.3
streamlit==1.55.0
tqdm==4.67.3
Expand Down