Skip to main content

pyguidos

pipeline status coverage report docs status PyPI version Downloads license

A Python interface to the main GuidosToolbox (GTB) modules for spatial pattern analysis

Overview

pyguidos is a Python interface to the main modules of GuidosToolbox (GTB), a scientific software package for pattern spatial analysis of raster images. This Python module provides programmatic access to the core GTB analytical tools, enabling reproducible landscape analysis workflows in Python scripts, Jupyter notebooks, and automated pipelines.

Repository Architecture & Contents

The official upstream home of pyguidos is hosted on code.europa.eu, the European Commission's institutional open-source repository platform (powered by a GitLab instance). To foster a completely open community, a synchronized mirror is maintained on GitHub.

If you browse the source files directly via either platform, the repository includes:

  • /pyguidos: The core package directory containing the source code, geospatial monitoring algorithms, and Numba-optimized modules (This is what is installed via pip).
  • /docs: Source files for automated Sphinx HTML documentation platform.
  • /notebooks: Interactive Jupyter notebooks demonstrating data visualization and workflow examples.
  • /tests: Comprehensive unit and integration test suites validating input parameters and mathematical integrity.

Modules

Function Description
frag() Fragmentation analysis
frag_gray() Grayscale Fragmentation analysis
frag_change() Fragmentation change
landmos() Landscape Mosaic
spa() Simplified Pattern Analysis
acc() Foreground Patch Size Accounting
rss() Restoration Status Summary
extract_by_polygon() Extract raster by polygon features

Documentation

Full API documentation is available at https://jrc-forest.pages.code.europa.eu/guidos/pyguidos.


Requirements

  • Python >= 3.10
  • numpy >2.0
  • rasterio >=1.4
  • scipy >=1.15
  • scikit-image>=0.26
  • matplotlib >=3.10
  • pyogrio >=0.10
  • geopandas >=1.1
  • shapely >=2.0
  • python-ternary >=1.0
  • numba >0.62
  • tbb >=2021.6.0; sys_platform == 'win32'
  • intel-openmp; sys_platform == 'linux'

Installation

1. Standard Installation

For general use, install the latest stable version directly via pip:

pip install pyguidos

2. Development installation

To install the latest development version directly from the official upstream repository on code.europa.eu without cloning:

pip install git+https://code.europa.eu/jrc-forest/guidos/pyguidos.git

3. Editable Installation (Recommended for Testing)

To run the example notebooks or contribute to the source code, you must clone the repository and install it in "editable" mode. This allows changes in the code to be reflected immediately.

  1. Clone the repository
git clone https://code.europa.eu/jrc-forest/guidos/pyguidos.git
cd pyguidos
  1. Create and activate a virtual environment using Python.
  • Windows
py -m venv myvenv
myvenv\Scripts\activate
  • Linux/Mac
python -m venv myvenv
source myvenv/bin/activate
  1. Install in editable mode with dependencies:
pip install -e .

This links module's source code directly to your Python environment, so any changes you make are immediately reflected without reinstallation.


Quick Start

Once installed, you can verify your setup and explore the available tools directly from your Python console or Jupyter Notebook.

import pyguidos as pg

# List all available analytical tools and their descriptions
pg.info()

# Get detailed documentation and methodology links for a specific tool
pg.info('landmos')

# Get full technical specification of a function
help(pg.landmos)

Usage Examples

import pyguidos as pg

# Fragmentation analysis (FAD)
result = pg.frag(
    in_tiff="my_map.tif",
    method="FAD",
    window_size=27
)

# Fragmentation analysis (FAC with 8-connectivity)
result = pg.frag(
    in_tiff="my_map.tif",
    method="FAC",
    window_size=27,
    connectivity=8
)

# Fragmentation analysis (FED - Foreground Edge Density)
result = pg.frag(
    in_tiff="my_map.tif",
    method="FED",
    window_size=27,
    connectivity=4
)

# Grayscale Fragmentation (tree cover density)
result = pg.frag_gray(
    in_tiff="tree_cover_density.tif",
    method="FAD",
    window_size=27,
    for_threshold=30
)

# Fragmentation change
result = pg.frag_change(
    in_tiff_t1="my_map2018_frag_fad_27.tif",
    in_tiff_t2="my_map2025_frag_fad_27.tif"
)

