螃蟹投研-股票行业Collector

v1.0.0

收集A股某行业全部上市公司资料,包括代码、名称、交易所、行业、财务数据(ROE、毛利率、净利率、资产负债率、现金流、增长率)、控股股东及持股比例

0· 114·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for wtjjacobj/stock-industry-collector.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "螃蟹投研-股票行业Collector" (wtjjacobj/stock-industry-collector) from ClawHub.
Skill page: https://clawhub.ai/wtjjacobj/stock-industry-collector
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install stock-industry-collector

ClawHub CLI

Package manager switcher

npx clawhub@latest install stock-industry-collector
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description ask for A‑share industry/company and financial/holder data; SKILL.md requires akshare/baostock/pandas and the code uses akshare and network calls to fetch stock lists, shareholder info and market data. Required packages and external endpoints align with the stated data-collection purpose. Minor note: SKILL.md lists baostock as a data source but the provided __init__.py does not call baostock — likely harmless/incomplete documentation.
Instruction Scope
Runtime instructions and code only perform API calls (akshare functions and HTTP requests to Eastmoney), format and return data, and suggest clearing proxies for akshare. They do not instruct reading unrelated system files, environment variables, or sending data to unexpected third‑party endpoints beyond akshare/Eastmoney. The code uses subprocess to invoke curl for network calls, which is coherent with the stated intention to avoid proxy issues.
Install Mechanism
No install spec; SKILL.md lists pip dependencies (baostock, akshare, pandas). No downloads from arbitrary URLs or archive extraction; code is included directly. This is low-risk from an install-mechanism perspective, though users should still vet the pip packages and pin versions.
Credentials
The skill requests no environment variables, credentials, or config paths. That is proportional to the stated purpose. Network access is required for data retrieval, which is expected. No unrelated secrets or system config access is requested.
Persistence & Privilege
Skill does not request always:true and contains no installation steps that modify other skills or system-wide settings. It runs on demand and does not require persistent elevated privileges.
Assessment
This skill appears coherent for collecting A‑share company and financial data. Before installing: (1) review and pin versions for pip packages (akshare/baostock/pandas) to avoid supply‑chain risks; (2) be aware it performs network requests to akshare and Eastmoney (push2.eastmoney.com) — ensure these calls comply with your data/TOS constraints and run in an environment where outbound network access is acceptable; (3) note the code invokes curl via subprocess (used safely with a list of args here), so run in a controlled environment if you have strict execution policies; (4) the SKILL.md mentions baostock but the code doesn't call it — if you expect baostock data, verify the implementation or update requirements accordingly.

Like a lobster shell, security has layers — review code before you run it.

Runtime requirements

📊 Clawdis
latestvk97bgvqnvfqjma6fzswrqs94xs83tx43
114downloads
0stars
1versions
Updated 4w ago
v1.0.0
MIT-0

股票行业数据收集器 v2.3

功能

收集A股某行业的全部上市公司详细信息,包含完整财务数据和控股股东数据

【重要】获取行业全部公司的方法

本技能使用 akshare 行业分类 获取股票,确保不遗漏任何公司:

方法1:使用申万行业分类

c.collect(industry_name="煤炭")  # 自动转换为申万行业代码 BK0437
c.collect(industry_name="焦煤")  # BK1494
c.collect(industry_name="煤化工") # BK1419

方法2:直接使用申万行业代码

c.collect(industry_code="BK0437")   # 煤炭
c.collect(industry_code="BK1494")   # 焦煤
c.collect(industry_code="BK1493")   # 动力煤
c.collect(industry_code="BK1419")   # 煤化工

支持的行业

行业名称申万代码说明
煤炭BK0437煤炭开采
焦煤BK1494焦炭
动力煤BK1493动力煤
煤化工BK1419煤化工
石油BK0411石油开采
燃气BK0501燃气
电力BK0502电力
光伏BK1033光伏

输出字段

字段说明数据来源
代码股票代码基本信息
名称公司名称基本信息
交易所沪市/深市基本信息
行业证监会行业分类行业数据
ROE净资产收益率(%)利润表
毛利率毛利率(%)利润表
净利率净利率(%)利润表
营业收入营业收入(元)利润表
净利润净利润(元)利润表
总资产总资产(元)资产负债表
总负债总负债(元)资产负债表
资产负债率负债/权益资产负债表
经营现金流经营现金流(元)现金流量表
营收增长营收增长率(%)成长能力
净利润增长净利润增长率(%)成长能力
控股股东控股股东名称十大流通股东
控股比例持股比例(%)十大流通股东
股东性质国企/民企自动判断
所在地省份手动维护
产区主要生产区手动维护

数据来源

  • baostock - 财务数据(免费无需注册)
  • akshare - 股东数据、行业分类(需清除代理)

使用

from stock_industry_collector import IndustryCollector

c = IndustryCollector()

# 方法1:按行业名称
df = c.collect(industry_name="煤炭")

# 方法2:按申万行业代码
# df = c.collect(industry_code="BK0437")

print(f"找到 {len(df)} 只煤炭行业股票")

# 格式化
df['ROE'] = df['ROE'].apply(lambda x: str(round(float(x)*100, 2)) + '%' if x else '')
df['净利润'] = df['净利润'].apply(lambda x: str(round(float(x)/1e8, 2)) + '亿' if x else '')

print(df[['代码','名称','控股股东','ROE','净利润']].head())

# 保存Excel
df.to_excel("煤炭行业财务分析.xlsx", index=False)

注意事项

  1. 行业股票获取:使用 akshare 申万/中证行业分类,不遗漏
  2. 财报年份:默认获取2024年年报(year=2024, quarter=4)
  3. 数据延迟:每年4月底发布上年年报
  4. 请求限速:已内置延时,避免请求过快
  5. 代理问题:akshare 需要清除系统代理才能正常工作

Comments

Loading comments...