Skip to main content

simple_module_images

Image collections for SimpleModule hosts. A collection holds images whose originals are immutable; everything derived from them (EXIF and location, renditions, quality metrics, an optionally anonymised display copy, map tiles) is produced by pipeline steps that run as background tasks. Collections are private to their owner, shared with chosen users, internal to the organisation or public.

Imports take single files, batches, large direct uploads, ZIP archives and GeoJSON sources of up to a million located images. Groups, AI prompts with a review queue, a map (GeoJSON points and PMTiles) and a public gallery are included. Design: docs/superpowers/specs/2026-10-28-images-module-design.md in the source repo; the guides are in docs/.

Install

pip install simple_module_images

Add simple_module_images to your host's dependencies; for an in-repo checkout, resolve it from the workspace:

[tool.uv.sources.simple_module_images]
workspace = true

A plain install pulls no onnxruntime or OpenCV. Heavy processors are extras, imported only inside the step that needs them:

Extra Adds
quality OpenCV: resolution, blur and exposure metrics
anonymize onnxruntime: YuNet face and YOLOv9 plate detection (MIT models), blurred into a display copy (the original is kept); weights from anonymize_weights_path or a pinned, checksummed download on first use
ai simple_module_ai: prompt-based image analysis
billing simple_module_billing: storage and request metering
pagebuilder simple_module_pagebuilder: an image gallery block

The map view needs no extra: its PMTiles archive is built by the tippecanoe binary (tippecanoe_path), which must be on the worker's machine.

Models and licences. The anonymize extra installs only onnxruntime (MIT). The step downloads two MIT-licensed ONNX models on first use, pinned by SHA-256: YuNet (faces; Shiqi Yu, via OpenCV Zoo) and YOLOv9 licence-plate detector (ankandrew, open-image-models). Their copyright notices are in this module's NOTICE. Recall is unverified, and weights are cached under ~/.cache/simple_module_images/models unless anonymize_weights_path points at face.onnx and plate.onnx. See docs/index.md.

The module needs the framework's settings, sharing, file_storage and background_tasks modules. Migrations live in the consuming host (make migration), never in the wheel.

Image processing runs in Celery workers (make worker, worker-imports, worker-heavy, worker-gpu, beat) or inline with SM_BG_TASKS_TASK_ALWAYS_EAGER=true. A plugin that adds steps ships an images_extensions.py and must be installed in the web process and every worker. See docs/worker.md and docs/writing-a-plugin.md.

Usage

The console is at /admin/images, the JSON API under /api/images and public collections at /images/c/{slug}. Every router binds a tenant: a single-tenant host uses default, a multi-tenant host the organisation the framework resolved (403 tenant_required for the console, 404 for public routes when none).

Permissions

Permission Allows
images.view See collections and images the access policy admits
images.create Create collections and upload images
images.publish Make a collection public or internal
images.manage Manage every collection regardless of owner
images.originals.view Download the immutable original

Settings

The module's settings are governed by the framework's settings.edit, as every other module's are; images has no settings permission of its own.

Stored in the database and edited on the Settings screen; there is no SM_IMAGES_* environment variable. System scope: one configuration for every tenant. Fields marked as needing a restart (tippecanoe_path, public_asset_base_url) are read once at boot; workers pick up the rest within about 30 seconds.

Setting Default
max_image_bytes 50 MiB
batch_max 50
upload_body_max_bytes 100 MiB
direct_upload_threshold 20 MiB
max_open_uploads_per_tenant 20
zip_max_bytes / zip_max_entries 2 GiB / 10 000
zip_max_entry_bytes / zip_max_total_bytes / zip_max_ratio 200 MiB / 8 GiB / 200
geojson_max_features / geojson_max_bytes / geojson_max_feature_bytes 1 000 000 / 2 GiB / 60 MiB
download_concurrency_per_domain / download_concurrency_total (per download task) / download_timeout 4 / 32 / 60 s
thumbnail_sizes marker 64, small 160, medium 400, large 1024
dedupe_by_hash off
tippecanoe_path, anonymize_weights_path tippecanoe, empty
map_rebuild_threshold_pct / map_rebuild_threshold_abs 5 / 100
map_style_url (basemap; empty = flat, no third-party request) https://tiles.openfreemap.org/styles/positron
public_asset_base_url empty
janitor_grace_days, step_output_max_bytes, step_lease_seconds 7, 65 536, 1 800

