Skip to main content

Wagtail SB ImageSerializer

Wagtail package to render images with rendition in a single API Field.

Community-Project

PyPI - Supported versions PyPI - Package version PyPI - Downloads PyPI - License Codacy Grade Badge Codacy Coverage Badge Gitlab Pipeline Status

Wagtail package to render images with rendition in a single API Field.

✨ Features

  • Standardized Serialization: Built for simple integration with Wagtail headless setups or general DRF endpoints.
  • Easy Configuration: Quickly define social media image renditions.
  • Modern Stack: Built for modern Python (3.11+) and up to date Django/Wagtail versions.

📋 Requirements

  • Python 3.11 or higher
  • Wagtail 5.2 or higher
  • Django 4.2 or higher

📦 Installation

Using pip

pip install wagtail-sb-imageserializer

Using uv

uv add wagtail-sb-imageserializer

🚀 Usage

Add wagtail.api.v2, rest_framework and wagtail_sb_imageserializer to your INSTALLED_APPS settings:

INSTALLED_APPS = [
  # ...
  "wagtail.api.v2",
  "rest_framework",
  "wagtail_sb_imageserializer",
  # ...
]

In your model specify the ImageSerializerField as serializer for the APIField related to the image field and add the renditions parameter with the renditions you want to render.

from wagtail.models import Page
from wagtail.api import APIField
from wagtail_sb_imageserializer.fields import ImageSerializerField

class SamplePage(Page):
    image = ImageSerializerField()

    api_fields = [
        APIField(
          "image",
          serializer=ImageSerializerField(
              renditions={
                  "lazy": "fill-50x50",
                  "mobile": "fill-128x128",
                  "tablet": "fill-256x256",
                  "desktop": "fill-512x512",
              }
          ),
        ),
    ]

🛠️ Development

Check out our Contribution Guide for details on setting up your development environment, running tests, and submitting pull requests.

The project uses uv for dependency management, ruff for linting, and tox for multi-environment testing.

📜 Changelog

See the CHANGELOG.md for a history of changes.

👥 Contributors

See our list of contributors.

📄 License

This project is licensed under the Apache License 2.0. See the LICENSE file for details.

Metadata

Release files for wagtail-sb-imageserializer 0.6.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 wagtail-sb-imageserializer 0.6.0
File Size Uploaded
wagtail_sb_imageserializer-0.6.0.tar.gz 9.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wagtail-sb-imageserializer 0.6.0
File Interpreter ABI Platform
wagtail_sb_imageserializer-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.7 kB

Release files / wagtail_sb_imageserializer-0.6.0.tar.gz

Download URL wagtail_sb_imageserializer-0.6.0.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9528b04862a59e0cbbe82f08d5513bbe8b23801bddd5b787b78f7870e11c0003
BLAKE2b-256 checksum
How to use checksums
b45c785d559e40ca60fb6b7fd9a1f81079af81a53b0a7a0c83b68ea1882cceb4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.20 {"installer":{"name":"uv","version":"0.11.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / wagtail_sb_imageserializer-0.6.0-py3-none-any.whl

Download URL wagtail_sb_imageserializer-0.6.0-py3-none-any.whl
Size 10.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7aaebc17d648046780ba2f2f842bb5c77c7d7ea7214a342224be10b9e2eb8f78
BLAKE2b-256 checksum
How to use checksums
57795c39d3dfd5146cd3da63487b8490696552f5d85e6c7be5c156a4449af2c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.20 {"installer":{"name":"uv","version":"0.11.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

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