Skip to main content

Build Status PyPI PyPI - Python Version

imgproxy_python

A tiny library to simplify generation of imgproxy urls

installation

pip install imgproxy_python

usage

For example you want to simply resize your image to other height and width using imgproxy. To get proper imgproxy url you need the following

from imgproxy_python.urls import UrlGenerator
config = {
        'imgproxy_key': '943b421c9eb07c830af81030552c86009268de4e532ba2ee2eab8247c6da0881',
        'imgproxy_salt': '520f986b998545b4785e0defbc4f3c1203f22de2374a3d53cb7a7fe9fea309c5',
        'imgproxy_host': 'http://localhost:8000',
        'options': {
            'resize': 'fill',
            'width': 300,
            'height': 300,
        }
    }
    url = 'http://img.example.com/pretty/image.jpg'
    urlgen = UrlGenerator(url, config)
    print(urlgen.get_full_signed_url())

You will get a ready-to-go imgproxy link

http://localhost:8000/6cy4IRuQ1nQW8qGVmNvPdynjmkuwUEx-XhGw_C_kQmA/fill/300/300/ce/0/aHR0cDovL2ltZy5l/eGFtcGxlLmNvbS9w/cmV0dHkvaW1hZ2Uu/anBn

warning

If you want to have generated link working you need to have imgproxy instance up and running on config['imgproxy_host'], in our example it is http://localhost:8000

diclaimer

for now only basic urls are supported in version 0.0.1. Advanced url generation is coming

Release files for imgproxy-python 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for imgproxy-python 0.0.2
File Size Uploaded
imgproxy_python-0.0.2.tar.gz 2.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for imgproxy-python 0.0.2
File Interpreter ABI Platform
imgproxy_python-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 5.4 kB

Release files / imgproxy_python-0.0.2.tar.gz

Download URL imgproxy_python-0.0.2.tar.gz
Size 2.6 kB
Tags Source
SHA-256 checksum
How to use checksums
25b45143f3a22b7a61c5c2acf4bc3f061d4c507c5c86eb256b021a9c22fb0791
BLAKE2b-256 checksum
How to use checksums
5cfe85a417d6518aa99b57bd64e989955922d4679ee9b34dc08e4d7be891d0aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.6.9 Linux/4.15.0-132-generic

Release files / imgproxy_python-0.0.2-py3-none-any.whl

Download URL imgproxy_python-0.0.2-py3-none-any.whl
Size 2.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4e9cbebd434c6bbb81e5b59eedfd3f1694f8e59e657f7e523843dd19e8a00ee4
BLAKE2b-256 checksum
How to use checksums
5fa7b28341178158d7d782a4bf2c807da83bf67423b59199b8a4b91b324fc4ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.6.9 Linux/4.15.0-132-generic

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

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