Skip to main content

The Python implementation for looking up the Chinese administrative divisions.

Project description


The Python implementation for looking up the Chinese administrative divisions.



$ pip install GB2260-v2

Basic Usage

The way to look up a administrative division by its GB2260 code is
the basic interface:

.. code-block:: python

>>> from gb2260_v2 import GB2260
>>> gb2260 = GB2260()
>>> division = gb2260.get('360426')
>>> print(division)
<Division 360426 德安县 rev=201801>

The data of a division is accessible to interfaces as following:

.. code-block:: python

>>> division.code
>>> division.is_county
>>> division.is_province
>>> division.is_prefecture
>>> print(division.province)
<Division 360000 江西省 rev=201801>
>>> print(division.prefecture)
<Division 360400 九江市 rev=201801>

See `Specification v0.2 <>`_ for details.


If you want to report bugs or request features, please create issues on
`GitHub Issues <>`_.

External Links

- `GB/T 2260-2002 in Wikipedia <>`_
- `Codes for administrative divisions of PRC <>`_

.. |GB/T 2260| image::
:alt: GB/T 2260
.. |Build Status| image::
:alt: Build Status
.. |Coverage Status| image::
:alt: Coverage Status
.. |Wheel Status| image::
:alt: Wheel Status
.. |PyPI Version| image::
:alt: PyPI Version

Project details

Release history Release notifications

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
GB2260_v2-0.2.0-py2.py3-none-any.whl (2.0 MB) Copy SHA256 hash SHA256 Wheel py2.py3
GB2260-v2-0.2.0.tar.gz (2.0 MB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page