npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

china-regions-data

v0.0.3

Published

中国行政区划【省、市、区县】数据(汇总、省份、地级市、区县、一级、二级、三级)

Downloads

6

Readme

中国行政区划【省、市、区县】数据(汇总、省份、地级市、区县、一级、二级、三级)

json

列表数据

所有省、市、区县编码与名称的映射列表

数据来自 data_location

{
  "110000": "北京市",
  "110101": "东城区",
  "110102": "西城区",
  "110105": "朝阳区",
  ...
  "130000": "河北省",
  "130100": "石家庄市",
  "130102": "长安区",
  "130104": "桥西区",
  "130105": "新华区",
  ...
}

省份数据

所有省份编码与名称的映射列表

{
  "110000": "北京市",
  "120000": "天津市",
  "130000": "河北省",
  "140000": "山西省",
  ...
}

地级市数据

所有地级市编码与名称的映射列表(不包含直辖市、特别行政区等国家一级行政区划)

{
  "130100": "石家庄市",
  "130200": "唐山市",
  "130300": "秦皇岛市",
  "130400": "邯郸市",
  ...
}

区县数据

所有区县编码与名称的映射列表

{
  "110101": "东城区",
  "110102": "西城区",
  "110105": "朝阳区",
  ...
}

一级数据

省份:一级数据

[
  {
    "code": "110000",
    "name": "北京市"
  },
  {
    "code": "120000",
    "name": "天津市"
  },
  ...
]

一级数据(map)

省份:一级数据(map)

{
  "110000": {
    "name": "北京市"
  },
  "120000": {
    "name": "天津市"
  },
  ...
}

二级数据

省份 + 地级市(区县):二级数据

[
  {
    "code": "110000",
    "name": "北京市",
    "children": [
      {
        "code": "110101",
        "name": "东城区"
      },
      ...
    ]
  },
  ...
  {
    "code": "130000",
    "name": "河北省",
    "children": [
      {
        "code": "130100",
        "name": "石家庄市"
      },
      ...
    ]
  }
  ...
]

note:

  • 对于一般的省份,第二级数据列出的是 地级市 + 直接隶属省级的区县
  • 对于直辖市、特别行政区等,第二级数据列出的是 区县 一级

二级数据(map)

省份 + 地级市(区县):二级数据(map)

{
  "110000": {
    "name": "北京市",
    "children": {
      "110101": {
        "name": "东城区"
      },
      ...
    }
  },
  "120000": {
    "name": "天津市",
    "children": {
      "120101": {
        "name": "和平区"
      },
      ...
    }
  },
  ...
}

三级数据

省份 + 地级市 + 区县:三级数据

[
  {
    "code": "110000",
    "name": "北京市",
    "children": [
      {
        "code": "110101",
        "name": "东城区"
      },
      ...
    ]
  },
  ...
  {
    "code": "130000",
    "name": "河北省",
    "children": [
      {
        "code": "130100",
        "name": "石家庄市",
        "children": [
          {
            "code": "130102",
            "name": "长安区"
          },
          ...
        ]
      },
      ...
    ]
  }
  ...
]

note:

  • 一般来说是按照 省份:地级市:区县 的顺序填入数据的
  • 对于直辖市、特别行政区等,第二级数据列出的是 区县 一级,而不存在第三级数据
  • 对于直接隶属省级的区县,第二级数据列出的是 区县 一级,而不存在第三级数据
  • 对于没有区县一级的地级市,不存在第三级数据

三级数据(填充至完整的 3 级)

省份 + 地级市 + 区县:三级数据(填充至完整的 3 级)

[
  {
    "code": "110000",
    "name": "北京市",
    "children": [
      {
        "code": "110101",
        "name": "东城区",
          "children": [
            {
              "code": "110101",
              "name": "东城区"
            }
          ]
      },
      ...
    ]
  },
  ...
  {
    "code": "130000",
    "name": "河北省",
    "children": [
      {
        "code": "130100",
        "name": "石家庄市",
        "children": [
          {
            "code": "130102",
            "name": "长安区"
          },
          ...
        ]
      },
      ...
    ]
  }
  ...
]

note:

  • 一般来说是按照 省份:地级市:区县 的顺序填入数据的
  • 对于直辖市、特别行政区等,第二级数据列出的是 区县 一级,第三级使用和第二级一样的数据
  • 对于直接隶属省级的区县,第二级数据列出的是 区县 一级,第三级使用和第二级一样的数据
  • 对于没有区县一级的地级市,第三级使用和第二级一样的数据

三级数据(map)

省份 + 地级市 + 区县:三级数据(map)

{
  "110000": {
    "name": "北京市",
    "children": {
      "110101": {
        "name": "东城区"
      },
      "110102": {
        "name": "西城区"
      },
      ...
    }
  },
  ...
}

三级数据(填充至完整的 3 级)(map)

省份 + 地级市 + 区县:三级数据(填充至完整的 3 级)(map)

{
  "110000": {
    "name": "北京市",
    "children": {
      "110101": {
        "name": "东城区",
        "children": {
          "110101": {
            "name": "东城区"
          }
        }
      },
      ...
    }
  },
  ...
}

特殊情况举例

  • 直辖市:北京、天津、上海、重庆
  • 特别行政区:香港、澳门
  • 直接隶属省级的区县:海南五指山市、琼海市等
  • 无区县的地级市:广东东莞、中山等

node

var chinaRegions = require('china-regions-data');

chinaRegions.list // 列表数据
chinaRegions.province // 省份数据
chinaRegions.city // 地级市数据
chinaRegions.district // 区县数据
chinaRegions.oneLevel // 一级数据
chinaRegions.twoLevels // 二级数据
chinaRegions.threeLevels // 三级数据
chinaRegions.threeLevelsFull // 三级数据(填充至完整的 3 级)
chinaRegions.threeLevelsMap // 三级数据(map)
chinaRegions.threeLevelsMapFull // 三级数据(填充至完整的 3 级)(map)

// 或者直接使用单个数据
var list = require('china-regions-data/list.json') // 列表数据
var province = require('china-regions-data/province.json') // 省份数据
var city = require('china-regions-data/city.json') // 地级市数据
var district = require('china-regions-data/district.json') // 区县数据
var oneLevel = require('china-regions-data/one-level.json') // 一级数据
var twoLevels = require('china-regions-data/two-levels.json') // 二级数据
var threeLevels = require('china-regions-data/three-levels.json') // 三级数据
var threeLevelsFull = require('china-regions-data/three-levels-full.json') // 三级数据(填充至完整的 3 级)
var threeLevelsMap = require('china-regions-data/three-levels-map.json') // 三级数据(map)
var threeLevelsMapFull = require('china-regions-data/three-levels-map-full.json') // 三级数据(填充至完整的 3 级)(map)