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.

Source Distribution

china_cities-0.0.4.tar.gz (11.4 kB view hashes)

Uploaded source

Built Distributions

china_cities-0.0.4-py3.10.egg (11.4 kB view hashes)

Uploaded 0 0 4

china_cities-0.0.4-py2.py3-none-any.whl (10.6 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page