lists.arthurdejong.org
RSS feed

python-stdnum branch master updated. 1.1-6-ge107457

[Date Prev][Date Next] [Thread Prev][Thread Next]

python-stdnum branch master updated. 1.1-6-ge107457



This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "python-stdnum".

The branch, master has been updated
       via  e107457287328afb8800b521db0939c67c0035af (commit)
       via  6308261e00dfa3094db4d5cbd3934e211004d102 (commit)
       via  12ba35214afef27d4db2de453857bde3d905e784 (commit)
      from  a1a134e91b0ca3ccdff69929c4555c62e10c8714 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://arthurdejong.org/git/python-stdnum/commit/?id=e107457287328afb8800b521db0939c67c0035af

commit e107457287328afb8800b521db0939c67c0035af
Merge: a1a134e 6308261
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Sun Jul 12 14:29:18 2015 +0200

    Merge changes to use CN Open Data

diff --cc getcnloc.py
index c54d68b,9004b83..965e283
--- a/getcnloc.py
+++ b/getcnloc.py
@@@ -1,8 -1,8 +1,8 @@@
  #!/usr/bin/env python
  
--# getcnloc.py - script to fetch data from the China (PRC) government site
++# getcnloc.py - script to fetch data from the CN Open Data community
  #
--# Copyright (C) 2014 Jiangge Zhang
++# Copyright (C) 2014-2015 Jiangge Zhang
  # Copyright (C) 2015 Arthur de Jong
  #
  # This library is free software; you can redistribute it and/or
@@@ -98,15 -81,15 +81,13 @@@ def group_data(data_collection)
  def print_data_file(file):
      print("# generated from National Bureau of Statistics of the People's",
            file=file)
-     print('# Republic of China, downloaded from %s' % revisions_url, 
file=file)
-     url, dt = max(get_revisions(revisions_url), key=itemgetter(1))
-     print('# %s (revision %s)' % (url, dt), file=file)
-     for city_code, city_data in group_records(url):
-         if not all(city_data.values()):
-             continue
-         city_pairs = ' '.join(
-             '%s="%s"' % (k, v) for k, v in sorted(city_data.items()) if v)
-         print('%s %s' % (city_code, city_pairs), file=file)
+     print('# Republic of China, downloaded from %s' % data_url, file=file)
+     print('# %s' % datetime.utcnow(), file=file)
 -
+     print('Downloading...', file=sys.stderr)
+     data_collection = fetch_data()
 -
+     print('Generating...', file=sys.stderr)
+     for data in group_data(data_collection):
+         print('%s county="%s" prefecture="%s" province="%s"' % data, 
file=file)
  
  
  if __name__ == '__main__':

http://arthurdejong.org/git/python-stdnum/commit/?id=6308261e00dfa3094db4d5cbd3934e211004d102

commit 6308261e00dfa3094db4d5cbd3934e211004d102
Author: Jiangge Zhang <tonyseek@gmail.com>
Date:   Mon Jun 8 18:01:44 2015 +0800

    Download and generate latest Chinese location data.

diff --git a/stdnum/cn/loc.dat b/stdnum/cn/loc.dat
index fbf373f..b6cff7d 100644
--- a/stdnum/cn/loc.dat
+++ b/stdnum/cn/loc.dat
@@ -1,8 +1,10 @@
 # generated from National Bureau of Statistics of the People's
-# Republic of China, downloaded from http://www.stats.gov.cn/tjsj/tjbz/xzqhdm/
-# http://www.stats.gov.cn/tjsj/tjbz/xzqhdm/201504/t20150415_712722.html 
(revision 2015-04-15)
+# Republic of China, downloaded from https://github.com/cn/GB2260
+# 2015-06-08 09:43:51.705262
 110101 county="东城区" prefecture="市辖区" province="北京市"
 110102 county="西城区" prefecture="市辖区" province="北京市"
+110103 county="崇文区" prefecture="市辖区" province="北京市"
+110104 county="宣武区" prefecture="市辖区" province="北京市"
 110105 county="朝阳区" prefecture="市辖区" province="北京市"
 110106 county="丰台区" prefecture="市辖区" province="北京市"
 110107 county="石景山区" prefecture="市辖区" province="北京市"
@@ -23,6 +25,9 @@
 120104 county="南开区" prefecture="市辖区" province="天津市"
 120105 county="河北区" prefecture="市辖区" province="天津市"
 120106 county="红桥区" prefecture="市辖区" province="天津市"
+120107 county="塘沽区" prefecture="市辖区" province="天津市"
+120108 county="汉沽区" prefecture="市辖区" province="天津市"
+120109 county="大港区" prefecture="市辖区" province="天津市"
 120110 county="东丽区" prefecture="市辖区" province="天津市"
 120111 county="西青区" prefecture="市辖区" province="天津市"
 120112 county="津南区" prefecture="市辖区" province="天津市"
@@ -35,6 +40,7 @@
 120225 county="蓟县" prefecture="县" province="天津市"
 130101 county="市辖区" prefecture="石家庄市" province="河北省"
 130102 county="长安区" prefecture="石家庄市" province="河北省"
+130103 county="桥东区" prefecture="石家庄市" province="河北省"
 130104 county="桥西区" prefecture="石家庄市" province="河北省"
 130105 county="新华区" prefecture="石家庄市" province="河北省"
 130107 county="井陉矿区" prefecture="石家庄市" province="河北省"
@@ -44,6 +50,7 @@
 130111 county="栾城区" prefecture="石家庄市" province="河北省"
 130121 county="井陉县" prefecture="石家庄市" province="河北省"
 130123 county="正定县" prefecture="石家庄市" province="河北省"
+130124 county="栾城县" prefecture="石家庄市" province="河北省"
 130125 county="行唐县" prefecture="石家庄市" province="河北省"
 130126 county="灵寿县" prefecture="石家庄市" province="河北省"
 130127 county="高邑县" prefecture="石家庄市" province="河北省"
@@ -53,8 +60,11 @@
 130131 county="平山县" prefecture="石家庄市" province="河北省"
 130132 county="元氏县" prefecture="石家庄市" province="河北省"
 130133 county="赵县" prefecture="石家庄市" province="河北省"
+130181 county="辛集市" prefecture="石家庄市" province="河北省"
+130182 county="藁城市" prefecture="石家庄市" province="河北省"
 130183 county="晋州市" prefecture="石家庄市" province="河北省"
 130184 county="新乐市" prefecture="石家庄市" province="河北省"
+130185 county="鹿泉市" prefecture="石家庄市" province="河北省"
 130201 county="市辖区" prefecture="唐山市" province="河北省"
 130202 county="路南区" prefecture="唐山市" province="河北省"
 130203 county="路北区" prefecture="唐山市" province="河北省"
@@ -68,6 +78,7 @@
 130225 county="乐亭县" prefecture="唐山市" province="河北省"
 130227 county="迁西县" prefecture="唐山市" province="河北省"
 130229 county="玉田县" prefecture="唐山市" province="河北省"
+130230 county="唐海县" prefecture="唐山市" province="河北省"
 130281 county="遵化市" prefecture="唐山市" province="河北省"
 130283 county="迁安市" prefecture="唐山市" province="河北省"
 130301 county="市辖区" prefecture="秦皇岛市" province="河北省"
@@ -141,6 +152,7 @@
 130637 county="博野县" prefecture="保定市" province="河北省"
 130638 county="雄县" prefecture="保定市" province="河北省"
 130681 county="涿州市" prefecture="保定市" province="河北省"
+130682 county="定州市" prefecture="保定市" province="河北省"
 130683 county="安国市" prefecture="保定市" province="河北省"
 130684 county="高碑店市" prefecture="保定市" province="河北省"
 130701 county="市辖区" prefecture="张家口市" province="河北省"
@@ -345,6 +357,19 @@
 141130 county="交口县" prefecture="吕梁市" province="山西省"
 141181 county="孝义市" prefecture="吕梁市" province="山西省"
 141182 county="汾阳市" prefecture="吕梁市" province="山西省"
+142301 county="孝义市" prefecture="吕梁地区" province="山西省"
+142302 county="离石市" prefecture="吕梁地区" province="山西省"
+142303 county="汾阳市" prefecture="吕梁地区" province="山西省"
+142322 county="文水县" prefecture="吕梁地区" province="山西省"
+142323 county="交城县" prefecture="吕梁地区" province="山西省"
+142325 county="兴县" prefecture="吕梁地区" province="山西省"
+142326 county="临县" prefecture="吕梁地区" province="山西省"
+142327 county="柳林县" prefecture="吕梁地区" province="山西省"
+142328 county="石楼县" prefecture="吕梁地区" province="山西省"
+142329 county="岚县" prefecture="吕梁地区" province="山西省"
+142330 county="方山县" prefecture="吕梁地区" province="山西省"
+142332 county="中阳县" prefecture="吕梁地区" province="山西省"
+142333 county="交口县" prefecture="吕梁地区" province="山西省"
 150101 county="市辖区" prefecture="呼和浩特市" province="内蒙古自治区"
 150102 county="新城区" prefecture="呼和浩特市" province="内蒙古自治区"
 150103 county="回民区" prefecture="呼和浩特市" province="内蒙古自治区"
