Skip to main content

imgproxykit

A typed Python toolkit for building imgproxy URLs.

Tests Result PyPI Version PyPI Downloads Supported Python Version License DeepWiki

Build imgproxy URLs with typed Python options and reusable transformations. Define image settings once, compose them for different use cases, and generate named variants from a single source.

Features

  • Fully typed and checked with mypy, pyright, ty and pyrefly in strict modes
  • Signed URLs using your imgproxy server's key and salt
  • 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 imgproxy server
  • Django, Django Modern REST, Django REST Framework, FastAPI, Litestar integration

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 and Django-Modern-REST integrations with shortcuts, template tags, and client configuration through Django settings
  • 'imgproxykit[drf]' provides Django REST Framework integration with serializer fields for image URLs and named variants
  • 'imgproxykit[fastapi]' provides FastAPI integration with a dependency for injecting the client into route handlers
  • 'imgproxykit[litestar]' provides Litestar integration with a plugin that injects the client into route handlers

Examples

Generate a thumbnail 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.

Generate image 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)

product_urls maps each variant name to its generated URL:

{
    'small': 'https://imgproxy.example.com/unsafe/quality:85/format:webp/width:320/<encoded-source>',
    'medium': 'https://imgproxy.example.com/unsafe/quality:85/format:webp/width:640/<encoded-source>',
    'large': 'https://imgproxy.example.com/unsafe/quality:85/format:webp/width:1280/<encoded-source>',
}

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

MIT

Credits

Generated with wemake-python-package (template version).

Metadata

Release files for imgproxykit 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 imgproxykit 0.7.0
File Size Uploaded Provenance Actions
imgproxykit-0.7.0.tar.gz 37.6 kB With provenance Details for imgproxykit-0.7.0.tar.gz

Built distribution (wheel)

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

Total release size: 102.9 kB

Release files / imgproxykit-0.7.0.tar.gz

Download URL imgproxykit-0.7.0.tar.gz
Size 37.6 kB
Tags Source
SHA-256 checksum
How to use checksums
58f81140ebf133bf7e564a7eab20b4dcb2b831d123017882ca3eeb4e5e751752
BLAKE2b-256 checksum
How to use checksums
572a87ee36007a4c7b5138957d45ca377ff5442023c604ed34cf8d12a726ace2
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 30, 2026.

Transparency log

Release files / imgproxykit-0.7.0-py3-none-any.whl

Download URL imgproxykit-0.7.0-py3-none-any.whl
Size 65.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ea1b1a32301e64d3d278c00d75de1669be8e7464f9fd78dea90d100c47b1a13
BLAKE2b-256 checksum
How to use checksums
0914db47a2fb44137782a35f7bc20719b2a79045dbd9f69831c40d71c042ff02
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 30, 2026.

Transparency log

Security for imgproxykit 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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for imgproxykit-0.7.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 30, 2026.

Transparency log

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