# Landscape Mosaic
result = pg.landmos(
    in_tiff="my_landcover.tif",
    window_size=33
)

# Simplified Pattern Analysis (SPA)
result = pg.spa(
    in_tiff="my_map.tif",
    edge_width=1,
    classes=6
)

# Foreground Patch Size Accounting
result = pg.acc(
    in_tiff="my_map.tif",
    thresholds=[10, 100, 1000, 10000]
)

# Raster Spatial Statistics
result = pg.rss(in_tiff="my_map.tif")

# Extract raster by polygon
pg.extract_by_polygon(
    shapefile_path="regions.shp",
    geotiff_path="my_map.tif",
    output_dir="output/",
    id_field="NAME"
)

Example data and Jupyter notebooks with worked examples are available in the /notebooks directory of the code.europa.eu primary repository.


Citation

If you use pyGuidos in your research, please cite both the GuidosToolbox software and this package:

GuidosToolbox:

  • Vogt P. and Riitters K. (2017). GuidosToolbox: universal digital image object analysis. European Journal of Remote Sensing, 50, 1, pp. 352-361. doi: 10.1080/22797254.2017.1330650

pyGuidos:

  • Caudullo G. and Vogt P. (2026). PyGuidos, A cross-platform Python interface to GuidosToolbox for landscape pattern analysis. In press.

Interactive Citation

You can get the plain-text citations directly in your Python console:

import pyguidos as pg
pg.citation()

Contributing & Issue Tracking

The primary development workspace for pyguidos is officially hosted on code.europa.eu. Because this institutional ecosystem requires an EU Login to post issues or submit code, we manage all public interaction transparently via our public GitHub mirror to guarantee open participation.

Bug Reports & Feature Requests

If you encounter a bug, have an installation issue, or wish to request an analytical feature, please do not use code.europa.eu. Instead, submit a ticket via the public GitHub Issue Tracker. This includes the peer-review audits associated with journal submissions.

Code Contributions

Contributions are highly welcome. To submit bug fixes, patches, or optimization code:

  1. Fork the public community mirror on GitHub.
  2. Create a new branch for your feature or fix (git checkout -b feature/your-feature-name).
  3. Make your changes and ensure existing tests pass cleanly (NUMBA_DISABLE_JIT=1 pytest tests/).
  4. Submit a Pull Request on the GitHub mirror.

For a complete, step-by-step developer walkthrough—including environment isolation setups, code formatting guidelines, and advanced testing parameters—please refer to our comprehensive Official Development & Contributing Guide.


Authors

European Commission, Joint Research Centre (JRC)


License

This project is licensed under the European Union Public Licence v1.2 (EUPL-1.2). See the LICENSE file for details.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyguidos-2.5.1.tar.gz (2.2 MB view details)

Uploaded Source

Built Distribution

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

pyguidos-2.5.1-py3-none-any.whl (2.1 MB view details)

Uploaded Python 3

File details

Details for the file pyguidos-2.5.1.tar.gz.

File metadata

  • Download URL: pyguidos-2.5.1.tar.gz
  • Upload date:
  • Size: 2.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for pyguidos-2.5.1.tar.gz
Algorithm Hash digest
SHA256 7cd17cbd188f52e5599d8a1b428421eb67f7c295b0a12698f45bf2ccde5f335b
MD5 aa9e31676a9cd9a5a6b305c1f7304a5f
BLAKE2b-256 46441be67e4e0faeba99f5b289ef9a96f7ce563da7ba55c528af945ae4744525

See more details on using hashes here.

File details

Details for the file pyguidos-2.5.1-py3-none-any.whl.

File metadata

  • Download URL: pyguidos-2.5.1-py3-none-any.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for pyguidos-2.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6382f0ee96bf5e183f4136d5e2c17b6800f153bdedcebcde3973c7905233fca9
MD5 2affdd88d6a235712537cb13ac1d7bb5
BLAKE2b-256 a6a92bd8655753fa0d7646f6f2af1dee8417f5d1872835e3341fff845cc2beb4

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.5.1 This release

2 files

2.5.0

2 files

2.4.1

2 files

2.4.0

2 files

2.3.2

2 files

2.3.1

2 files

2.3.0

2 files

Supported by

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