imgproxykit
A typed Python toolkit for building imgproxy URLs.
Features
- Fully typed and checked with
mypy,pyright,tyandpyreflyin strict modes - Signed URLs using your
imgproxyserver'skeyandsalt - Immutable, reusable transforms combining typed options and scalar arguments
- Variants: generate multiple image URLs from a reusable set of transforms
- Support for named presets configured on your
imgproxyserver -
Django,Django Modern REST,Django REST Framework,FastAPIintegration
Installation
Requires Python 3.12+. A running imgproxy server is needed to serve images from the generated URLs.
pip install imgproxykit
There are several included extras:
'imgproxykit[django]'provides Django integration with settings, shortcuts, and template tags'imgproxykit[drf]'provides Django REST Framework integration with serializer fields for image URLs and named variants'imgproxykit[fastapi]'provides FastAPI integration with client registration and dependency injection
Examples
Single URL
Build a URL for a cropped webp thumbnail:
>>> from imgproxykit import Client, Transform
>>> from imgproxykit.options import Resize
>>> # Public URL of your imgproxy server.
>>> client = Client('https://imgproxy.example.com')
>>> thumbnail = Transform(
... Resize.fill(width=300, height=300), # Pass typed option objects.
... quality=80, # Or scalar keywords, equivalent to Quality(80).
... format='webp',
... )
>>> source_url = 'https://originals.example.com/products/backpack.jpg'
>>> thumbnail_url = client.url(source=source_url, transform=thumbnail)
The generated URL has this structure, with the source URL encoded as URL-safe Base64:
https://imgproxy.example.com/unsafe/resize:fill:300:300/quality:80/format:webp/<encoded-source>
thumbnail_url points to a cropped webp thumbnail.
Variants
Build variants by extending a shared transform with a width for each size:
>>> from imgproxykit import Client, Transform
>>> client = Client('https://imgproxy.example.com')
>>> # Share quality and output format across all variants.
>>> base = Transform(quality=85, format='webp')
>>> products = {
... 'small': base.extend(width=320),
... 'medium': base.extend(width=640),
... 'large': base.extend(width=1280),
... }
>>> source_url = 'https://originals.example.com/products/backpack.jpg'
>>> # Build one URL per variant for the same source image.
>>> product_urls = client.variants(source=source_url, variants=products)
>>> small_url = product_urls['small'] # Access a URL by its variant name.
product_urls contains a URL for each size, all using the shared quality
and WebP format.
Next steps
- Read the documentation for client configuration, transformations, variants, and processing options.
- Check the changelog for new features, fixes, and breaking changes.
- Find published releases on PyPI.
Contributing
See the contributing guide for development setup and checks. Bug reports and feature requests are welcome on the issue tracker.
License
Credits
Generated with
wemake-python-package
(template version).
Metadata
Release files for imgproxykit 0.5.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 | Provenance | Actions |
|---|---|---|---|---|
| imgproxykit-0.5.0.tar.gz | 33.6 kB | With provenance | Details for imgproxykit-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| imgproxykit-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for imgproxykit-0.5.0-py3-none-any.whl |
Total release size: 93.6 kB
Release files / imgproxykit-0.5.0.tar.gz
| Download URL | imgproxykit-0.5.0.tar.gz |
|---|---|
| Size | 33.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
959c8c4f0d5d75b0cbc84964ed4b24f8fedc863c2349c163e87ae32680df0c61
|
|
BLAKE2b-256 checksum How to use checksums |
4dd3d77dfd1343da5c098ad2503b64f7728288f5aaac7e445163d30c6754d2b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logRelease files / imgproxykit-0.5.0-py3-none-any.whl
| Download URL | imgproxykit-0.5.0-py3-none-any.whl |
|---|---|
| Size | 60.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2f5913f083b1ad9b92fa947420f3b125a7e78f02eb6a3c66b7c9f44e16634337
|
|
BLAKE2b-256 checksum How to use checksums |
34d2f256cfeac72869f4c0851a8074d0e7347cbe15cb638f28f5f3b7eeaca353
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logSecurity for imgproxykit 0.5.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for imgproxykit-0.5.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logA 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.