Metadata-Version: 2.4
Name: rastertoolkit
Version: 0.4.5
Summary: Raster and shape tools
Author-email: Kurt Frey <kurt.frey@gatesfoundation.org>, Dejan Lukacevic <dejan.lukacevic@gatesfoundation.org>, Katherine Rosenfeld <katherine.rosenfeld@gatesfoundation.org>
License-Expression: MIT
Project-URL: Documentation, https://institutefordiseasemodeling.github.io/RasterToolkit/
Project-URL: Repository, https://github.com/InstituteforDiseaseModeling/RasterToolkit
Project-URL: Issues, https://github.com/InstituteforDiseaseModeling/RasterToolkit/issues
Keywords: modeling,IDM
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: matplotlib~=3.9
Requires-Dist: pyshp~=3.0
Requires-Dist: pyproj~=3.6
Requires-Dist: scikit-learn~=1.6
Requires-Dist: shapely~=2.0
Provides-Extra: docs
Requires-Dist: mkdocs-material; extra == "docs"
Requires-Dist: mkdocs-include-markdown-plugin; extra == "docs"
Requires-Dist: mkdocstrings-python; extra == "docs"
Requires-Dist: mkdocs-autoapi; extra == "docs"
Requires-Dist: mkdocs-glightbox; extra == "docs"
Requires-Dist: mkdocs-jupyter; extra == "docs"
Provides-Extra: lint
Requires-Dist: flake8; extra == "lint"
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Dynamic: license-file

# RasterToolkit

RasterToolkit is a Python package for processing rasters with minimal dependencies. For example, with rastertoolkit you can extract populations corresponding to an administrative shapefile from a raster file.

## Setup

Install from github:

    python -m pip install .

## Getting Started

A typical `raster_clip` API usage scenario:
```
    from rastertoolkit import raster_clip

    # Clipping raster with shapes  
    pop_dict = raster_clip(raster_file, shape_file)  
```
See the complete code in the WorldPop example (examples/worldpop)

A typical `shape_subdivide` API usage scenario:
```
    from rastertoolkit import shape_subdivide

    # Create shape subdivision layer
    subdiv_stem = shape_subdivide(shape_stem=shape_file)
```
See the complete code in the Shape Subdivision example (examples/shape_subdivide)


## Running Tests

Install additional packages (like pytest)::
```
    python -m pip install .[test]
```
Run `pytest` command::
```
    # Run unit tests (recommended during development)
    python -m pytest -m unit -v

    # Run test for a specific module, for example
    python -m pytest tests/test_shape.py -v     # run shape unit tests
    python -m pytest tests/test_download.py -v  # run GDx download tests

    # All tests (before a commit or merging a PR)
    python -m pytest -v
```
