npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

zw-places

v0.2.0

Published

Zimbabwe administrative places for developers: provinces, districts, optional wards, PCodes, aliases, and coordinates.

Readme

zw-places

Zimbabwe administrative places for developers.

zw-places provides provinces and districts by default, with wards available from a separate entry point so apps do not load the larger ward dataset unless they need it.

Install

npm install zw-places

Python and Flutter packages are also available from this repository:

pip install zw-places
dependencies:
  zw_places: ^0.1.0

Usage

ESM

import { getDistrict, getDistricts, getProvince, searchPlaces } from "zw-places";

getProvince("ZW12");
getDistricts("Manicaland");
getDistrict("Centenary");
searchPlaces("Muzarabani", { levels: ["admin2"] });

CommonJS

const { getDistricts, getProvince } = require("zw-places");

getProvince("12");
getDistricts("Mashonaland Central");

Wards

Wards are intentionally separate because wards.json is much larger than the province and district data.

import { getWards } from "zw-places/wards";

getWards("Harare");
const { getWards } = require("zw-places/wards");

getWards("ZW19");

Data Included

  • 10 provinces
  • 91 districts
  • 1961 wards
  • official PCodes
  • center coordinates
  • area in square kilometers
  • aliases for common alternate names

API

Default lightweight entry point:

import {
  metadata,
  provinces,
  districts,
  getMetadata,
  getProvinces,
  getProvince,
  getDistricts,
  getDistrict,
  getPlace,
  getProvinceForDistrict,
  getDistrictForWard,
  getChildren,
  getAncestors,
  searchPlaces,
  formatAddress,
  validateAddress,
  isValidProvince,
  isValidDistrict,
  normalize,
} from "zw-places";

getPlace("ZW1209");
getChildren("ZW12");
getAncestors("ZW1209");
searchPlaces("muzarab", { levels: ["admin2", "admin3"], limit: 10 });
formatAddress({ province: "ZW12", district: "ZW1209" });
validateAddress({ province: "ZW12", district: "ZW1209" });

Ward entry point:

import { wards, getWards, getWard, searchWards, isValidWard } from "zw-places/wards";

Other Packages

  • Python package source: packages/python
  • Flutter package source: packages/flutter

Validation commands:

PYTHONPATH=packages/python/src python3 -m unittest discover -s packages/python/tests
cd packages/flutter && flutter pub get && flutter analyze && flutter test

Raw JSON entry points for CommonJS or bundlers:

const provinces = require("zw-places/data/provinces.json");
const districts = require("zw-places/data/districts.json");
const wards = require("zw-places/data/wards.json");

CLI

Run locally from this repository:

npm run cli -- provinces
npm run cli -- province ZW12
npm run cli -- districts Manicaland
npm run cli -- district Mvurwi --json
npm run cli -- search muzarabani
npm run cli -- place ZW1209 --json
npm run cli -- children ZW12
npm run cli -- ancestors ZW1209
npm run cli -- validate ZW12 ZW1209
npm run cli -- wards Harare --limit 5

After package installation, the binary is:

zw-places province ZW12
zw-places wards Harare --json --limit 5

Bundle Size Warning

The default package entry point does not export or load wards. Import from zw-places/wards only when ward-level data is needed.

Approximate generated file sizes:

  • data/provinces.json: small
  • data/districts.json: medium
  • data/wards.json: large
  • data/all.json: large and intended for direct data users

License

CC BY 3.0 IGO. See LICENSE.