province-city-china describes its data as updated, and prints a timestamp from March 2021
Complete and updated China administrative divisions (province, city, county, town) in JSON, CSV and SQL formats.
At a glance
- What is it?
- Five levels of Chinese administrative divisions published as JSON, CSV and SQL, split across one umbrella package and one scoped package per level so you install only what you need. The repository has been pushed to recently and released three times since the data stopped changing, and one of its three upstream sources has been deleted.
- Who is it for?
- province-city-china suits a form with a province, city and district picker, where shipping five levels of division data inside your bundle is worse than shipping a dependency, and where 2021 boundaries are acceptable. It does not suit anything where administrative boundaries have to be current, and it does not suit a project that needs the country and region code list, because that package is built from a source that no longer exists.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 46 days ago.
- What is it written in?
- Mainly JavaScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 25, 2026, and from our analysis. They are not legal advice.
Star history
- uiwjs/province-city-china3,078 ★ · +36
| Repository | 2026-09-24 | 2026-11-25 |
|---|---|---|
| uiwjs/province-city-china | 3k | 3.1k |
36 Stars in the last 62 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
The readme prints a data timestamp from March 2021
The single most useful line in this readme is a timestamp in a code block.
It reads as a data update time of 2021-03-22, in China standard time, and it sits directly under the sentence describing what the dataset contains. So the currency of the data is stated precisely, in the first screen of the document, with no interpretation required.
That sits awkwardly beside how the project describes itself. The repository description, in both languages, calls the data complete and updated, and the readme's own framing is that this is the most complete and most current source of province, city, district and township data.
Neither claim is a lie. The dataset really is a deep one: five levels, from province through prefecture, county, township and village, which is more than most Western datasets offer. But complete and updated are two different claims, and only one of them has a date attached.
The practical consequence is that this is a dependency to pin and check, not one to assume. Do not assume the printed timestamp describes the current package: the core README also identifies a national geographic names API dated October 2026. Check the actual package version and its data against an authoritative source before relying on it for current boundaries.
One of the three upstream sources has been deleted
The older Chinese readme lists three historical sources, one marked deleted. The current core README also lists the national geographic names API, dated October 2026, and strikes through the older links.
The first is the administrative division codes published by the Ministry of Civil Affairs, dated January 2021. The second is the statistics bureau's urban and rural division coding standard, dated December 2021. These are historical references; the core README now strikes through both links.
The third is the country and region codes list from the human resources ministry, dated 2011-12-06. That entry is struck through and carries a note, in Chinese, that the data has been deleted.
The documentation marks the country and region source as deleted; the other two historical links are also struck through in the current core README. And the deleted one is not incidental: it is the upstream for the country and region codes package, which appears in the package table alongside the province, city and district packages as the level that covers countries and regions.
That is a real gap in the deliverable. A package that can be installed and whose build command is documented will install cleanly and produce whatever the last successful fetch captured, with no error at install time to tell you the source is gone. Anyone who needs those codes should treat that package as a frozen snapshot rather than a maintained dataset.
It is also the kind of failure mode this project would detect if its own check step covered every level, which is a separate point.
The last logged data update is 2022, and three releases came after it
The historical data update log provides a partial history, but its last listed entry alone does not establish when the data stopped changing. The current core README also describes a national geographic names API dated October 2026.
The log has thirteen entries. The most recent two are both dated 2022-03-22, comparing consecutive major versions. Then come 2022-02-08, 2021-05-11, 2020-11-24, 2020-11-05, and an entry from 2020-07-28 with a note that the county-and-above divisions were unchanged and the changes were all below county level. The rest are 2020 and 2019 entries, mostly pointing at individual commits rather than version comparisons.
So the last recorded data update is March 2022.
The release list tells you what happened since. The three most recent tags are from October 2022, November 2023 and September 2024, all with the same minor version sequence. Three releases after the last logged data refresh.
A later repository update and the 2026 API reference mean the historical log should not be treated as proof that data maintenance has stopped.
The printed timestamp and the log disagree, so neither should be assumed to represent the contents of every release. Either way, the practical guidance is the same: check the version you are pinning, and check the timestamp it carries.
Installing the package and building from the repository
Package consumers and contributors use different workflows.
The install section gives a single command that adds the umbrella package as a dev dependency, using npm:
npm install province-city-china --save-devThe current repository contains `package-lock.json`, and the root scripts invoke npm workspace commands for `packages/core`. A contributor running the build pipeline should use the repository's current instructions and an npm version that supports workspaces.
There is a second related detail in the same manifest. The only runtime dependency of the root package is the release tool, at a 5.x version, listed as a dependency rather than a development dependency. That is not harmful on its own, but it means the root package is carrying a build tool in its install graph, and anyone reading the manifest to see what the project needs has to know that most of it is tooling.
The version script is also unusual in a way that is worth reading before running it: it force-publishes every package with an exact version, and it is configured not to push and not to create a git tag.
Eight build steps in the data pipeline
The pipeline is documented as an eight-step chain, and the step names are the interesting part.
The root has a start script that runs all eight in sequence: fetch the province, city and district data; fetch the Hong Kong and Macao district data; check the district data; fetch the street and township data; generate the SQL and the JSON file; regenerate the level data; fetch long-distance telephone area codes; and copy the data into each package.
Each of those eight is also its own script. Each has a banner comment describing what it does, and the banners use Chinese angle brackets as placeholders: fetch the province city and district data, fetch the Hong Kong and Macao district data, and so on, with the level and format names in the bracket positions.
The circled-number entries are descriptive banners in `package.json`. The actual runnable scripts have names such as `get`, `hongkong`, `check`, `get:town`, `sql`, `level`, `code`, and `copy`.
The seventh step fetches telephone area codes. The script list alone does not establish whether any unavailable upstream source fails silently; check the relevant implementation and its output.
Install one level, not all five, and the readme says dev dependency
The packaging design is the part of this project worth copying.
There is an umbrella package containing everything, and alongside it a set of scoped packages, one per administrative level: one for the country and region codes, one holding the full dataset, and separate ones for the province level, which covers provinces, municipalities and special administrative regions, and for the prefecture level, with more following.
So a form that needs provinces, cities and counties installs three small packages instead of one large one. For a country of this size and five levels of nesting, that is the difference between a dependency you can bundle and one you cannot.
The install instruction is the part to think about. It adds the umbrella package as a dev dependency rather than as a production dependency, which is what the readme literally says to do.
That is defensible for a data package used to generate a lookup table at build time, and wrong for one imported at runtime by a server. Nothing in the readme distinguishes the two cases, so the single line is doing work it probably should not.
The description in the manifest names the national standard the codes come from, which is the one piece of provenance in the metadata: the division codes are a published national standard rather than a private compilation.
A badge link is missing a slash, and the tree has two readmes
Two small things in the tree and the header, both of which affect whether the documentation is usable.
The first is a broken link. Among the row of badges near the top, one URL has no separator between the host and the path, so it reads as the host immediately followed by the account name and the repository. It will not resolve, and it is the network-graph badge.
The second is that the repository has two readmes, one in English and one in Chinese, alongside a single licence file and a single configuration file for automated dependency updates. So the documentation is properly bilingual, which is more than most data packages manage, and the maintenance tooling is minimal: one configuration file driving dependency updates automatically.
What is not in the tree is anything about how the data is validated. The pipeline includes a check step between fetching the Hong Kong and Macao data and fetching the township data, and it is described in the pipeline as checking the district data, so there is a validation step in there somewhere. What it validates, and against what, is not stated anywhere in the readme.
For a dataset whose entire value is being right about administrative boundaries, that is the missing piece. The check step exists; its coverage is undocumented.
Editorial conclusion
province-city-china suits a form with a province, city and district picker, where shipping five levels of division data inside your bundle is worse than shipping a dependency, and where 2021 boundaries are acceptable. It does not suit anything where administrative boundaries have to be current, and it does not suit a project that needs the country and region code list, because that package is built from a source that no longer exists. Before you use it, check three things: whether the divisions your users select changed since 2021, which for a handful of cities they have; which level you actually need, since the packages are split so you can install one; and which level the country code package covers, because its upstream page is gone.
Frequently asked questions
What does the province-city-china package contain?
China's administrative divisions at five levels, from province through prefecture, county, township and village, sourced from the Ministry of Civil Affairs division codes and the national statistics bureau's urban and rural division coding standard, published as JSON, CSV and SQL. The dataset is split into scoped packages per level so you install only the level you need, alongside an umbrella package that contains everything.
How current is the province-city-china data?
The readme prints a data update timestamp of 2021-03-22 in China standard time, and lists its two live upstream sources as updated in January and December 2021. A third source, the country and region codes list, is struck through with a note that its data has been deleted. The last entry in the data update log is dated 2022-03-22, and three releases were published after that.
How do I install province-city-china?
The readme gives one command, adding the umbrella package as a dev dependency, and each level is also published as its own scoped package. Note that the repository's own build scripts invoke a different package manager from the one the install instruction names, so having both available avoids a confusing failure when you run the pipeline.
Can I use the province-city-china country and region codes package?
It installs, but its upstream source is gone. The country and region codes entry in the readme is struck through with a note that the data has been deleted, and that entry is the upstream for the scoped package covering countries and regions. Treat that level as a frozen snapshot rather than a maintained dataset, and check it against the current published list if the codes matter to you.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/uiwjs-province-city-china)Star history chart for your README
[](https://hysenlabs.com/projects/uiwjs-province-city-china)Was this useful?