# china_cities
## Introduction
`china_cities` is a python package to list Chinese cities and provinces. The cities
can be retrieved in English or Chinese language.
The data is based on [`wikipedia`](https://en.wikipedia.org/wiki/List_of_cities_in_China) as a source
## Installation
### Install with pip
Run `pip install china-cities`
### Install from source
`git clone https://github.com/boeboe/china-cities.git`
Run `python setup.py install`
### Run tests
Run `make tests`
### Update source when wikipedia changed
Run `make generate`
## Usage
Some examples on how to use this package.
```python
from china_cities import *
for city in cities.get_cities():
print("english name:", city.name_en)
print("chinese name:", city.name_cn)
print("province: ", city.province)
for city_en in cities.get_cities_en():
print(city_en)
for city_cn in cities.get_cities_cn():
print(city_cn)
for province in cities.get_provinces():
print(province)
for province_city in cities.get_cities_by_province("Anhui"):
print(province_city.name_en)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/boeboe/china-cities",
"name": "china-cities",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "china chinese cities provinces",
"author": "Bart Van Bos",
"author_email": "bartvanbos@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/5c/42/e17e6e3eb706205d56928ee60ab83416f3d583742e99229c0226e03eff17/china_cities-0.0.4.tar.gz",
"platform": null,
"description": "# china_cities\n\n## Introduction\n\n`china_cities` is a python package to list Chinese cities and provinces. The cities \ncan be retrieved in English or Chinese language.\n\nThe data is based on [`wikipedia`](https://en.wikipedia.org/wiki/List_of_cities_in_China) as a source\n\n## Installation\n\n### Install with pip\n\nRun `pip install china-cities`\n\n### Install from source\n\n`git clone https://github.com/boeboe/china-cities.git`\n\nRun `python setup.py install`\n\n### Run tests\n\nRun `make tests`\n\n### Update source when wikipedia changed\n\nRun `make generate`\n\n## Usage\n\nSome examples on how to use this package.\n\n```python\nfrom china_cities import *\n\nfor city in cities.get_cities():\n print(\"english name:\", city.name_en)\n print(\"chinese name:\", city.name_cn)\n print(\"province: \", city.province)\n\nfor city_en in cities.get_cities_en():\n print(city_en)\n\nfor city_cn in cities.get_cities_cn():\n print(city_cn)\n\nfor province in cities.get_provinces():\n print(province)\n\nfor province_city in cities.get_cities_by_province(\"Anhui\"):\n print(province_city.name_en)\n\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python package to get the names of Chinese cities and provinces",
"version": "0.0.4",
"split_keywords": [
"china",
"chinese",
"cities",
"provinces"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "be3ce1d30e0d916086bcfe78c47e57ffe5b0f842f3e00c32a00654bdfaa28d2b",
"md5": "db7eb1e776dc8e1fdc9670b380a2f18d",
"sha256": "1694765b617f8d1ca9bc00d43232242e0a0349eee3b67e941ba5af2c182131c0"
},
"downloads": -1,
"filename": "china_cities-0.0.4-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "db7eb1e776dc8e1fdc9670b380a2f18d",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 10589,
"upload_time": "2023-04-10T11:10:08",
"upload_time_iso_8601": "2023-04-10T11:10:08.130869Z",
"url": "https://files.pythonhosted.org/packages/be/3c/e1d30e0d916086bcfe78c47e57ffe5b0f842f3e00c32a00654bdfaa28d2b/china_cities-0.0.4-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "350d70a47e32cf99b80d7fe41225407c0738004ce5abfe64b98d983934570180",
"md5": "03b9f4921ae22e7614a7ecbcc074b977",
"sha256": "18fbc9e45402364807ea5056684c754a43cc9421d13d17aeefa631516b4e72b2"
},
"downloads": -1,
"filename": "china_cities-0.0.4-py3.10.egg",
"has_sig": false,
"md5_digest": "03b9f4921ae22e7614a7ecbcc074b977",
"packagetype": "bdist_egg",
"python_version": "0.0.4",
"requires_python": null,
"size": 11367,
"upload_time": "2023-04-10T11:10:09",
"upload_time_iso_8601": "2023-04-10T11:10:09.375615Z",
"url": "https://files.pythonhosted.org/packages/35/0d/70a47e32cf99b80d7fe41225407c0738004ce5abfe64b98d983934570180/china_cities-0.0.4-py3.10.egg",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5c42e17e6e3eb706205d56928ee60ab83416f3d583742e99229c0226e03eff17",
"md5": "38558857e6a9238ab69a44098e8b2ead",
"sha256": "883106b61561ad76859e618ca2151f1f1003ab35d5541bbf71dddafd17e2b552"
},
"downloads": -1,
"filename": "china_cities-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "38558857e6a9238ab69a44098e8b2ead",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 11417,
"upload_time": "2023-04-10T11:10:11",
"upload_time_iso_8601": "2023-04-10T11:10:11.156596Z",
"url": "https://files.pythonhosted.org/packages/5c/42/e17e6e3eb706205d56928ee60ab83416f3d583742e99229c0226e03eff17/china_cities-0.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-10 11:10:11",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "boeboe",
"github_project": "china-cities",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "china-cities"
}