@@ -453,6 +478,24 @@
 152529 county="正镶白旗" prefecture="锡林郭勒盟" province="内蒙古自治区"
 152530 county="正蓝旗" prefecture="锡林郭勒盟" province="内蒙古自治区"
 152531 county="多伦县" prefecture="锡林郭勒盟" province="内蒙古自治区"
+152601 county="集宁市" prefecture="乌兰察布盟" province="内蒙古自治区"
+152602 county="丰镇市" prefecture="乌兰察布盟" province="内蒙古自治区"
+152624 county="卓资县" prefecture="乌兰察布盟" province="内蒙古自治区"
+152625 county="化德县" prefecture="乌兰察布盟" province="内蒙古自治区"
+152626 county="商都县" prefecture="乌兰察布盟" province="内蒙古自治区"
+152627 county="兴和县" prefecture="乌兰察布盟" province="内蒙古自治区"
+152629 county="凉城县" prefecture="乌兰察布盟" province="内蒙古自治区"
+152630 county="察哈尔右翼前旗" prefecture="乌兰察布盟" province="内蒙古自治区"
+152631 county="察哈尔右翼中旗" prefecture="乌兰察布盟" province="内蒙古自治区"
+152632 county="察哈尔右翼后旗" prefecture="乌兰察布盟" province="内蒙古自治区"
+152634 county="四子王旗" prefecture="乌兰察布盟" province="内蒙古自治区"
+152801 county="临河市" prefecture="巴彦淖尔盟" province="内蒙古自治区"
+152822 county="五原县" prefecture="巴彦淖尔盟" province="内蒙古自治区"
+152823 county="磴口县" prefecture="巴彦淖尔盟" province="内蒙古自治区"
+152824 county="乌拉特前旗" prefecture="巴彦淖尔盟" province="内蒙古自治区"
+152825 county="乌拉特中旗" prefecture="巴彦淖尔盟" province="内蒙古自治区"
+152826 county="乌拉特后旗" prefecture="巴彦淖尔盟" province="内蒙古自治区"
+152827 county="杭锦后旗" prefecture="巴彦淖尔盟" province="内蒙古自治区"
 152921 county="阿拉善左旗" prefecture="阿拉善盟" province="内蒙古自治区"
 152922 county="阿拉善右旗" prefecture="阿拉善盟" province="内蒙古自治区"
 152923 county="额济纳旗" prefecture="阿拉善盟" province="内蒙古自治区"
@@ -579,6 +622,7 @@
 220112 county="双阳区" prefecture="长春市" province="吉林省"
 220113 county="九台区" prefecture="长春市" province="吉林省"
 220122 county="农安县" prefecture="长春市" province="吉林省"
+220181 county="九台市" prefecture="长春市" province="吉林省"
 220182 county="榆树市" prefecture="长春市" province="吉林省"
 220183 county="德惠市" prefecture="长春市" province="吉林省"
 220201 county="市辖区" prefecture="吉林市" province="吉林省"
@@ -613,16 +657,19 @@
 220582 county="集安市" prefecture="通化市" province="吉林省"
 220601 county="市辖区" prefecture="白山市" province="吉林省"
 220602 county="浑江区" prefecture="白山市" province="吉林省"
+220604 county="江源区" prefecture="白山市" province="吉林省"
 220605 county="江源区" prefecture="白山市" province="吉林省"
 220621 county="抚松县" prefecture="白山市" province="吉林省"
 220622 county="靖宇县" prefecture="白山市" province="吉林省"
 220623 county="长白朝鲜族自治县" prefecture="白山市" province="吉林省"
+220625 county="江源县" prefecture="白山市" province="吉林省"
 220681 county="临江市" prefecture="白山市" province="吉林省"
 220701 county="市辖区" prefecture="松原市" province="吉林省"
 220702 county="宁江区" prefecture="松原市" province="吉林省"
 220721 county="前郭尔罗斯蒙古族自治县" prefecture="松原市" province="吉林省"
 220722 county="长岭县" prefecture="松原市" province="吉林省"
 220723 county="乾安县" prefecture="松原市" province="吉林省"
+220724 county="扶余县" prefecture="松原市" province="吉林省"
 220781 county="扶余市" prefecture="松原市" province="吉林省"
 220801 county="市辖区" prefecture="白城市" province="吉林省"
 220802 county="洮北区" prefecture="白城市" province="吉林省"
@@ -642,11 +689,15 @@
 230102 county="道里区" prefecture="哈尔滨市" province="黑龙江省"
 230103 county="南岗区" prefecture="哈尔滨市" province="黑龙江省"
 230104 county="道外区" prefecture="哈尔滨市" province="黑龙江省"
+230105 county="太平区" prefecture="哈尔滨市" province="黑龙江省"
+230106 county="香坊区" prefecture="哈尔滨市" province="黑龙江省"
+230107 county="动力区" prefecture="哈尔滨市" province="黑龙江省"
 230108 county="平房区" prefecture="哈尔滨市" province="黑龙江省"
 230109 county="松北区" prefecture="哈尔滨市" province="黑龙江省"
 230110 county="香坊区" prefecture="哈尔滨市" province="黑龙江省"
 230111 county="呼兰区" prefecture="哈尔滨市" province="黑龙江省"
 230112 county="阿城区" prefecture="哈尔滨市" province="黑龙江省"
+230121 county="呼兰县" prefecture="哈尔滨市" province="黑龙江省"
 230123 county="依兰县" prefecture="哈尔滨市" province="黑龙江省"
 230124 county="方正县" prefecture="哈尔滨市" province="黑龙江省"
 230125 county="宾县" prefecture="哈尔滨市" province="黑龙江省"
@@ -654,6 +705,7 @@
 230127 county="木兰县" prefecture="哈尔滨市" province="黑龙江省"
 230128 county="通河县" prefecture="哈尔滨市" province="黑龙江省"
 230129 county="延寿县" prefecture="哈尔滨市" province="黑龙江省"
+230181 county="阿城市" prefecture="哈尔滨市" province="黑龙江省"
 230182 county="双城市" prefecture="哈尔滨市" province="黑龙江省"
 230183 county="尚志市" prefecture="哈尔滨市" province="黑龙江省"
 230184 county="五常市" prefecture="哈尔滨市" province="黑龙江省"
@@ -731,6 +783,7 @@
 230722 county="嘉荫县" prefecture="伊春市" province="黑龙江省"
 230781 county="铁力市" prefecture="伊春市" province="黑龙江省"
 230801 county="市辖区" prefecture="佳木斯市" province="黑龙江省"
+230802 county="永红区" prefecture="佳木斯市" province="黑龙江省"
 230803 county="向阳区" prefecture="佳木斯市" province="黑龙江省"
 230804 county="前进区" prefecture="佳木斯市" province="黑龙江省"
 230805 county="东风区" prefecture="佳木斯市" province="黑龙江省"
@@ -775,10 +828,15 @@
 231281 county="安达市" prefecture="绥化市" province="黑龙江省"
 231282 county="肇东市" prefecture="绥化市" province="黑龙江省"
 231283 county="海伦市" prefecture="绥化市" province="黑龙江省"
+232701 county="加格达奇区" prefecture="大兴安岭地区" province="黑龙江省"
+232702 county="松岭区" prefecture="大兴安岭地区" province="黑龙江省"
+232703 county="新林区" prefecture="大兴安岭地区" province="黑龙江省"
+232704 county="呼中区" prefecture="大兴安岭地区" province="黑龙江省"
 232721 county="呼玛县" prefecture="大兴安岭地区" province="黑龙江省"
 232722 county="塔河县" prefecture="大兴安岭地区" province="黑龙江省"
 232723 county="漠河县" prefecture="大兴安岭地区" province="黑龙江省"
 310101 county="黄浦区" prefecture="市辖区" province="上海市"
+310103 county="卢湾区" prefecture="市辖区" province="上海市"
 310104 county="徐汇区" prefecture="市辖区" province="上海市"
 310105 county="长宁区" prefecture="市辖区" province="上海市"
 310106 county="静安区" prefecture="市辖区" province="上海市"
@@ -793,13 +851,16 @@
 310116 county="金山区" prefecture="市辖区" province="上海市"
 310117 county="松江区" prefecture="市辖区" province="上海市"
 310118 county="青浦区" prefecture="市辖区" province="上海市"
+310119 county="南汇区" prefecture="市辖区" province="上海市"
 310120 county="奉贤区" prefecture="市辖区" province="上海市"
 310230 county="崇明县" prefecture="县" province="上海市"
 320101 county="市辖区" prefecture="南京市" province="江苏省"
 320102 county="玄武区" prefecture="南京市" province="江苏省"
+320103 county="白下区" prefecture="南京市" province="江苏省"
 320104 county="秦淮区" prefecture="南京市" province="江苏省"
 320105 county="建邺区" prefecture="南京市" province="江苏省"
 320106 county="鼓楼区" prefecture="南京市" province="江苏省"
+320107 county="下关区" prefecture="南京市" province="江苏省"
 320111 county="浦口区" prefecture="南京市" province="江苏省"
 320113 county="栖霞区" prefecture="南京市" province="江苏省"
 320114 county="雨花台区" prefecture="南京市" province="江苏省"
@@ -807,6 +868,8 @@
 320116 county="六合区" prefecture="南京市" province="江苏省"
 320117 county="溧水区" prefecture="南京市" province="江苏省"
 320118 county="高淳区" prefecture="南京市" province="江苏省"
