SuperAPI AI Directory

findata-toolkit-cn

Data & analytics

View repository

Updated 10-16 04:57

About this skill

Financial Data Toolkit — A-share Market

A self-contained data toolkit providing real-time financial data and quantitative calculations for the A-share market. All data sources arefree,no API key required。

Installation

Install dependencies (one-time):

pip install -r requirements.txt

Available Tools

All scripts are located in the scripts/ directory. Run from the skill root directory.

0. AKShare Full Tool Set (config/litellm_tools.json → scripts/akshare_tools.py)

This toolkit includes config/litellm_tools.json(356 interface definitions), and provides a unified "tool runner" script:

  • List tools:python scripts/akshare_tools.py list --contains fund_flow
  • View a tool's input parameter schema:python scripts/akshare_tools.py describe stock_zt_pool_em
  • Direct call (no parameters):python scripts/akshare_tools.py stock_zh_a_spot_em
  • Direct call (with parameters):python scripts/akshare_tools.py stock_individual_info_em --set symbol=000001
  • JSON parameter call:python scripts/akshare_tools.py stock_zh_a_hist --args '{"symbol":"000001","period":"daily","start_date":"20250101","end_date":"20250201","adjust":"qfq"}'

Notes:

  • File caching is enabled by default (FINSKILLS_CACHE_DIR can specify the cache directory); you can use --no-cache to disable it, and--refresh to force a refresh.
  • token/timeout and other parameters may be marked as required in the tool definition but default to None; the runner will try to handle compatibility as much as possible (fill in None)。

0.5 Composite View Views (scripts/views_runner.py)

Views are used to combine multiple underlying tools (356 interfaces) into more stable, reusable "data views" for direct reference by upper-layer analysis skills.

  • At the same time, the Views Runner automatically exposes the 356 underlying tools as views with the same names(view name == tool name), so that upper layers only need to call views uniformly.
  • List available views:python scripts/views_runner.py list
  • View view input parameters:python scripts/views_runner.py describe fund_flow_dashboard
  • Run view:python scripts/views_runner.py fund_flow_dashboard
  • Common view examples:python scripts/views_runner.py repurchase_dashboard、python scripts/views_runner.py block_deal_dashboard
  • Run a "tool same-name view" (equivalent to directly calling the tool):python scripts/views_runner.py stock_zh_a_spot_em
  • Plan only without executing (convenient for writing references):python scripts/views_runner.py dragon_tiger_daily --set date=20250211 --dry-run

Remote mode (recommended for productization/stable data retrieval):

  • Setting FINSKILLS_VIEW_API_URL or using --remote-url,list/describe/run will connect directly to the remote View API (only consuming {meta,data,warnings,errors}, without local cleaning/transformation).
  • Example:FINSKILLS_VIEW_API_URL=http://127.0.0.1:8808 python scripts/views_runner.py list
  • Example:python scripts/views_runner.py --remote-url http://127.0.0.1:8808 repurchase_dashboard --set symbol=000001
  • The remote end can expose any view name (including "tool same-name views"); locally, calls are made only by view name.
  • In remote mode, --dry-run is unavailable (the remote API does not expose plan by default).

Optional authentication/timeout:

  • FINSKILLS_VIEW_API_TOKEN(Bearer) or FINSKILLS_VIEW_API_KEY
  • FINSKILLS_VIEW_API_TIMEOUT(seconds, default 30)

Output reliability tips:

  • All tool/view outputs use a unified envelope:{meta, data, warnings, errors}; please check errors and warnings first before drawing conclusions.
  • meta.as_of records the fetch time; if the cache is hit, you will see the cache age/ttl in meta.cache .
  • For each tool call, meta.result will include the result type and scale as much as possible (such as type/rows/columns); empty results will be written to warnings, avoiding the misjudgment of "no data = no event".

1. A-share Data (scripts/stock_data.py)

Obtain A-share fundamentals, quotes, and financial indicators via AKShare.

Command Purpose
python scripts/stock_data.py 600519 Basic Information (Kweichow Moutai)
python scripts/stock_data.py 600519 --metrics Complete Financial Metrics (Valuation, Profitability, Leverage, Growth)
python scripts/stock_data.py 600519 --history Historical OHLCV Market Data
python scripts/stock_data.py 600519 --financials Income Statement, Balance Sheet, Cash Flow Statement
python scripts/stock_data.py 600519 --insider Directors, Supervisors, and Senior Management Shareholding Increase/Decrease Data
python scripts/stock_data.py --northbound Northbound Capital Flows (Shanghai Stock Connect/Shenzhen Stock Connect)
python scripts/stock_data.py 600519 000858 --screen Batch Screening

2. Macroeconomic Data (scripts/macro_data.py)

Obtain China macroeconomic indicators via AKShare.

Command Purpose
python scripts/macro_data.py --dashboard Complete Macroeconomic Dashboard
python scripts/macro_data.py --rates Interest Rate Data (LPR, Shibor)
python scripts/macro_data.py --inflation CPI/PPI Data
python scripts/macro_data.py --pmi PMI Data (Manufacturing/Non-Manufacturing)
python scripts/macro_data.py --social-financing Aggregate Financing to the Real Economy + M2
python scripts/macro_data.py --cycle Economic Cycle Stage Assessment

Data Source

Source Data Content API Key
AKShare A-share market data, financial data, directors/supervisors/senior management transactions, northbound capital, macroeconomic indicators Not required

Output Format

All scripts output to standard output in JSON format for easy parsing. Error messages are output to standard error.

Configuration

Optional: Edit config/data_sources.yaml to customize rate limits or add paid data source API keys.