Skip to main content

A package for wards,districts,cities and provinces in Zimbabwe

Project description

https://img.shields.io/pypi/v/country_list.svg https://img.shields.io/badge/code%20style-black-000000.svg

Features

  • This is a python package that allows you to search for cities, provinces, and districts in Zimbabwe.Zimbabwe is split into eight provinces and two cities that are designated as provincial capitals. Districts are organized into 59 provinces.Wards are organized into 1,200 districts.Visit the project homepage for further information on how to use the package.

Installation

To can install the zim_places open shell or terminal and run:

pip install zim-places

Usage

Get all wards:

from zim_places import wards
print(wards.get_wards())

Get all districts:

from zim_places import districts
print(districts.get_districts())

Get all cities:

from zim_places import cities
print(cities.get_cities())

Get all provinces:

from zim_places import provinces
print(provinces.get_provinces())
from zim_places import *
import json

# Get the data as json
print(get_cities())
print(get_wards())
print(get_provinces())
print(get_districts())

# Get the data as a list of dictionaries, remember you can customize the list to suit your need
data = json.loads(get_wards())
list_of_wards = [{i['Ward'] + ' ' + i['Province_OR_District']} for i in data.values()]
print(list_of_wards)

data = json.loads(get_districts())
list_of_districts = [{i['District'] + ' ' + i['Province']} for i in data.values()]
print(list_of_districts)

data = json.loads(get_provinces())
list_of_provinces = [{i['Province'] + ' ' + i['Capital'] + i['Area(km2)'] + i['Population(2012 census)']} for i in data.values()]
print(list_of_provinces)

data = json.loads(get_cities())
list_of_cities = [{i['City'] + ' ' + i['Province']} for i in data.values()]
print(list_of_cities)

License

The project is licensed under the MIT license.

Change Log

2.0.0(24/01/22)

  • First Release of the Zim Places Library that will assist developers in providing names of places in zimbabwe

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

zim_places-2.0.0.tar.gz (12.6 kB view details)

Uploaded Source

File details

Details for the file zim_places-2.0.0.tar.gz.

File metadata

  • Download URL: zim_places-2.0.0.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for zim_places-2.0.0.tar.gz
Algorithm Hash digest
SHA256 eba479a3c4fc0ca508a6c4a4b17800db08c0bf080f84e7fd960635fac65c1ab2
MD5 0db832b04ea1db95db37950feae4cdbe
BLAKE2b-256 614942a27b1d9d5aa3613f2cc067d08663d431c9ca048f9f040a02af9e811c97

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page