Metadata-Version: 2.4
Name: wagtail-sb-imageserializer
Version: 0.6.0
Summary: Wagtail package to render images with rendition in a single API Field.
Keywords: cms,django,dynova,images,imageserializer,serialization,softbutterfly,wagtail
Author: Dynova Development Team, zodiacfireworks
Author-email: Dynova Development Team <dev@dynova.io>, zodiacfireworks <martin.vuelta@gmail.com>
License-Expression: Apache-2.0
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Framework :: Django :: 4
Classifier: Framework :: Django :: 5
Classifier: Framework :: Django :: 6
Classifier: Framework :: Wagtail :: 5
Classifier: Framework :: Wagtail :: 6
Classifier: Framework :: Wagtail :: 7
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: django>=4.2,<7.0
Requires-Dist: djangorestframework>=3.14,<4.0
Requires-Dist: wagtail>=5.2,<8.0
Maintainer: zodiacfireworks
Maintainer-email: zodiacfireworks <martin.vuelta@gmail.com>
Requires-Python: >=3.11.0, <4.0.0
Project-URL: Bug Tracker, https://gitlab.com/softbutterfly/open-source/wagtail-sb-imageserializer/-/issues
Project-URL: Changelog, https://gitlab.com/softbutterfly/open-source/wagtail-sb-imageserializer/-/blob/v0.6.0/CHANGELOG.md
Project-URL: Documentation, https://softbutterfly.gitlab.io/open-source/wagtail-sb-imageserializer
Project-URL: Download, https://gitlab.com/softbutterfly/open-source/wagtail-sb-imageserializer/-/archive/v0.6.0/wagtail-sb-imageserializer-v0.6.0.tar.gz
Project-URL: Homepage, https://gitlab.com/softbutterfly/open-source/wagtail-sb-imageserializer
Project-URL: Issues, https://gitlab.com/softbutterfly/open-source/wagtail-sb-imageserializer/-/issues
Project-URL: Repository, https://gitlab.com/softbutterfly/open-source/wagtail-sb-imageserializer
Description-Content-Type: text/markdown

# Wagtail SB ImageSerializer

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

![Community-Project][repository:banner]

![PyPI - Supported versions][pypi:badge:python]
![PyPI - Package version][pypi:badge:version]
![PyPI - Downloads][pypi:badge:downloads]
![PyPI - License][pypi:badge:license]
[![Codacy Grade Badge][codacy:grade]][codacy:dashboard]
[![Codacy Coverage Badge][codacy:coverage]][codacy:dashboard]
[![Gitlab Pipeline Status][repository:pipeline]][repository:commits]

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

```bash
pip install wagtail-sb-imageserializer
```

### Using uv

```bash
uv add wagtail-sb-imageserializer
```

## 🚀 Usage

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

```python
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.

```python
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](./CONTRIBUTING.md) 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](./CHANGELOG.md) for a history of changes.

## 👥 Contributors

See our [list of contributors][repository:contributors].

## 📄 License

This project is licensed under the Apache License 2.0. See the
[LICENSE](./LICENSE) file for details.

[repository]: https://gitlab.com/softbutterfly/open-source/wagtail-sb-imageserializer
[repository:banner]: https://gitlab.com/softbutterfly/open-source/open-source-office/-/raw/master/assets/dynova/dynova-open-source--banner--community-project.png
[repository:pipeline]: https://gitlab.com/softbutterfly/open-source/wagtail-sb-imageserializer/badges/master/pipeline.svg
[repository:commits]: https://gitlab.com/softbutterfly/open-source/wagtail-sb-imageserializer/-/commits/master
[repository:contributors]: https://gitlab.com/softbutterfly/open-source/wagtail-sb-imageserializer/-/graphs/develop

[pypi:badge:python]: https://img.shields.io/pypi/pyversions/wagtail-sb-imageserializer
[pypi:badge:version]: https://img.shields.io/pypi/v/wagtail-sb-imageserializer
[pypi:badge:downloads]: https://img.shields.io/pypi/dm/wagtail-sb-imageserializer
[pypi:badge:license]: https://img.shields.io/pypi/l/wagtail-sb-imageserializer

[codacy:grade]: https://app.codacy.com/project/badge/Grade/900411c7b5e443f89f85c7978f7504e5
[codacy:coverage]: https://app.codacy.com/project/badge/Coverage/900411c7b5e443f89f85c7978f7504e5
[codacy:dashboard]: https://app.codacy.com/gl/softbutterfly/wagtail-sb-imageserializer/dashboard
