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.7.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.7.0
File Size Uploaded Provenance Actions
wagtail_sb_imageserializer-0.7.0.tar.gz 12.1 kB Without provenance Details for wagtail_sb_imageserializer-0.7.0.tar.gz

Built distribution (wheel)

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

Total release size: 22.2 kB

Release files / wagtail_sb_imageserializer-0.7.0.tar.gz

Download URL wagtail_sb_imageserializer-0.7.0.tar.gz
Size 12.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2110c1875fe2556611dd3a48cfef4cb765aeeb30fce7e020f0b45772dc1f10c0
BLAKE2b-256 checksum
How to use checksums
f5011c02e0f67fbe526424bdcfbbdb27ae6400591700019c78fecb062f0dd05b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","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.7.0-py3-none-any.whl

Download URL wagtail_sb_imageserializer-0.7.0-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f444074f9d83a8011d05129c2df295da0c7febcab1cda0dd31722bc2f6a86e51
BLAKE2b-256 checksum
How to use checksums
b2df263a3df33ba826ef32aed54f1cb050d5c1e6175b3b249fa2b72efc41f885
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","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}

Security for wagtail-sb-imageserializer 0.7.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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