GOUDA
Good Old Utilities for Data Analysis
This is my Python toolkit of reusable utilities built up over years of data analysis and computer vision research. GOUDA covers the tasks that come up repeatedly across projects: navigating file systems, loading and processing images, visualizing results, and computing statistics.
Features
Path Management
GoudaPath— a chainable, callablePathLikethat makes working with research directory structures concise. Resolves multiple subdirectories at once, integrates with file/image discovery, and works anywhere a path is expected.
Image Processing
- Mask operations: semi-transparent overlays, border extraction, positive/negative colorization, image/mask/overlay lineups
- Segmentation utilities: GrabCut with probability thresholds, multi-threshold hysteresis-style binarization
- Spatial transforms: aspect-ratio-preserving resize, rotation with correct bounding-box handling, polar-to-Cartesian unrolling
- Cropping: bounding box extraction, crop-to-mask, crop-to-content
- Sharpness metrics: Laplacian variance, Sobel variance
- RGB-corrected
imread/imwrite(OpenCV defaults to BGR)
Visualization
print_grid— display any collection of images as a grid. Accepts flat lists, nested lists, dicts with per-image titles/labels, or NumPy arrays of 2–5 dimensions. Layout is automatic.
Data Utilities
to_uint8— smart normalization that infers the input range ([0,1],[-1,1],[0,255], or auto-rescale)rescale,arr_sample,iter_batch,flip_dict, and other NumPy/Python helpersParallelStats— numerically stable online mean/variance (Welford algorithm) with support for aggregating across separate datasets
More
...And plenty of other utility methods for everything from general data structures to specific hypothesis testing algorithms.
Usage
Navigating a project directory
from gouda import GoudaPath
data = GoudaPath("data/experiments")
# Get multiple child paths at once
train, val, test = data("train", "val", "test")
# Chain into subdirectories — works anywhere a path is expected
weights_dir = data("outputs")("weights")
weights_dir.ensure_dir() # create if it doesn't exist
# Find all images under a directory
image_paths = data("train").find_images(recursive=True)
Displaying images during exploratory analysis
from gouda.display import print_grid
# Flat list — grid layout is automatic
print_grid(images)
# Per-image titles and colormaps using dicts
print_grid([
{"image": original, "title": "Input"},
{"image": pred_mask, "title": "Prediction", "cmap": "hot"},
{"image": ground_truth,"title": "Ground Truth"},
])
# Automatically arrange N images into a square grid
print_grid(images, do_squarify=True, figsize=(12, 12))
Image processing
from gouda.image import add_mask, padded_resize, mask_by_triplet
# Overlay a probability map on an image as a semi-transparent colored mask
overlay = add_mask(image, prob_map, color="red", opacity=0.5)
# Resize to a target shape, padding to preserve aspect ratio instead of squeezing
resized = padded_resize(image, size=(512, 512))
# Convert a continuous probability map to a binary mask using dual thresholds
# (only keeps foreground regions where the peak signal exceeds upper_thresh)
binary = mask_by_triplet(prob_map, lower_thresh=0.3, upper_thresh=0.75)
Installation
pip install gouda
conda install gouda -c smullan
Metadata
Release files for GOUDA 0.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gouda-0.7.0.tar.gz | 281.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gouda-0.7.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 361.7 kB
Release files / gouda-0.7.0.tar.gz
| Download URL | gouda-0.7.0.tar.gz |
|---|---|
| Size | 281.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b92390fdc2920231534ac829f2c6ff0d4fb0ab446c7be069551752c8ab252e60
|
|
BLAKE2b-256 checksum How to use checksums |
04aca6d8417c334ae5377f66de487a83f2f1dc8af4dea0678d812633a0ce4cfb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Mar 29, 2026.
Transparency logRelease files / gouda-0.7.0-py3-none-any.whl
| Download URL | gouda-0.7.0-py3-none-any.whl |
|---|---|
| Size | 80.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a7f8640ff3d0641b23eccc465849a7b323b094cebd66f167782c384ccbf0c7d5
|
|
BLAKE2b-256 checksum How to use checksums |
8bdf41c07f07bcef3901ec5bbe0ad744bf8d3cd85a7a9300753a63e82b18bbeb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Mar 29, 2026.
Transparency log