Skip to main content

imgproxykit

A typed Python toolkit for building imgproxy URLs.

Features · Installation · Example · Issues · Contributing

Define image transformations in Python and turn them into reusable, signed URLs. Your imgproxy server fetches and processes the image when the URL is requested.

Features

  • Typed API with annotations
  • Immutable, reusable transforms built from Python dataclasses
  • Free imgproxy processing options, including geometry, filters, metadata, quality, pixel density, gravity, and watermarks
  • Output format selection, including WebP and AVIF
  • Support for named presets configured on your imgproxy server

Installation

Requires Python 3.12+ and a running imgproxy server.

pip install imgproxykit

Example

Create a client, define a transform, and generate a URL:

>>> from imgproxykit import Client, Transform
>>> from imgproxykit.options import Quality, Resize
>>> client = Client('https://images.example.com')
>>> thumbnail = Transform(
...     options=(
...         Resize(width=300, height=300, mode='fill'),
...         Quality(85),
...     ),
...     format='webp',
... )
>>> url = client.url(
...     'https://example.com/photo.jpg',
...     transform=thumbnail,
... )
>>> url.startswith('https://images.example.com/unsafe/rs:fill:300:300/q:85/')
True
>>> url.endswith('.webp')
True

Reuse client and thumbnail for other source images. Options you omit are left to imgproxy's defaults.

Without signing credentials, URLs use the unsafe marker and require a server with signature checking disabled.

Signed URLs

Supply the hex-encoded key and salt from your imgproxy server configuration:

import os

from imgproxykit import Client

client = Client(
    'https://images.example.com',
    key=os.environ['IMGPROXY_KEY'],
    salt=os.environ['IMGPROXY_SALT'],
)

url = client.url(
    'https://example.com/photo.jpg',
    transform=thumbnail,
)

Both credentials are required together. The client signs each generated path automatically.

Server presets

Already have presets on your imgproxy server? Reference them by name:

url = client.url(
    'https://example.com/photo.jpg',
    presets=('thumbnail', 'watermarked'),
    format='webp',
)

Use either a Python transform or server presets in each call. For Python transforms, set format on Transform; for presets, pass it to client.url().

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.1.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.1.0
File Size Uploaded Provenance
imgproxykit-0.1.0.tar.gz 20.6 kB With provenance Details

Built distribution (wheel)

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

Total release size: 65.9 kB

Release files / imgproxykit-0.1.0.tar.gz

Download URL imgproxykit-0.1.0.tar.gz
Size 20.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c46e33d8d886abda40688608bf864ca18cae111bbf9296454a035deabcb3fee0
BLAKE2b-256 checksum
How to use checksums
7e26340941004d45860521282a7126c2774fa57bda7faa5919a4d1dae9f7d3a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 16, 2026.

Transparency log

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

Download URL imgproxykit-0.1.0-py3-none-any.whl
Size 45.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e59c50bb5bcc2c0c695c82cef191ed7e5107fb8465b1abbeccd28e9f56bd47ba
BLAKE2b-256 checksum
How to use checksums
07ed59b2113b35b1aa6688ad780250f27c2a97981097ca7c34102aa5a0c1bfac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 16, 2026.

Transparency log

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for imgproxykit-0.1.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 Oct 16, 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