+320124 county="溧水县" prefecture="南京市" province="江苏省"
+320125 county="高淳县" prefecture="南京市" province="江苏省"
 320201 county="市辖区" prefecture="无锡市" province="江苏省"
 320202 county="崇安区" prefecture="无锡市" province="江苏省"
 320203 county="南长区" prefecture="无锡市" province="江苏省"
@@ -819,11 +882,13 @@
 320301 county="市辖区" prefecture="徐州市" province="江苏省"
 320302 county="鼓楼区" prefecture="徐州市" province="江苏省"
 320303 county="云龙区" prefecture="徐州市" province="江苏省"
+320304 county="九里区" prefecture="徐州市" province="江苏省"
 320305 county="贾汪区" prefecture="徐州市" province="江苏省"
 320311 county="泉山区" prefecture="徐州市" province="江苏省"
 320312 county="铜山区" prefecture="徐州市" province="江苏省"
 320321 county="丰县" prefecture="徐州市" province="江苏省"
 320322 county="沛县" prefecture="徐州市" province="江苏省"
+320323 county="铜山县" prefecture="徐州市" province="江苏省"
 320324 county="睢宁县" prefecture="徐州市" province="江苏省"
 320381 county="新沂市" prefecture="徐州市" province="江苏省"
 320382 county="邳州市" prefecture="徐州市" province="江苏省"
@@ -836,6 +901,9 @@
 320481 county="溧阳市" prefecture="常州市" province="江苏省"
 320482 county="金坛市" prefecture="常州市" province="江苏省"
 320501 county="市辖区" prefecture="苏州市" province="江苏省"
+320502 county="沧浪区" prefecture="苏州市" province="江苏省"
+320503 county="平江区" prefecture="苏州市" province="江苏省"
+320504 county="金阊区" prefecture="苏州市" province="江苏省"
 320505 county="虎丘区" prefecture="苏州市" province="江苏省"
 320506 county="吴中区" prefecture="苏州市" province="江苏省"
 320507 county="相城区" prefecture="苏州市" province="江苏省"
@@ -844,6 +912,7 @@
 320581 county="常熟市" prefecture="苏州市" province="江苏省"
 320582 county="张家港市" prefecture="苏州市" province="江苏省"
 320583 county="昆山市" prefecture="苏州市" province="江苏省"
+320584 county="吴江市" prefecture="苏州市" province="江苏省"
 320585 county="太仓市" prefecture="苏州市" province="江苏省"
 320601 county="市辖区" prefecture="南通市" province="江苏省"
 320602 county="崇川区" prefecture="南通市" province="江苏省"
@@ -853,11 +922,14 @@
 320623 county="如东县" prefecture="南通市" province="江苏省"
 320681 county="启东市" prefecture="南通市" province="江苏省"
 320682 county="如皋市" prefecture="南通市" province="江苏省"
+320683 county="通州市" prefecture="南通市" province="江苏省"
 320684 county="海门市" prefecture="南通市" province="江苏省"
 320701 county="市辖区" prefecture="连云港市" province="江苏省"
 320703 county="连云区" prefecture="连云港市" province="江苏省"
+320705 county="新浦区" prefecture="连云港市" province="江苏省"
 320706 county="海州区" prefecture="连云港市" province="江苏省"
 320707 county="赣榆区" prefecture="连云港市" province="江苏省"
+320721 county="赣榆县" prefecture="连云港市" province="江苏省"
 320722 county="东海县" prefecture="连云港市" province="江苏省"
 320723 county="灌云县" prefecture="连云港市" province="江苏省"
 320724 county="灌南县" prefecture="连云港市" province="江苏省"
@@ -878,15 +950,18 @@
 320923 county="阜宁县" prefecture="盐城市" province="江苏省"
 320924 county="射阳县" prefecture="盐城市" province="江苏省"
 320925 county="建湖县" prefecture="盐城市" province="江苏省"
+320928 county="盐都县" prefecture="盐城市" province="江苏省"
 320981 county="东台市" prefecture="盐城市" province="江苏省"
 320982 county="大丰市" prefecture="盐城市" province="江苏省"
 321001 county="市辖区" prefecture="扬州市" province="江苏省"
 321002 county="广陵区" prefecture="扬州市" province="江苏省"
 321003 county="邗江区" prefecture="扬州市" province="江苏省"
+321011 county="维扬区" prefecture="扬州市" province="江苏省"
 321012 county="江都区" prefecture="扬州市" province="江苏省"
 321023 county="宝应县" prefecture="扬州市" province="江苏省"
 321081 county="仪征市" prefecture="扬州市" province="江苏省"
 321084 county="高邮市" prefecture="扬州市" province="江苏省"
+321088 county="江都市" prefecture="扬州市" province="江苏省"
 321101 county="市辖区" prefecture="镇江市" province="江苏省"
 321102 county="京口区" prefecture="镇江市" province="江苏省"
 321111 county="润州区" prefecture="镇江市" province="江苏省"
@@ -901,9 +976,11 @@
 321281 county="兴化市" prefecture="泰州市" province="江苏省"
 321282 county="靖江市" prefecture="泰州市" province="江苏省"
 321283 county="泰兴市" prefecture="泰州市" province="江苏省"
+321284 county="姜堰市" prefecture="泰州市" province="江苏省"
 321301 county="市辖区" prefecture="宿迁市" province="江苏省"
 321302 county="宿城区" prefecture="宿迁市" province="江苏省"
 321311 county="宿豫区" prefecture="宿迁市" province="江苏省"
+321321 county="宿豫县" prefecture="宿迁市" province="江苏省"
 321322 county="沭阳县" prefecture="宿迁市" province="江苏省"
 321323 county="泗阳县" prefecture="宿迁市" province="江苏省"
 321324 county="泗洪县" prefecture="宿迁市" province="江苏省"
@@ -963,8 +1040,10 @@
 330602 county="越城区" prefecture="绍兴市" province="浙江省"
 330603 county="柯桥区" prefecture="绍兴市" province="浙江省"
 330604 county="上虞区" prefecture="绍兴市" province="浙江省"
+330621 county="绍兴县" prefecture="绍兴市" province="浙江省"
 330624 county="新昌县" prefecture="绍兴市" province="浙江省"
 330681 county="诸暨市" prefecture="绍兴市" province="浙江省"
+330682 county="上虞市" prefecture="绍兴市" province="浙江省"
 330683 county="嵊州市" prefecture="绍兴市" province="浙江省"
 330701 county="市辖区" prefecture="金华市" province="浙江省"
 330702 county="婺城区" prefecture="金华市" province="浙江省"
@@ -1021,6 +1100,7 @@
 340201 county="市辖区" prefecture="芜湖市" province="安徽省"
 340202 county="镜湖区" prefecture="芜湖市" province="安徽省"
 340203 county="弋江区" prefecture="芜湖市" province="安徽省"
+340204 county="新芜区" prefecture="芜湖市" province="安徽省"
 340207 county="鸠江区" prefecture="芜湖市" province="安徽省"
 340208 county="三山区" prefecture="芜湖市" province="安徽省"
 340221 county="芜湖县" prefecture="芜湖市" province="安徽省"
@@ -1043,6 +1123,7 @@
 340406 county="潘集区" prefecture="淮南市" province="安徽省"
 340421 county="凤台县" prefecture="淮南市" province="安徽省"
 340501 county="市辖区" prefecture="马鞍山市" province="安徽省"
+340502 county="金家庄区" prefecture="马鞍山市" province="安徽省"
 340503 county="花山区" prefecture="马鞍山市" province="安徽省"
 340504 county="雨山区" prefecture="马鞍山市" province="安徽省"
 340506 county="博望区" prefecture="马鞍山市" province="安徽省"
@@ -1103,6 +1184,12 @@
 341322 county="萧县" prefecture="宿州市" province="安徽省"
 341323 county="灵璧县" prefecture="宿州市" province="安徽省"
 341324 county="泗县" prefecture="宿州市" province="安徽省"
+341401 county="市辖区" prefecture="巢湖市" province="安徽省"
+341402 county="居巢区" prefecture="巢湖市" province="安徽省"
+341421 county="庐江县" prefecture="巢湖市" province="安徽省"
+341422 county="无为县" prefecture="巢湖市" province="安徽省"
+341423 county="含山县" prefecture="巢湖市" province="安徽省"
+341424 county="和县" prefecture="巢湖市" province="安徽省"
 341501 county="市辖区" prefecture="六安市" province="安徽省"
 341502 county="金安区" prefecture="六安市" province="安徽省"
 341503 county="裕安区" prefecture="六安市" province="安徽省"
@@ -1144,7 +1231,9 @@
 350181 county="福清市" prefecture="福州市" province="福建省"
 350182 county="长乐市" prefecture="福州市" province="福建省"
 350201 county="市辖区" prefecture="厦门市" province="福建省"
+350202 county="鼓浪屿区" prefecture="厦门市" province="福建省"
 350203 county="思明区" prefecture="厦门市" province="福建省"
+350204 county="开元区" prefecture="厦门市" province="福建省"
 350205 county="海沧区" prefecture="厦门市" province="福建省"
 350206 county="湖里区" prefecture="厦门市" province="福建省"
 350211 county="集美区" prefecture="厦门市" province="福建省"
