Wagtail package to render images with rendition in a single API Field.
Project description
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wagtail_sb_imageserializer-0.6.0.tar.gz.
File metadata
- Download URL: wagtail_sb_imageserializer-0.6.0.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9528b04862a59e0cbbe82f08d5513bbe8b23801bddd5b787b78f7870e11c0003
|
|
| MD5 |
74e49684f9ddb18e8f1a4501e2a07be9
|
|
| BLAKE2b-256 |
b45c785d559e40ca60fb6b7fd9a1f81079af81a53b0a7a0c83b68ea1882cceb4
|
File details
Details for the file wagtail_sb_imageserializer-0.6.0-py3-none-any.whl.
File metadata
- Download URL: wagtail_sb_imageserializer-0.6.0-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7aaebc17d648046780ba2f2f842bb5c77c7d7ea7214a342224be10b9e2eb8f78
|
|
| MD5 |
953cedde54bc8ddd77e96e1ec5877687
|
|
| BLAKE2b-256 |
57795c39d3dfd5146cd3da63487b8490696552f5d85e6c7be5c156a4449af2c8
|