skills/tushare-data-1.0.5/references/数据接口/宏观经济/国内宏观/价格指数/居民消费价格指数(CPI).md
wangyitong a65adcc2e5 Initial commit: merged, deduplicated, and vetted skill collection
Sources: extracted from two upstream archives (skill-repo, skills-main),
merged with the following policy:

- 15 broken symlinks (pointing to /Users/jameslee/.cc-switch/skills or
  ../../.agents/skills on a foreign machine) discarded
- 3 real name collisions with identical content (ai-pair, ifind-http-api,
  zhipu-websearch) kept as one copy
- Functional overlaps deduped keeping the strongest variant:
  - docx family: kept docx (official, full toolchain) + docx-cn
    (GB/T 9704 Chinese official-document constants),
    dropped docx_writer (no scripts, name collided with docx)
  - humanizer family: kept humanizer-zh (6 zh reference docs),
    dropped humanizer (en, redundant for CN workflow)
- Skills that only ran in a foreign environment removed:
  ablemind-ops, app-publish, hlb-design-system, openclaw-adj-skill,
  claude-driver
- alphapai excluded from this public repo because its SKILL.md hard-coded
  live credentials

Result: 25 skills, 572 files, ~7.5 MB.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-13 14:47:12 +08:00

3.1 KiB
Raw Blame History

居民消费价格指数


接口cn_cpi 描述获取CPI居民消费价格数据包括全国、城市和农村的数据 限量单次最大5000行一次可以提取全部数据 权限用户积累600积分可以使用具体请参阅积分获取办法



输入参数

名称 类型 必选 描述
m str N 月份YYYYMM下同支持多个月份同时输入逗号分隔
start_m str N 开始月份
end_m str N 结束月份


输出参数

名称 类型 默认显示 描述
month str Y 月份YYYYMM
nt_val float Y 全国当月值
nt_yoy float Y 全国同比(%
nt_mom float Y 全国环比(%
nt_accu float Y 全国累计值
town_val float Y 城市当月值
town_yoy float Y 城市同比(%
town_mom float Y 城市环比(%
town_accu float Y 城市累计值
cnt_val float Y 农村当月值
cnt_yoy float Y 农村同比(%
cnt_mom float Y 农村环比(%
cnt_accu float Y 农村累计值


接口调用


pro = ts.pro_api()

df = pro.cn_cpi(start_m='201801', end_m='201903')


#获取指定字段
df = pro.cn_cpi(start_q='201801', end_q='201903', fields='month,nt_val,nt_yoy')


数据样例

     month  nt_val nt_yoy nt_mom nt_accu town_val town_yoy town_mom town_accu cnt_val cnt_yoy cnt_mom cnt_accu
0   201903  102.30   2.30  -0.40  101.80   102.30     2.30    -0.40    101.90  102.30    2.30   -0.30   101.80
1   201902  101.50   1.50   1.00  101.60   101.50     1.50     1.00    101.60  101.40    1.40    0.90   101.50
2   201901  101.70   1.70   0.50  101.70   101.80     1.80     0.50    101.80  101.70    1.70    0.40   101.70
3   201812  101.90   1.90   0.00  102.10   101.90     1.90     0.00    102.10  101.90    1.90    0.00   102.10
4   201811  102.20   2.20  -0.30  102.10   102.20     2.20    -0.40    102.10  102.20    2.20   -0.30   102.10
5   201810  102.50   2.50   0.20  102.10   102.50     2.50     0.20    102.10  102.60    2.60    0.20   102.10
6   201809  102.50   2.50   0.70  102.10   102.40     2.40     0.70    102.10  102.50    2.50    0.80   102.00
7   201808  102.30   2.30   0.70  102.00   102.30     2.30     0.60    102.00  102.30    2.30    0.80   102.00
8   201807  102.10   2.10   0.30  102.00   102.10     2.10     0.40    102.00  102.00    2.00    0.10   101.90
9   201806  101.90   1.90  -0.10  102.00   101.80     1.80     0.00    102.00  101.90    1.90   -0.10   101.90
10  201805  101.80   1.80  -0.20  102.00   101.80     1.80    -0.20    102.00  101.70    1.70   -0.10   101.90
11  201804  101.80   1.80  -0.20  102.10   101.80     1.80    -0.20    102.10  101.70    1.70   -0.30   101.90
12  201803  102.10   2.10  -1.10  102.10   102.10     2.10    -1.10    102.20  101.90    1.90   -1.20   102.00
13  201802  102.90   2.90   1.20  102.20   103.00     3.00     1.30    102.20  102.70    2.70    1.10   102.10
14  201801  101.50   1.50   0.60  101.50   101.50     1.50     0.60    101.50  101.50    1.50    0.60   101.50