Routes

Upload routes (/api/images/collections/{id}/images, .../imports, .../imports/zip and /api/images/uploads/) carry a request-body ceiling of upload_body_max_bytes plus multipart framing; the rest use the host's global limit. Public exemptions are GET/HEAD only, under /images/c/ and /api/images/public/.

Map

  • GET /api/images/collections/{id}/points?bbox=minx,miny,maxx,maxy&limit=&cursor= (anonymous twin: /api/images/public/c/{slug}/points) answers a GeoJSON FeatureCollection. Each point carries only id, captured_at and group_id; an image whose display mutator has not settled is not a point. limit is clamped to 5000; follow next_cursor for the rest.
  • GET|HEAD …/collections/{id}/map.pmtiles (twin: /api/images/public/c/{slug}/map.pmtiles) serves the collection's PMTiles archive with Range, checking access on every request. It is a 404 until a map is built.
  • images.build_map (queue images) builds the archive with tippecanoe. A rebuild starts once the changes since the last build reach map_rebuild_threshold_abs or map_rebuild_threshold_pct percent of its points (both at least 1). A move does not wait for the threshold. A visibility change, a removed point (an image trashed or its location cleared) and a pipeline save that changes the redaction gate withdraw the archive in the same transaction and build a fresh one. An archive is stamped with the redaction gate it was built under, and is a 404 under any other (for example once a mutator plugin is removed) until images.reconcile rebuilds it.
  • The images.tippecanoe health check is degraded while the binary cannot be found. Points keep working.
  • The points are drawn over the basemap map_style_url names (OpenFreeMap's Positron by default; its origin is added to the CSP). Viewers' browsers fetch its tiles from that host, so it sees their IP and the area they view; set it to empty for a flat background with no third-party request. A style that cannot be fetched falls back to the flat background.

Documentation

Page For
docs/index.md Concepts, install, permissions, every setting
docs/access.md Visibility, shares, originals, withheld images
docs/imports.md Uploads, direct upload and bucket CORS, ZIP, GeoJSON, limits
docs/pipeline.md Steps, leases, AI prompts, groups, presets, review, storage metering
docs/writing-a-plugin.md Steps, presets and result views from another module
docs/worker.md Workers, beat, timeouts, tuning, recovery times
docs/migrating-from-portal.md Moving off the portal's feature

Metadata

Release files for simple-module-images 0.0.15

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

Source distribution (sdist)

Source distribution for simple-module-images 0.0.15
File Size Uploaded Provenance Actions
simple_module_images-0.0.15.tar.gz 934.5 kB With provenance Details for simple_module_images-0.0.15.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for simple-module-images 0.0.15
File Interpreter ABI Platform Actions
simple_module_images-0.0.15-py3-none-any.whl Python 3 none any Details for simple_module_images-0.0.15-py3-none-any.whl

Total release size: 1.6 MB

Release files / simple_module_images-0.0.15.tar.gz

Download URL simple_module_images-0.0.15.tar.gz
Size 934.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c708bd4ef339e1360a0694016737754a7b9ff6b3b863b8b7fff8149c97135adb
BLAKE2b-256 checksum
How to use checksums
1124cb18d1b3ebd281c14353c56756d0c110c1d0b7c22aacd71333a505ae5587
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 / simple_module_images-0.0.15-py3-none-any.whl

Download URL simple_module_images-0.0.15-py3-none-any.whl
Size 641.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
11a6b2bb673de5510aba30bd9a1f068dd9e88c67ad4bc623f3dd8b4a9a55024e
BLAKE2b-256 checksum
How to use checksums
979c6ed42e3c8014309824e7d1a212928d09fbefb62801a954dff46901db7c80
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 simple-module-images 0.0.15

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 simple_module_images-0.0.15.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