Skip to main content

lsapy: Land Suitability Analysis in Python

lsapy logo

Python Package Index Build Conda Version Supported Python Versions Project Status: Active - The project has reached a stable, usable state and is being actively developed. Testing Status Coverage Status (Coveralls) Ruff pre-commit.ci status Documentation Status Link to question issues Link to preprint on Research Square Zenodo DOI

lsapy is a highly customizable, open-source Python library designed to streamline and enhance Land Suitability Analysis (LSA) workflows. Its objective is to make conducting LSA in Python easier and more accessible to users. The package implements a fuzzy-logic approach and provides a set of objects that work together to deliver a flexible and user-defined LSA framework.

By relying on xarray objects for computation, lsapy is specifically designed to facilitate LSA under climate change projections. Moreover, the use of xarray allows for seamless integration with the broader Python ecosystem, such as dask for efficient parallel processing and matplotlib for data visualisation. The modular design of lsapy addresses some limitations of existing LSA tools by offering greater flexibility, reproducibility, and scalability for research and practical applications.

Quick Install

To install lsapy, you can use pip:

pip install lsapy

or conda:

conda install -c conda-forge lsapy

You can find the development installation instructions in the Contribution section.

Land Suitability Analysis (LSA)

Below is a quick example of how to conduct a land suitability analysis using lsapy.

# import modules
from lsapy import LandSuitabilityAnalysis, SuitabilityCriteria

# define your criteria
criteria = {
    "crit1": SuitabilityCriteria(
        name="criteria1",
        indicator=indicator1,  # xarray object
        func="function_name",
        fparams={"param1": value1, "param2": value2},
    ),
    "crit2": SuitabilityCriteria(
        name="criteria2",
        indicator=indicator2,  # xarray object
        func="another_function_name",
        fparams={"param1": value1, "param2": value2},
    ),
    # add all necessary criteria
}

# define your land suitability
lsa = LandSuitabilityAnalysis(
    land_use="land_use_name",
    criteria=criteria,
)

# run your analysis
lsa.run(params)

For more detailed tutorials and examples, please refer to the User Guide.

Contributing

lsapy is an open-source project and we welcome contributions from the community. If you are interested in contributing, please refer to the Contribution section for guidelines on how to get started helping us improve the library.

How to cite lsapy

If you use lsapy in your research or project, please consider citing it. The software is currently under review by pyOpenSci for publication in the Journal of Open Source Software (JOSS), and we will update this section with the relevant reference once the review process is complete. In the meantime, you can cite the preprint, which is available on Research Square : https://doi.org/10.21203/rs.3.rs-8399348/v1.

If you wish to cite a specific version of the software, you can find the relevant reference on Zenodo : https://doi.org/10.5281/zenodo.15015110.

Credits

The development of lsapy started as part of a PhD, funded by the Food Transition 2050 Joint Postgraduate School and hosted by the University of Canterbury in New Zealand.

Food Transition 2050 Logo University of Canterbury Logo

The Python package has been created following the pyOpenSci Guidebook.

Metadata

Release files for lsapy 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lsapy 0.5.0
File Size Uploaded Provenance Actions
lsapy-0.5.0.tar.gz 46.9 kB With provenance Details for lsapy-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lsapy 0.5.0
File Interpreter ABI Platform Actions
lsapy-0.5.0-py3-none-any.whl Python 3 none any Details for lsapy-0.5.0-py3-none-any.whl

Total release size: 73.5 kB

Release files / lsapy-0.5.0.tar.gz

Download URL lsapy-0.5.0.tar.gz
Size 46.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c31414b267db22f67c93fb19e127070146d570b083168e30b4795aee092f820e
BLAKE2b-256 checksum
How to use checksums
ceee8b3a51ade4516bf577e9ba3b47d632a7ece86a038797d43eed0ecb38b6d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

Release files / lsapy-0.5.0-py3-none-any.whl

Download URL lsapy-0.5.0-py3-none-any.whl
Size 26.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
902b32f119f9fc546ca5105825afaaf0b2d75e819193de84298ca331955069d4
BLAKE2b-256 checksum
How to use checksums
bb2fb0ca75d03f1f066a134fc0c322e52c10a346c8d36ebdb56da9aa3b742a08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

Security for lsapy 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for lsapy-0.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page