Wagtail SB ImageSerializer
Wagtail package to render images with rendition in a single API Field.
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)
| File | Size | Uploaded | |
|---|---|---|---|
| wagtail_sb_imageserializer-0.6.0.tar.gz | 9.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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}
|