Implementation:AI4Finance Foundation FinGPT Eastmoney Title Downloader
| Knowledge Sources | |
|---|---|
| Domains | Data_Acquisition, News_Download, Chinese_Market |
| Last Updated | 2026-10-18 00:00 GMT |
Overview
Concrete tool for downloading Eastmoney news titles for Chinese A-share stocks using FinNLP's streaming downloader with multiprocessing provided by the FinGPT Sentiment Analysis v1 subproject.
Description
The download_titles module reads a stock code list from CSV, uses FinNLP's `Eastmoney_Streaming` downloader with KuaiDaili proxy support, and fetches news titles for each stock in parallel via a multiprocessing pool. It skips already-downloaded stocks to avoid redundant work.
Usage
Run as a script when you need to bulk-download Eastmoney news titles for a list of A-share stocks. Requires FinNLP and optional KuaiDaili proxy credentials.
Code Reference
Source Location
- Repository: AI4Finance_Foundation_FinGPT
- File: fingpt/FinGPT_Sentiment_Analysis_v1/FinGPT_v1.0/data_preparations/download_titles.py
- Lines: 1-63
Signature
def get_news_data(stock):
"""Download Eastmoney news titles for one A-share stock.
Args:
stock: 6-digit stock code string
Returns:
pd.DataFrame of news data, or None if already downloaded
"""
Import
# Script — invoke directly
# python download_titles.py
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| hs_300.csv | CSV | Yes | Stock list with SECURITY_CODE column |
| config | dict | Yes | Proxy config (use_proxy, max_retry, tunnel, credentials) |
| result_path | str | Yes | Output directory for per-stock CSVs |
Outputs
| Name | Type | Description |
|---|---|---|
| per-stock CSVs | files | One CSV per stock with news titles |
Usage Examples
Download Titles for Multiple Stocks
import multiprocessing as mp
from download_titles import get_news_data
stocks = ["000001", "600519", "000858"]
pool = mp.Pool(processes=5)
for stock in stocks:
pool.apply_async(get_news_data, args=(stock,))
pool.close()
pool.join()