Skip to main content

Python package to get the names of Chinese cities and provinces

Project description



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 as a source


Install with pip

Run pip install china-cities

Install from source

git clone

Run python install

Run tests

Run make tests

Update source when wikipedia changed

Run make generate


Some examples on how to use this package.

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():

for city_cn in cities.get_cities_cn():

for province in cities.get_provinces():

for province_city in cities.get_cities_by_province("Anhui"):

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for china-cities, version 0.0.3
Filename, size File type Python version Upload date Hashes
Filename, size china_cities-0.0.3.tar.gz (9.7 kB) File type Source Python version None Upload date Hashes View
Filename, size china_cities-0.0.3-py2.py3-none-any.whl (10.6 kB) File type Wheel Python version py2.py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page