Skip to main content

A package for working with Rwandan location metadata, including provinces, districts, sectors, cells, and villages.

Project description

Rwanda Locations

rwanda_locations is a Python package designed to provide easy access to Rwandan location metadata. This includes hierarchical data from provinces down to villages, as well as various utility functions to retrieve and manipulate this data.

Features

  • Retrieve provinces
  • Retrieve districts within a specific province
  • Retrieve sectors within a specific district
  • Retrieve cells within a specific sector
  • Retrieve villages within a specific cell
  • Get all child locations for a given level of hierarchy

Installation

You can install the package using pip. If you're installing from a local directory, navigate to the directory containing setup.py and run:

pip install .
# As the package is established by PyPI, you can install it using:
pip install rwanda_locations

Usage

Here’s how to use the package in your Python application:

from rwanda_locations.data import (
    get_provinces, get_districts_from_province, get_sectors_from_district,
    get_cells_from_sector, get_villages_from_cell, get_all_children
)

# Get all provinces
provinces = get_provinces()
print("Provinces:", provinces)

# Get districts in a specific province
districts = get_districts_from_province('East')
print("Districts in East Province:", districts)

# Get sectors in a specific district - For example: Nyagatare District
sectors = get_sectors_from_district('East', 'Nyagatare')
print("Sectors in Nyagatare District:", sectors)

# Get cells in a specific sector - For example: Nyagatare Sector
cells = get_cells_from_sector('East', 'Nyagatare', 'Nyagatare')
print("Cells in Nyagatare Sector:", cells)

# Get villages in a specific cell - For example: Barija Cell
villages = get_villages_from_cell('East', 'Nyagatare', 'Nyagatare', 'Barija')
print("Villages in Barija Cell:", villages)

# Get all children based on hierarchy level
children = get_all_children(province='East', district='Nyagatare', sector='Nyagatare')
print("Children in Nyagatare Sector:", children)

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Feel free to open issues and submit pull requests to improve the package. Your contributions are welcome!

Contact

For any questions or feedback, please contact Fredson Gisa Kaze at fredson.coder@gmail.com

Acknowledgements

Thank you for using rwanda_locations. We hope it helps you efficiently work with Rwandan location data!

Changelog

1.0

  • initial release
  • province names and other entities up-to villages(Imidugudu)
  • lookup() method
  • shapefile URLs for various regions

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

rwanda_locations-1.1.tar.gz (73.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rwanda_locations-1.1-py3-none-any.whl (73.8 kB view details)

Uploaded Python 3

File details

Details for the file rwanda_locations-1.1.tar.gz.

File metadata

  • Download URL: rwanda_locations-1.1.tar.gz
  • Upload date:
  • Size: 73.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for rwanda_locations-1.1.tar.gz
Algorithm Hash digest
SHA256 408922e3354ee15235868909834f8bf90f2f6ccb347d92b5a33fec70daa9574f
MD5 acdc6c2270d5087d6faa98fe553818a1
BLAKE2b-256 3e232a1c6e15981eafaa93a1b324ff93a5a6577c1a5ce1a310025f3bdd349680

See more details on using hashes here.

File details

Details for the file rwanda_locations-1.1-py3-none-any.whl.

File metadata

  • Download URL: rwanda_locations-1.1-py3-none-any.whl
  • Upload date:
  • Size: 73.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for rwanda_locations-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 563aae3d3aaf53b57f8f37b095a904954c18bee2a018043294b184d2b2bf7ab2
MD5 1b2fbf41b980c588536c52a57efb77e0
BLAKE2b-256 61ab0eb7d108fd4f43fa9f3577a4ffc9effbac61c827d588da05fb03c2c259c9

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