@@ -1284,6 +1373,7 @@
 360734 county="寻乌县" prefecture="赣州市" province="江西省"
 360735 county="石城县" prefecture="赣州市" province="江西省"
 360781 county="瑞金市" prefecture="赣州市" province="江西省"
+360782 county="南康市" prefecture="赣州市" province="江西省"
 360801 county="市辖区" prefecture="吉安市" province="江西省"
 360802 county="吉州区" prefecture="吉安市" province="江西省"
 360803 county="青原区" prefecture="吉安市" province="江西省"
@@ -1348,6 +1438,7 @@
 370201 county="市辖区" prefecture="青岛市" province="山东省"
 370202 county="市南区" prefecture="青岛市" province="山东省"
 370203 county="市北区" prefecture="青岛市" province="山东省"
+370205 county="四方区" prefecture="青岛市" province="山东省"
 370211 county="黄岛区" prefecture="青岛市" province="山东省"
 370212 county="崂山区" prefecture="青岛市" province="山东省"
 370213 county="李沧区" prefecture="青岛市" province="山东省"
@@ -1355,6 +1446,7 @@
 370281 county="胶州市" prefecture="青岛市" province="山东省"
 370282 county="即墨市" prefecture="青岛市" province="山东省"
 370283 county="平度市" prefecture="青岛市" province="山东省"
+370284 county="胶南市" prefecture="青岛市" province="山东省"
 370285 county="莱西市" prefecture="青岛市" province="山东省"
 370301 county="市辖区" prefecture="淄博市" province="山东省"
 370302 county="淄川区" prefecture="淄博市" province="山东省"
@@ -1405,6 +1497,7 @@
 370785 county="高密市" prefecture="潍坊市" province="山东省"
 370786 county="昌邑市" prefecture="潍坊市" province="山东省"
 370801 county="市辖区" prefecture="济宁市" province="山东省"
+370802 county="市中区" prefecture="济宁市" province="山东省"
 370811 county="任城区" prefecture="济宁市" province="山东省"
 370812 county="兖州区" prefecture="济宁市" province="山东省"
 370826 county="微山县" prefecture="济宁市" province="山东省"
@@ -1415,9 +1508,11 @@
 370831 county="泗水县" prefecture="济宁市" province="山东省"
 370832 county="梁山县" prefecture="济宁市" province="山东省"
 370881 county="曲阜市" prefecture="济宁市" province="山东省"
+370882 county="兖州市" prefecture="济宁市" province="山东省"
 370883 county="邹城市" prefecture="济宁市" province="山东省"
 370901 county="市辖区" prefecture="泰安市" province="山东省"
 370902 county="泰山区" prefecture="泰安市" province="山东省"
+370903 county="岱岳区" prefecture="泰安市" province="山东省"
 370911 county="岱岳区" prefecture="泰安市" province="山东省"
 370921 county="宁阳县" prefecture="泰安市" province="山东省"
 370923 county="东平县" prefecture="泰安市" province="山东省"
@@ -1426,6 +1521,7 @@
 371001 county="市辖区" prefecture="威海市" province="山东省"
 371002 county="环翠区" prefecture="威海市" province="山东省"
 371003 county="文登区" prefecture="威海市" province="山东省"
+371081 county="文登市" prefecture="威海市" province="山东省"
 371082 county="荣成市" prefecture="威海市" province="山东省"
 371083 county="乳山市" prefecture="威海市" province="山东省"
 371101 county="市辖区" prefecture="日照市" province="山东省"
@@ -1452,6 +1548,7 @@
 371401 county="市辖区" prefecture="德州市" province="山东省"
 371402 county="德城区" prefecture="德州市" province="山东省"
 371403 county="陵城区" prefecture="德州市" province="山东省"
+371421 county="陵县" prefecture="德州市" province="山东省"
 371422 county="宁津县" prefecture="德州市" province="山东省"
 371423 county="庆云县" prefecture="德州市" province="山东省"
 371424 county="临邑县" prefecture="德州市" province="山东省"
@@ -1476,6 +1573,7 @@
 371621 county="惠民县" prefecture="滨州市" province="山东省"
 371622 county="阳信县" prefecture="滨州市" province="山东省"
 371623 county="无棣县" prefecture="滨州市" province="山东省"
+371624 county="沾化县" prefecture="滨州市" province="山东省"
 371625 county="博兴县" prefecture="滨州市" province="山东省"
 371626 county="邹平县" prefecture="滨州市" province="山东省"
 371701 county="市辖区" prefecture="菏泽市" province="山东省"
@@ -1518,6 +1616,7 @@
 410304 county="瀍河回族区" prefecture="洛阳市" province="河南省"
 410305 county="涧西区" prefecture="洛阳市" province="河南省"
 410306 county="吉利区" prefecture="洛阳市" province="河南省"
+410307 county="洛龙区" prefecture="洛阳市" province="河南省"
 410311 county="洛龙区" prefecture="洛阳市" province="河南省"
 410322 county="孟津县" prefecture="洛阳市" province="河南省"
 410323 county="新安县" prefecture="洛阳市" province="河南省"
@@ -1577,6 +1676,7 @@
 410822 county="博爱县" prefecture="焦作市" province="河南省"
 410823 county="武陟县" prefecture="焦作市" province="河南省"
 410825 county="温县" prefecture="焦作市" province="河南省"
+410881 county="济源市" prefecture="焦作市" province="河南省"
 410882 county="沁阳市" prefecture="焦作市" province="河南省"
 410883 county="孟州市" prefecture="焦作市" province="河南省"
 410901 county="市辖区" prefecture="濮阳市" province="河南省"
@@ -1599,6 +1699,7 @@
 411104 county="召陵区" prefecture="漯河市" province="河南省"
 411121 county="舞阳县" prefecture="漯河市" province="河南省"
 411122 county="临颍县" prefecture="漯河市" province="河南省"
+411123 county="郾城县" prefecture="漯河市" province="河南省"
 411201 county="市辖区" prefecture="三门峡市" province="河南省"
 411202 county="湖滨区" prefecture="三门峡市" province="河南省"
 411221 county="渑池县" prefecture="三门峡市" province="河南省"
@@ -1689,6 +1790,7 @@
 420302 county="茅箭区" prefecture="十堰市" province="湖北省"
 420303 county="张湾区" prefecture="十堰市" province="湖北省"
 420304 county="郧阳区" prefecture="十堰市" province="湖北省"
+420321 county="郧县" prefecture="十堰市" province="湖北省"
 420322 county="郧西县" prefecture="十堰市" province="湖北省"
 420323 county="竹山县" prefecture="十堰市" province="湖北省"
 420324 county="竹溪县" prefecture="十堰市" province="湖北省"
@@ -1764,6 +1866,7 @@
 421224 county="通山县" prefecture="咸宁市" province="湖北省"
 421281 county="赤壁市" prefecture="咸宁市" province="湖北省"
 421301 county="市辖区" prefecture="随州市" province="湖北省"
+421302 county="曾都区" prefecture="随州市" province="湖北省"
 421303 county="曾都区" prefecture="随州市" province="湖北省"
 421321 county="随县" prefecture="随州市" province="湖北省"
 421381 county="广水市" prefecture="随州市" province="湖北省"
@@ -1787,6 +1890,7 @@
 430111 county="雨花区" prefecture="长沙市" province="湖南省"
 430112 county="望城区" prefecture="长沙市" province="湖南省"
 430121 county="长沙县" prefecture="长沙市" province="湖南省"
+430122 county="望城县" prefecture="长沙市" province="湖南省"
 430124 county="宁乡县" prefecture="长沙市" province="湖南省"
 430181 county="浏阳市" prefecture="长沙市" province="湖南省"
 430201 county="市辖区" prefecture="株洲市" province="湖南省"
@@ -1915,10 +2019,12 @@
 433127 county="永顺县" prefecture="湘西土家族苗族自治州" province="湖南省"
 433130 county="龙山县" prefecture="湘西土家族苗族自治州" province="湖南省"
 440101 county="市辖区" prefecture="广州市" province="广东省"
+440102 county="东山区" prefecture="广州市" province="广东省"
 440103 county="荔湾区" prefecture="广州市" province="广东省"
 440104 county="越秀区" prefecture="广州市" province="广东省"
 440105 county="海珠区" prefecture="广州市" province="广东省"
 440106 county="天河区" prefecture="广州市" province="广东省"
+440107 county="芳村区" prefecture="广州市" province="广东省"
 440111 county="白云区" prefecture="广州市" province="广东省"
 440112 county="黄埔区" prefecture="广州市" province="广东省"
 440113 county="番禺区" prefecture="广州市" province="广东省"
@@ -1927,10 +2033,14 @@
 440116 county="萝岗区" prefecture="广州市" province="广东省"
 440117 county="从化区" prefecture="广州市" province="广东省"
 440118 county="增城区" prefecture="广州市" province="广东省"
+440183 county="增城市" prefecture="广州市" province="广东省"
+440184 county="从化市" prefecture="广州市" province="广东省"
 440201 county="市辖区" prefecture="韶关市" province="广东省"
