Python package to get the names of Chinese cities and provinces
Project description
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
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.
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)
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.2.tar.gz
(9.7 kB
view hashes)
Built Distributions
china_cities-0.0.2-py3.7.egg
(11.4 kB
view hashes)
china_cities-0.0.2-py2.7.egg
(11.3 kB
view hashes)
Close
Hashes for china_cities-0.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd8dc7460e1dfab0034e0ae52dbff906c54294d100b8567fa184890dfffe3445 |
|
MD5 | 49d6947f8f32aa888e2fb9e7a256ba82 |
|
BLAKE2b-256 | 21471fd9832095dc26f525ede536d9fd33175f99f3ad8904038818427c039327 |