GithubHelp home page GithubHelp logo

catelemmon / china_regions Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wecatch/china_regions

1.0 2.0 0.0 2.49 MB

最全最新**省,市,地区json及sql数据

Home Page: http://wecatch.me/china_regions/

License: Apache License 2.0

Shell 0.03% JavaScript 99.54% HTML 0.21% Python 0.22%

china_regions's Introduction

china_regions

最全最新**省,市,地区 json 及 sql 数据,自动抓取国标 http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/2017/index.html 数据,并且自动生成 JavaScript es6 module 以及 sql 数据。

演示地址

http://wecatch.me/china_regions/

如何使用

数据分 json、es6 module、sql 三种格式存储,es6 module 和 sql 是根据 json 自动生成,json 数据又是根据最新国标生成,

├── json            # json 格式
├── mysql           # mysql sql 格式
├── postgresql      # postgresql 格式

直接拷贝 json 和 es6 文件可直接使用,也可以根据对应的语言生成不同的模块。

如何更新到最新国标

仓库中的现在的数据是根据最新国标生成,如果在使用中发现国标有变动,可以手动进行更新。

用 chrome 访问 国标,打开浏览器控制台,粘贴 pull.js 代码并执行,然后会生成 city.json 文件,在仓库目录下执行 mkdir src 创建 src 目录,拷贝 city.json 至 src,打开 makedata.py 执行 pull_data 函数生成最新 json 数据,然后再执行 main 函数生成最新 sql 以及 es6 module 数据。

反馈

如果国标页面 html 结构发生变化,请提 issue。

china_regions's People

Contributors

jayl1n avatar mofelee avatar zhyq0826 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.