+440202 county="北江区" prefecture="韶关市" province="广东省"
 440203 county="武江区" prefecture="韶关市" province="广东省"
 440204 county="浈江区" prefecture="韶关市" province="广东省"
 440205 county="曲江区" prefecture="韶关市" province="广东省"
+440221 county="曲江县" prefecture="韶关市" province="广东省"
 440222 county="始兴县" prefecture="韶关市" province="广东省"
 440224 county="仁化县" prefecture="韶关市" province="广东省"
 440229 county="翁源县" prefecture="韶关市" province="广东省"
@@ -1950,13 +2060,19 @@
 440403 county="斗门区" prefecture="珠海市" province="广东省"
 440404 county="金湾区" prefecture="珠海市" province="广东省"
 440501 county="市辖区" prefecture="汕头市" province="广东省"
+440506 county="达濠区" prefecture="汕头市" province="广东省"
 440507 county="龙湖区" prefecture="汕头市" province="广东省"
+440508 county="金园区" prefecture="汕头市" province="广东省"
+440509 county="升平区" prefecture="汕头市" province="广东省"
+440510 county="河浦区" prefecture="汕头市" province="广东省"
 440511 county="金平区" prefecture="汕头市" province="广东省"
 440512 county="濠江区" prefecture="汕头市" province="广东省"
 440513 county="潮阳区" prefecture="汕头市" province="广东省"
 440514 county="潮南区" prefecture="汕头市" province="广东省"
 440515 county="澄海区" prefecture="汕头市" province="广东省"
 440523 county="南澳县" prefecture="汕头市" province="广东省"
+440582 county="潮阳市" prefecture="汕头市" province="广东省"
+440583 county="澄海市" prefecture="汕头市" province="广东省"
 440601 county="市辖区" prefecture="佛山市" province="广东省"
 440604 county="禅城区" prefecture="佛山市" province="广东省"
 440605 county="南海区" prefecture="佛山市" province="广东省"
@@ -1983,7 +2099,9 @@
 440883 county="吴川市" prefecture="湛江市" province="广东省"
 440901 county="市辖区" prefecture="茂名市" province="广东省"
 440902 county="茂南区" prefecture="茂名市" province="广东省"
+440903 county="茂港区" prefecture="茂名市" province="广东省"
 440904 county="电白区" prefecture="茂名市" province="广东省"
+440923 county="电白县" prefecture="茂名市" province="广东省"
 440981 county="高州市" prefecture="茂名市" province="广东省"
 440982 county="化州市" prefecture="茂名市" province="广东省"
 440983 county="信宜市" prefecture="茂名市" province="广东省"
@@ -2002,9 +2120,11 @@
 441322 county="博罗县" prefecture="惠州市" province="广东省"
 441323 county="惠东县" prefecture="惠州市" province="广东省"
 441324 county="龙门县" prefecture="惠州市" province="广东省"
+441381 county="惠阳市" prefecture="惠州市" province="广东省"
 441401 county="市辖区" prefecture="梅州市" province="广东省"
 441402 county="梅江区" prefecture="梅州市" province="广东省"
 441403 county="梅县区" prefecture="梅州市" province="广东省"
+441421 county="梅县" prefecture="梅州市" province="广东省"
 441422 county="大埔县" prefecture="梅州市" province="广东省"
 441423 county="丰顺县" prefecture="梅州市" province="广东省"
 441424 county="五华县" prefecture="梅州市" province="广东省"
@@ -2035,15 +2155,18 @@
 441823 county="阳山县" prefecture="清远市" province="广东省"
 441825 county="连山壮族瑶族自治县" prefecture="清远市" province="广东省"
 441826 county="连南瑶族自治县" prefecture="清远市" province="广东省"
+441827 county="清新县" prefecture="清远市" province="广东省"
 441881 county="英德市" prefecture="清远市" province="广东省"
 441882 county="连州市" prefecture="清远市" province="广东省"
 445101 county="市辖区" prefecture="潮州市" province="广东省"
 445102 county="湘桥区" prefecture="潮州市" province="广东省"
 445103 county="潮安区" prefecture="潮州市" province="广东省"
+445121 county="潮安县" prefecture="潮州市" province="广东省"
 445122 county="饶平县" prefecture="潮州市" province="广东省"
 445201 county="市辖区" prefecture="揭阳市" province="广东省"
 445202 county="榕城区" prefecture="揭阳市" province="广东省"
 445203 county="揭东区" prefecture="揭阳市" province="广东省"
+445221 county="揭东县" prefecture="揭阳市" province="广东省"
 445222 county="揭西县" prefecture="揭阳市" province="广东省"
 445224 county="惠来县" prefecture="揭阳市" province="广东省"
 445281 county="普宁市" prefecture="揭阳市" province="广东省"
@@ -2052,14 +2175,18 @@
 445303 county="云安区" prefecture="云浮市" province="广东省"
 445321 county="新兴县" prefecture="云浮市" province="广东省"
 445322 county="郁南县" prefecture="云浮市" province="广东省"
+445323 county="云安县" prefecture="云浮市" province="广东省"
 445381 county="罗定市" prefecture="云浮市" province="广东省"
 450101 county="市辖区" prefecture="南宁市" province="广西壮族自治区"
 450102 county="兴宁区" prefecture="南宁市" province="广西壮族自治区"
 450103 county="青秀区" prefecture="南宁市" province="广西壮族自治区"
+450104 county="城北区" prefecture="南宁市" province="广西壮族自治区"
 450105 county="江南区" prefecture="南宁市" province="广西壮族自治区"
+450106 county="永新区" prefecture="南宁市" province="广西壮族自治区"
 450107 county="西乡塘区" prefecture="南宁市" province="广西壮族自治区"
 450108 county="良庆区" prefecture="南宁市" province="广西壮族自治区"
 450109 county="邕宁区" prefecture="南宁市" province="广西壮族自治区"
+450121 county="邕宁县" prefecture="南宁市" province="广西壮族自治区"
 450122 county="武鸣县" prefecture="南宁市" province="广西壮族自治区"
 450123 county="隆安县" prefecture="南宁市" province="广西壮族自治区"
 450124 county="马山县" prefecture="南宁市" province="广西壮族自治区"
@@ -2085,6 +2212,7 @@
 450311 county="雁山区" prefecture="桂林市" province="广西壮族自治区"
 450312 county="临桂区" prefecture="桂林市" province="广西壮族自治区"
 450321 county="阳朔县" prefecture="桂林市" province="广西壮族自治区"
+450322 county="临桂县" prefecture="桂林市" province="广西壮族自治区"
 450323 county="灵川县" prefecture="桂林市" province="广西壮族自治区"
 450324 county="全州县" prefecture="桂林市" province="广西壮族自治区"
 450325 county="兴安县" prefecture="桂林市" province="广西壮族自治区"
@@ -2097,8 +2225,10 @@
 450332 county="恭城瑶族自治县" prefecture="桂林市" province="广西壮族自治区"
 450401 county="市辖区" prefecture="梧州市" province="广西壮族自治区"
 450403 county="万秀区" prefecture="梧州市" province="广西壮族自治区"
+450404 county="蝶山区" prefecture="梧州市" province="广西壮族自治区"
 450405 county="长洲区" prefecture="梧州市" province="广西壮族自治区"
 450406 county="龙圩区" prefecture="梧州市" province="广西壮族自治区"
+450411 county="市郊区" prefecture="梧州市" province="广西壮族自治区"
 450421 county="苍梧县" prefecture="梧州市" province="广西壮族自治区"
 450422 county="藤县" prefecture="梧州市" province="广西壮族自治区"
 450423 county="蒙山县" prefecture="梧州市" province="广西壮族自治区"
@@ -2187,6 +2317,9 @@
 460203 county="吉阳区" prefecture="三亚市" province="海南省"
 460204 county="天涯区" prefecture="三亚市" province="海南省"
 460205 county="崖州区" prefecture="三亚市" province="海南省"
+460321 county="西沙群岛" prefecture="三沙市" province="海南省"
+460322 county="南沙群岛" prefecture="三沙市" province="海南省"
+460323 county="中沙群岛的岛礁及其海域" prefecture="三沙市" province="海南省"
 469001 county="五指山市" prefecture="省直辖县级行政区划" province="海南省"
 469002 county="琼海市" prefecture="省直辖县级行政区划" province="海南省"
 469003 county="儋州市" prefecture="省直辖县级行政区划" province="海南省"
@@ -2203,6 +2336,15 @@
 469028 county="陵水黎族自治县" prefecture="省直辖县级行政区划" province="海南省"
 469029 county="保亭黎族苗族自治县" prefecture="省直辖县级行政区划" province="海南省"
 469030 county="琼中黎族苗族自治县" prefecture="省直辖县级行政区划" province="海南省"
+469031 county="西沙群岛" prefecture="省直辖县级行政区划" province="海南省"
+469032 county="南沙群岛" prefecture="省直辖县级行政区划" province="海南省"
+469033 county="中沙群岛的岛礁及其海域" prefecture="省直辖县级行政区划" province="海南省"
+469034 county="陵水黎族自治县" prefecture="省直辖县级行政区划" province="海南省"
+469035 county="保亭黎族苗族自治县" prefecture="省直辖县级行政区划" province="海南省"
+469036 county="琼中黎族苗族自治县" prefecture="省直辖县级行政区划" province="海南省"
+469037 county="西沙群岛" prefecture="省直辖县级行政区划" province="海南省"
+469038 county="南沙群岛" prefecture="省直辖县级行政区划" province="海南省"
+469039 county="中沙群岛的岛礁及其海域" prefecture="省直辖县级行政区划" province="海南省"
 500101 county="万州区" prefecture="市辖区" province="重庆市"
 500102 county="涪陵区" prefecture="市辖区" province="重庆市"
 500103 county="渝中区" prefecture="市辖区" province="重庆市"
