Metadata-Version: 2.1
Name: china_cities
Version: 0.0.4
Summary: Python package to get the names of Chinese cities and provinces
Home-page: https://github.com/boeboe/china-cities
Author: Bart Van Bos
Author-email: bartvanbos@gmail.com
License: MIT
Keywords: china chinese cities provinces
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Software Distribution
Description-Content-Type: text/markdown
License-File: LICENSE

# 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)

```
