Prompt file imported from GoatWang/oysterun-ccstock-workenv-en (
.codex/prompts/download_data.md). Copyright stays with the author.
Download Data
Batch download stock data from a market and store in SQLite database.
Usage
/download_data <market> [sector] [--days N]
Examples
/download_data US
/download_data TW --days 365
/download_data CN technology
Arguments
market:US,TW, orCN(required)sector: Filter by sector (optional)--days N: Number of days of historical data (default: 365)
Instructions
When this command is invoked:
- Initialize database if not exists:
cd $(pwd)/tool_scripts/db_ops && uv run python db_manager.py --init
- Get stock list for the market:
cd $(pwd)/tool_scripts/market_data && uv run python fetcher_factory.py list-tickers --market <market> [--sector <sector>]
- Download price data for each stock and store in DB:
cd $(pwd)/tool_scripts/db_ops && uv run python price_ops.py --bulk-download --market <market> --days <days>
- Report progress in English:
📥 Download Data: <market> Market
Industry篩選: <sector or all>
期間:最近 <days> 天
⏳ Download progress...
✅ Completed: <count> stocks downloaded
❌ Failed: <error_count> 檔
💾 Database:data/ccstockworkenv.db
- Report the formatted result to the user.