@@ -2224,8 +2366,12 @@
 500119 county="南川区" prefecture="市辖区" province="重庆市"
 500120 county="璧山区" prefecture="市辖区" province="重庆市"
 500151 county="铜梁区" prefecture="市辖区" province="重庆市"
+500222 county="綦江县" prefecture="县" province="重庆市"
 500223 county="潼南县" prefecture="县" province="重庆市"
+500224 county="铜梁县" prefecture="县" province="重庆市"
+500225 county="大足县" prefecture="县" province="重庆市"
 500226 county="荣昌县" prefecture="县" province="重庆市"
+500227 county="璧山县" prefecture="县" province="重庆市"
 500228 county="梁平县" prefecture="县" province="重庆市"
 500229 county="城口县" prefecture="县" province="重庆市"
 500230 county="丰都县" prefecture="县" province="重庆市"
@@ -2241,6 +2387,10 @@
 500241 county="秀山土家族苗族自治县" prefecture="县" province="重庆市"
 500242 county="酉阳土家族苗族自治县" prefecture="县" province="重庆市"
 500243 county="彭水苗族土家族自治县" prefecture="县" province="重庆市"
+500381 county="江津市" prefecture="市" province="重庆市"
+500382 county="合川市" prefecture="市" province="重庆市"
+500383 county="永川市" prefecture="市" province="重庆市"
+500384 county="南川市" prefecture="市" province="重庆市"
 510101 county="市辖区" prefecture="成都市" province="四川省"
 510104 county="锦江区" prefecture="成都市" province="四川省"
 510105 county="青羊区" prefecture="成都市" province="四川省"
@@ -2253,6 +2403,7 @@
 510115 county="温江区" prefecture="成都市" province="四川省"
 510121 county="金堂县" prefecture="成都市" province="四川省"
 510122 county="双流县" prefecture="成都市" province="四川省"
+510123 county="温江县" prefecture="成都市" province="四川省"
 510124 county="郫县" prefecture="成都市" province="四川省"
 510129 county="大邑县" prefecture="成都市" province="四川省"
 510131 county="蒲江县" prefecture="成都市" province="四川省"
@@ -2308,6 +2459,7 @@
 510823 county="剑阁县" prefecture="广元市" province="四川省"
 510824 county="苍溪县" prefecture="广元市" province="四川省"
 510901 county="市辖区" prefecture="遂宁市" province="四川省"
+510902 county="市中区" prefecture="遂宁市" province="四川省"
 510903 county="船山区" prefecture="遂宁市" province="四川省"
 510904 county="安居区" prefecture="遂宁市" province="四川省"
 510921 county="蓬溪县" prefecture="遂宁市" province="四川省"
@@ -2352,6 +2504,7 @@
 511502 county="翠屏区" prefecture="宜宾市" province="四川省"
 511503 county="南溪区" prefecture="宜宾市" province="四川省"
 511521 county="宜宾县" prefecture="宜宾市" province="四川省"
+511522 county="南溪县" prefecture="宜宾市" province="四川省"
 511523 county="江安县" prefecture="宜宾市" province="四川省"
 511524 county="长宁县" prefecture="宜宾市" province="四川省"
 511525 county="高县" prefecture="宜宾市" province="四川省"
@@ -2369,6 +2522,7 @@
 511701 county="市辖区" prefecture="达州市" province="四川省"
 511702 county="通川区" prefecture="达州市" province="四川省"
 511703 county="达川区" prefecture="达州市" province="四川省"
+511721 county="达县" prefecture="达州市" province="四川省"
 511722 county="宣汉县" prefecture="达州市" province="四川省"
 511723 county="开江县" prefecture="达州市" province="四川省"
 511724 county="大竹县" prefecture="达州市" province="四川省"
@@ -2377,6 +2531,7 @@
 511801 county="市辖区" prefecture="雅安市" province="四川省"
 511802 county="雨城区" prefecture="雅安市" province="四川省"
 511803 county="名山区" prefecture="雅安市" province="四川省"
+511821 county="名山县" prefecture="雅安市" province="四川省"
 511822 county="荥经县" prefecture="雅安市" province="四川省"
 511823 county="汉源县" prefecture="雅安市" province="四川省"
 511824 county="石棉县" prefecture="雅安市" province="四川省"
@@ -2448,6 +2603,7 @@
 520111 county="花溪区" prefecture="贵阳市" province="贵州省"
 520112 county="乌当区" prefecture="贵阳市" province="贵州省"
 520113 county="白云区" prefecture="贵阳市" province="贵州省"
+520114 county="小河区" prefecture="贵阳市" province="贵州省"
 520115 county="观山湖区" prefecture="贵阳市" province="贵州省"
 520121 county="开阳县" prefecture="贵阳市" province="贵州省"
 520122 county="息烽县" prefecture="贵阳市" province="贵州省"
@@ -2499,6 +2655,16 @@
 520626 county="德江县" prefecture="铜仁市" province="贵州省"
 520627 county="沿河土家族自治县" prefecture="铜仁市" province="贵州省"
 520628 county="松桃苗族自治县" prefecture="铜仁市" province="贵州省"
+522201 county="铜仁市" prefecture="铜仁地区" province="贵州省"
+522222 county="江口县" prefecture="铜仁地区" province="贵州省"
+522223 county="玉屏侗族自治县" prefecture="铜仁地区" province="贵州省"
+522224 county="石阡县" prefecture="铜仁地区" province="贵州省"
+522225 county="思南县" prefecture="铜仁地区" province="贵州省"
+522226 county="印江土家族苗族自治县" prefecture="铜仁地区" province="贵州省"
+522227 county="德江县" prefecture="铜仁地区" province="贵州省"
+522228 county="沿河土家族自治县" prefecture="铜仁地区" province="贵州省"
+522229 county="松桃苗族自治县" prefecture="铜仁地区" province="贵州省"
+522230 county="万山特区" prefecture="铜仁地区" province="贵州省"
 522301 county="兴义市" prefecture="黔西南布依族苗族自治州" province="贵州省"
 522322 county="兴仁县" prefecture="黔西南布依族苗族自治州" province="贵州省"
 522323 county="普安县" prefecture="黔西南布依族苗族自治州" province="贵州省"
@@ -2507,6 +2673,14 @@
 522326 county="望谟县" prefecture="黔西南布依族苗族自治州" province="贵州省"
 522327 county="册亨县" prefecture="黔西南布依族苗族自治州" province="贵州省"
 522328 county="安龙县" prefecture="黔西南布依族苗族自治州" province="贵州省"
+522401 county="毕节市" prefecture="毕节地区" province="贵州省"
+522422 county="大方县" prefecture="毕节地区" province="贵州省"
+522423 county="黔西县" prefecture="毕节地区" province="贵州省"
+522424 county="金沙县" prefecture="毕节地区" province="贵州省"
+522425 county="织金县" prefecture="毕节地区" province="贵州省"
+522426 county="纳雍县" prefecture="毕节地区" province="贵州省"
+522427 county="威宁彝族回族苗族自治县" prefecture="毕节地区" province="贵州省"
+522428 county="赫章县" prefecture="毕节地区" province="贵州省"
 522601 county="凯里市" prefecture="黔东南苗族侗族自治州" province="贵州省"
 522622 county="黄平县" prefecture="黔东南苗族侗族自治州" province="贵州省"
 522623 county="施秉县" prefecture="黔东南苗族侗族自治州" province="贵州省"
@@ -2542,6 +2716,7 @@
 530112 county="西山区" prefecture="昆明市" province="云南省"
 530113 county="东川区" prefecture="昆明市" province="云南省"
 530114 county="呈贡区" prefecture="昆明市" province="云南省"
+530121 county="呈贡县" prefecture="昆明市" province="云南省"
 530122 county="晋宁县" prefecture="昆明市" province="云南省"
 530124 county="富民县" prefecture="昆明市" province="云南省"
 530125 county="宜良县" prefecture="昆明市" province="云南省"
@@ -2628,9 +2803,11 @@
 532502 county="开远市" prefecture="红河哈尼族彝族自治州" province="云南省"
 532503 county="蒙自市" prefecture="红河哈尼族彝族自治州" province="云南省"
 532504 county="弥勒市" prefecture="红河哈尼族彝族自治州" province="云南省"
+532522 county="蒙自县" prefecture="红河哈尼族彝族自治州" province="云南省"
 532523 county="屏边苗族自治县" prefecture="红河哈尼族彝族自治州" province="云南省"
 532524 county="建水县" prefecture="红河哈尼族彝族自治州" province="云南省"
 532525 county="石屏县" prefecture="红河哈尼族彝族自治州" province="云南省"
+532526 county="弥勒县" prefecture="红河哈尼族彝族自治州" province="云南省"
 532527 county="泸西县" prefecture="红河哈尼族彝族自治州" province="云南省"
 532528 county="元阳县" prefecture="红河哈尼族彝族自治州" province="云南省"
 532529 county="红河县" prefecture="红河哈尼族彝族自治州" province="云南省"
@@ -2638,6 +2815,7 @@
 532531 county="绿春县" prefecture="红河哈尼族彝族自治州" province="云南省"
 532532 county="河口瑶族自治县" prefecture="红河哈尼族彝族自治州" province="云南省"
 532601 county="文山市" prefecture="文山壮族苗族自治州" province="云南省"
+532621 county="文山县" prefecture="文山壮族苗族自治州" province="云南省"
 532622 county="砚山县" prefecture="文山壮族苗族自治州" province="云南省"
 532623 county="西畴县" prefecture="文山壮族苗族自治州" province="云南省"
 532624 county="麻栗坡县" prefecture="文山壮族苗族自治州" province="云南省"
@@ -2645,6 +2823,16 @@
 532626 county="丘北县" prefecture="文山壮族苗族自治州" province="云南省"
 532627 county="广南县" prefecture="文山壮族苗族自治州" province="云南省"
 532628 county="富宁县" prefecture="文山壮族苗族自治州" province="云南省"
+532701 county="思茅市" prefecture="思茅地区" province="云南省"
+532722 county="普洱哈尼族彝族自治县" prefecture="思茅地区" province="云南省"
+532723 county="墨江哈尼族自治县" prefecture="思茅地区" province="云南省"
+532724 county="景东彝族自治县" prefecture="思茅地区" province="云南省"
+532725 county="景谷傣族彝族自治县" prefecture="思茅地区" province="云南省"
+532726 county="镇沅彝族哈尼族拉祜族自治县" prefecture="思茅地区" province="云南省"
+532727 county="江城哈尼族彝族自治县" prefecture="思茅地区" province="云南省"
+532728 county="孟连傣族拉祜族佤族自治县" prefecture="思茅地区" province="云南省"
+532729 county="澜沧拉祜族自治县" prefecture="思茅地区" province="云南省"
+532730 county="西盟佤族自治县" prefecture="思茅地区" province="云南省"
 532801 county="景洪市" prefecture="西双版纳傣族自治州" province="云南省"
 532822 county="勐海县" prefecture="西双版纳傣族自治州" province="云南省"
 532823 county="勐腊县" prefecture="西双版纳傣族自治州" province="云南省"
@@ -2672,6 +2860,14 @@
 533421 county="香格里拉县" prefecture="迪庆藏族自治州" province="云南省"
 533422 county="德钦县" prefecture="迪庆藏族自治州" province="云南省"
 533423 county="维西傈僳族自治县" prefecture="迪庆藏族自治州" province="云南省"
+533521 county="临沧县" prefecture="临沧地区" province="云南省"
+533522 county="凤庆县" prefecture="临沧地区" province="云南省"
+533523 county="云县" prefecture="临沧地区" province="云南省"
+533524 county="永德县" prefecture="临沧地区" province="云南省"
+533525 county="镇康县" prefecture="临沧地区" province="云南省"
+533526 county="双江拉祜族佤族布朗族傣族自治县" prefecture="临沧地区" province="云南省"
+533527 county="耿马傣族佤族自治县" prefecture="临沧地区" province="云南省"
+533528 county="沧源佤族自治县" prefecture="临沧地区" province="云南省"
 540101 county="市辖区" prefecture="拉萨市" province="西藏自治区"
 540102 county="城关区" prefecture="拉萨市" province="西藏自治区"
 540121 county="林周县" prefecture="拉萨市" province="西藏自治区"
@@ -2722,6 +2918,24 @@
 542231 county="隆子县" prefecture="山南地区" province="西藏自治区"
 542232 county="错那县" prefecture="山南地区" province="西藏自治区"
 542233 county="浪卡子县" prefecture="山南地区" province="西藏自治区"
+542301 county="日喀则市" prefecture="日喀则地区" province="西藏自治区"
+542322 county="南木林县" prefecture="日喀则地区" province="西藏自治区"
+542323 county="江孜县" prefecture="日喀则地区" province="西藏自治区"
+542324 county="定日县" prefecture="日喀则地区" province="西藏自治区"
+542325 county="萨迦县" prefecture="日喀则地区" province="西藏自治区"
+542326 county="拉孜县" prefecture="日喀则地区" province="西藏自治区"
+542327 county="昂仁县" prefecture="日喀则地区" province="西藏自治区"
+542328 county="谢通门县" prefecture="日喀则地区" province="西藏自治区"
+542329 county="白朗县" prefecture="日喀则地区" province="西藏自治区"
+542330 county="仁布县" prefecture="日喀则地区" province="西藏自治区"
+542331 county="康马县" prefecture="日喀则地区" province="西藏自治区"
+542332 county="定结县" prefecture="日喀则地区" province="西藏自治区"
+542333 county="仲巴县" prefecture="日喀则地区" province="西藏自治区"
+542334 county="亚东县" prefecture="日喀则地区" province="西藏自治区"
+542335 county="吉隆县" prefecture="日喀则地区" province="西藏自治区"
+542336 county="聂拉木县" prefecture="日喀则地区" province="西藏自治区"
+542337 county="萨嘎县" prefecture="日喀则地区" province="西藏自治区"
+542338 county="岗巴县" prefecture="日喀则地区" province="西藏自治区"
 542421 county="那曲县" prefecture="那曲地区" province="西藏自治区"
 542422 county="嘉黎县" prefecture="那曲地区" province="西藏自治区"
 542423 county="比如县" prefecture="那曲地区" province="西藏自治区"
@@ -2770,6 +2984,7 @@
 610302 county="渭滨区" prefecture="宝鸡市" province="陕西省"
 610303 county="金台区" prefecture="宝鸡市" province="陕西省"
 610304 county="陈仓区" prefecture="宝鸡市" province="陕西省"
+610321 county="宝鸡县" prefecture="宝鸡市" province="陕西省"
 610322 county="凤翔县" prefecture="宝鸡市" province="陕西省"
 610323 county="岐山县" prefecture="宝鸡市" province="陕西省"
 610324 county="扶风县" prefecture="宝鸡市" province="陕西省"
@@ -2946,6 +3161,22 @@
 621226 county="礼县" prefecture="陇南市" province="甘肃省"
 621227 county="徽县" prefecture="陇南市" province="甘肃省"
 621228 county="两当县" prefecture="陇南市" province="甘肃省"
+622421 county="定西县" prefecture="定西地区" province="甘肃省"
+622424 county="通渭县" prefecture="定西地区" province="甘肃省"
+622425 county="陇西县" prefecture="定西地区" province="甘肃省"
+622426 county="渭源县" prefecture="定西地区" province="甘肃省"
+622427 county="临洮县" prefecture="定西地区" province="甘肃省"
+622428 county="漳县" prefecture="定西地区" province="甘肃省"
+622429 county="岷县" prefecture="定西地区" province="甘肃省"
+622621 county="武都县" prefecture="陇南地区" province="甘肃省"
+622623 county="宕昌县" prefecture="陇南地区" province="甘肃省"
+622624 county="成县" prefecture="陇南地区" province="甘肃省"
+622625 county="康县" prefecture="陇南地区" province="甘肃省"
+622626 county="文县" prefecture="陇南地区" province="甘肃省"
+622627 county="西和县" prefecture="陇南地区" province="甘肃省"
+622628 county="礼县" prefecture="陇南地区" province="甘肃省"
+622629 county="两当县" prefecture="陇南地区" province="甘肃省"
+622630 county="徽县" prefecture="陇南地区" province="甘肃省"
 622901 county="临夏市" prefecture="临夏回族自治州" province="甘肃省"
 622921 county="临夏县" prefecture="临夏回族自治州" province="甘肃省"
 622922 county="康乐县" prefecture="临夏回族自治州" province="甘肃省"
@@ -2976,6 +3207,12 @@
 630223 county="互助土族自治县" prefecture="海东市" province="青海省"
 630224 county="化隆回族自治县" prefecture="海东市" province="青海省"
 630225 county="循化撒拉族自治县" prefecture="海东市" province="青海省"
+632121 county="平安县" prefecture="海东地区" province="青海省"
+632122 county="民和回族土族自治县" prefecture="海东地区" province="青海省"
+632123 county="乐都县" prefecture="海东地区" province="青海省"
+632126 county="互助土族自治县" prefecture="海东地区" province="青海省"
+632127 county="化隆回族自治县" prefecture="海东地区" province="青海省"
+632128 county="循化撒拉族自治县" prefecture="海东地区" province="青海省"
 632221 county="门源回族自治县" prefecture="海北藏族自治州" province="青海省"
 632222 county="祁连县" prefecture="海北藏族自治州" province="青海省"
 632223 county="海晏县" prefecture="海北藏族自治州" province="青海省"
@@ -2996,6 +3233,7 @@
 632625 county="久治县" prefecture="果洛藏族自治州" province="青海省"
 632626 county="玛多县" prefecture="果洛藏族自治州" province="青海省"
 632701 county="玉树市" prefecture="玉树藏族自治州" province="青海省"
+632721 county="玉树县" prefecture="玉树藏族自治州" province="青海省"
 632722 county="杂多县" prefecture="玉树藏族自治州" province="青海省"
 632723 county="称多县" prefecture="玉树藏族自治州" province="青海省"
 632724 county="治多县" prefecture="玉树藏族自治州" province="青海省"
@@ -3015,16 +3253,22 @@
 640181 county="灵武市" prefecture="银川市" province="宁夏回族自治区"
 640201 county="市辖区" prefecture="石嘴山市" province="宁夏回族自治区"
 640202 county="大武口区" prefecture="石嘴山市" province="宁夏回族自治区"
+640203 county="石嘴山区" prefecture="石嘴山市" province="宁夏回族自治区"
 640205 county="惠农区" prefecture="石嘴山市" province="宁夏回族自治区"
 640221 county="平罗县" prefecture="石嘴山市" province="宁夏回族自治区"
+640222 county="陶乐县" prefecture="石嘴山市" province="宁夏回族自治区"
+640223 county="惠农县" prefecture="石嘴山市" province="宁夏回族自治区"
 640301 county="市辖区" prefecture="吴忠市" province="宁夏回族自治区"
 640302 county="利通区" prefecture="吴忠市" province="宁夏回族自治区"
 640303 county="红寺堡区" prefecture="吴忠市" province="宁夏回族自治区"
+640321 county="中卫县" prefecture="吴忠市" province="宁夏回族自治区"
+640322 county="中宁县" prefecture="吴忠市" province="宁夏回族自治区"
 640323 county="盐池县" prefecture="吴忠市" province="宁夏回族自治区"
 640324 county="同心县" prefecture="吴忠市" province="宁夏回族自治区"
 640381 county="青铜峡市" prefecture="吴忠市" province="宁夏回族自治区"
 640401 county="市辖区" prefecture="固原市" province="宁夏回族自治区"
 640402 county="原州区" prefecture="固原市" province="宁夏回族自治区"
+640421 county="海原县" prefecture="固原市" province="宁夏回族自治区"
 640422 county="西吉县" prefecture="固原市" province="宁夏回族自治区"
 640423 county="隆德县" prefecture="固原市" province="宁夏回族自治区"
 640424 county="泾源县" prefecture="固原市" province="宁夏回族自治区"
@@ -3040,6 +3284,7 @@
 650105 county="水磨沟区" prefecture="乌鲁木齐市" province="新疆维吾尔自治区"
 650106 county="头屯河区" prefecture="乌鲁木齐市" province="新疆维吾尔自治区"
 650107 county="达坂城区" prefecture="乌鲁木齐市" province="新疆维吾尔自治区"
+650108 county="东山区" prefecture="乌鲁木齐市" province="新疆维吾尔自治区"
 650109 county="米东区" prefecture="乌鲁木齐市" province="新疆维吾尔自治区"
 650121 county="乌鲁木齐县" prefecture="乌鲁木齐市" province="新疆维吾尔自治区"
 650201 county="市辖区" prefecture="克拉玛依市" province="新疆维吾尔自治区"
@@ -3055,6 +3300,7 @@
 652223 county="伊吾县" prefecture="哈密地区" province="新疆维吾尔自治区"
 652301 county="昌吉市" prefecture="昌吉回族自治州" province="新疆维吾尔自治区"
 652302 county="阜康市" prefecture="昌吉回族自治州" province="新疆维吾尔自治区"
+652303 county="米泉市" prefecture="昌吉回族自治州" province="新疆维吾尔自治区"
 652323 county="呼图壁县" prefecture="昌吉回族自治州" province="新疆维吾尔自治区"
 652324 county="玛纳斯县" prefecture="昌吉回族自治州" province="新疆维吾尔自治区"
 652325 county="奇台县" prefecture="昌吉回族自治州" province="新疆维吾尔自治区"

http://arthurdejong.org/git/python-stdnum/commit/?id=12ba35214afef27d4db2de453857bde3d905e784

commit 12ba35214afef27d4db2de453857bde3d905e784
Author: Jiangge Zhang <tonyseek@gmail.com>
Date:   Mon Jun 8 18:00:34 2015 +0800

    Download GB2260 data from github.com/cn.

diff --git a/getcnloc.py b/getcnloc.py
index c54d68b..9004b83 100755
--- a/getcnloc.py
+++ b/getcnloc.py
@@ -24,89 +24,72 @@ from __future__ import print_function, unicode_literals
 
 import sys
 import codecs
-from urlparse import urljoin
-from operator import itemgetter
+from collections import OrderedDict
 from datetime import datetime
 
 import requests
-import lxml.html
-
-
-revisions_url = 'http://www.stats.gov.cn/tjsj/tjbz/xzqhdm/'
-
-
-def make_etree(response, encoding='utf-8'):
-    if not response.ok:
-        args = (response.status_code, response.reason, response.url)
-        print('%d %s: %s' % args, file=sys.stderr)
-        sys.exit(-1)
-    response.encoding = encoding
-    return lxml.html.fromstring(response.text)
-
-
-def get_revisions(url):
-    """Return the links to versions of the published administrative division
-    codes."""
-    html = make_etree(requests.get(url))
-    anchors = html.xpath('.//div[@class="center_list"]/ul/li/a')
-    for anchor in anchors:
-        url = urljoin(url, anchor.attrib['href'])
-        date_text = anchor.findtext('.//span/*[@class="cont_tit02"]')
-        date = datetime.strptime(date_text, '%Y-%m-%d').date()
-        yield url, date
-
-
-def iter_records(url):
-    html = make_etree(requests.get(url))
-    lines = html.xpath('.//div[@class="xilan_con"]//p')
-    for line in lines:
-        line = ' '.join(line.xpath('.//text()'))
-        try:
-            city_code, city_name = line.strip().split()
-        except ValueError:
-            if line.strip():
-                print('invalid line: %r' % line, file=sys.stderr)
-        else:
-            yield city_code.strip(), city_name.strip()
-
-
-def group_records(url):
-
-    provinces = {}
-    prefectures = {}
-
-    for city_code, city_name in iter_records(url):
-        province_code = city_code[:2]
-        prefecture_code = city_code[2:4]
-        county_code = city_code[4:6]
 
-        county_name = None
 
-        if prefecture_code == '00':
-            provinces[province_code] = city_name
-        elif county_code == '00':
-            prefectures[prefecture_code] = city_name
+data_url = 'https://github.com/cn/GB2260'
+data_revisions = [
+    'GB2260-2002',
+    'GB2260-2003',
+    'GB2260-200306',
+    'GB2260-2004',
+    'GB2260-200403',
+    'GB2260-200409',
+    'GB2260-2005',
+    'GB2260-200506',
+    'GB2260-2006',
+    'GB2260-2007',
+    'GB2260-2008',
+    'GB2260-2009',
+    'GB2260-2010',
+    'GB2260-2011',
+    'GB2260-2012',
+    'GB2260-2013',
+    'GB2260',
+]
+
+
+def fetch_data():
+    data_collection = OrderedDict()
+    for revision in data_revisions:
+        response = requests.get('%s/raw/master/%s.txt' % (data_url, revision))
+        if response.ok:
+            print('%s is fetched' % revision, file=sys.stderr)
         else:
-            county_name = city_name
+            print('%s is missing' % revision, file=sys.stderr)
+            continue
+        for line in response.text.strip().split('\n'):
+            code, name = line.split('\t')
+            data_collection[code.strip()] = name.strip()
+    return data_collection
+
 
-        yield city_code, dict(
-            province=provinces.get(province_code),
-            prefecture=prefectures.get(prefecture_code),
-            county=county_name)
+def group_data(data_collection):
+    for code, name in sorted(data_collection.items()):
+        if code.endswith('00'):
+            continue  # county only
+        province_code = code[:2] + '0000'
+        prefecture_code = code[:4] + '00'
+        province_name = data_collection[province_code]
+        prefecture_name = data_collection[prefecture_code]
+        yield code, name, prefecture_name, province_name
 
 
 def print_data_file(file):
     print("# generated from National Bureau of Statistics of the People's",
           file=file)
-    print('# Republic of China, downloaded from %s' % revisions_url, file=file)
-    url, dt = max(get_revisions(revisions_url), key=itemgetter(1))
-    print('# %s (revision %s)' % (url, dt), file=file)
-    for city_code, city_data in group_records(url):
-        if not all(city_data.values()):
-            continue
-        city_pairs = ' '.join(
-            '%s="%s"' % (k, v) for k, v in sorted(city_data.items()) if v)
-        print('%s %s' % (city_code, city_pairs), file=file)
+    print('# Republic of China, downloaded from %s' % data_url, file=file)
+    print('# %s' % datetime.utcnow(), file=file)
+
+    print('Downloading...', file=sys.stderr)
+    data_collection = fetch_data()
+
+    print('Generating...', file=sys.stderr)
+    for data in group_data(data_collection):
+        print('%s county="%s" prefecture="%s" province="%s"' % data, file=file)
 
 
 if __name__ == '__main__':

-----------------------------------------------------------------------

Summary of changes:
 getcnloc.py       |  125 ++++++++++++---------------
 stdnum/cn/loc.dat |  250 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 301 insertions(+), 74 deletions(-)


hooks/post-receive
-- 
python-stdnum
-- 
To unsubscribe send an email to
python-stdnum-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/python-stdnum-commits/