{"id":28764934,"url":"https://github.com/klen/imgproxy","last_synced_at":"2025-09-04T05:33:29.155Z","repository":{"id":57437842,"uuid":"353719402","full_name":"klen/imgproxy","owner":"klen","description":"Python support for ImgProxy image processing server (https://imgproxy.net)","archived":false,"fork":false,"pushed_at":"2021-11-08T13:16:33.000Z","size":54,"stargazers_count":17,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-05-16T21:47:01.802Z","etag":null,"topics":["image-processing","imgproxy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/klen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-01T14:02:25.000Z","updated_at":"2025-01-15T09:10:09.000Z","dependencies_parsed_at":"2022-09-16T03:24:26.550Z","dependency_job_id":null,"html_url":"https://github.com/klen/imgproxy","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/klen/imgproxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fimgproxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fimgproxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fimgproxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fimgproxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/klen","download_url":"https://codeload.github.com/klen/imgproxy/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klen%2Fimgproxy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260310897,"owners_count":22989869,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["image-processing","imgproxy"],"created_at":"2025-06-17T10:13:01.839Z","updated_at":"2025-09-04T05:33:29.144Z","avatar_url":"https://github.com/klen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ImgProxy\n\n**ImgProxy** -- Python library to build [ImgProxy](https://docs.imgproxy.net/) URLs\n\n[![Tests Status](https://github.com/klen/imgproxy/workflows/tests/badge.svg)](https://github.com/klen/imgproxy/actions)\n[![PYPI Version](https://img.shields.io/pypi/v/imgproxy)](https://pypi.org/project/imgproxy/)\n[![Python Versions](https://img.shields.io/pypi/pyversions/imgproxy)](https://pypi.org/project/imgproxy/)\n\n---\n\n## Features\n\n* Generates [URLs](https://docs.imgproxy.net/generating_the_url) urls\n* Support for [signing](https://docs.imgproxy.net/#/signing_the_url) urls\n* URL's Factories with predefined params\n\n# Table of Contents\n\n  * [Requirements](#requirements)\n  * [Installation](#installation)\n  * [Usage](#usage)\n    * [Options](#options)\n    * [Signed URLs](#signed-urls)\n    * [Image factories](#image-factories)\n  * [Changelog](#changelog)\n  * [Bug tracker](#bug-tracker)\n  * [Contributing](#contributing)\n  * [License](#license)\n\n\n## Requirements\n\n* python \u003e= 3.7\n\n\n## Installation\n\n**imgproxy** should be installed using pip:\n\n    $ pip install imgproxy\n\n\n## Usage\n\n```python\n    from imgproxy import ImgProxy\n\n    # Create ImgProxy object with required params\n    img_url = ImgProxy('https://picsum.photos/1000', proxy_host='https://imgproxy.com', width=800, height=400)\n\n    # Convert the obj to string to get imgproxy URL\n    cover: str = str(img_url)\n\n    # or just call it to get imgproxy URL\n    cover: str = img_url()\n\n    assert cover == 'https://imgproxy.com/insecure/g:ce/rs:auto:800:400:0/aHR0cHM6Ly9waWNzdW0ucGhvdG9zLzEwMDA'\n\n    # Call the object with different params to customize the url\n    cover_small: str = img_url(width=400, height=200, resizing_type='fill')\n\n    assert cover_small == 'https://imgproxy.com/insecure/g:ce/rs:fill:400:200:0/aHR0cHM6Ly9waWNzdW0ucGhvdG9zLzEwMDA'\n\n    # Call it with advanced params to get an URL\n    cover_with_border = img_url('pd:10:10:10:10', 'bg:F00')\n    assert cover_with_border == 'https://imgproxy.com/insecure/pd:10:10:10:10/bg:F00/g:ce/rs:auto:0:0:0/aHR0cHM6Ly9waWNzdW0ucGhvdG9zLzEwMDA'\n\n```\n\n### Options\n\nBasic options (default values):\n\n* `width: int = 0` - images width\n* `height: int = 0` - images height\n* `gravity: str = 'ce'` - images gravity\n* `enlarge: bool = False` - enlarge an image\n* `extension: str = ''` - images extension\n* `resizing_type: str = 'auto'` - resizing type\n\n```python\n    from imgproxy import ImgProxy\n\n    img_url = ImgProxy('https://picsum.photos/1000', proxy_host='https://imgproxy.com')\n    thumbmail = img_url(width=100, height=100, gravity='no', extension='jpg', enlarge=True, resizing_type='fit')\n```\n\nAny other options are also supported when you call an imageproxy instance:\n\n```python\n    from imgproxy import ImgProxy\n\n    img_url = ImgProxy('https://picsum.photos/1000', proxy_host='https://imgproxy.com')\n\n    # Get rotated and blured image\n    blured_rotated = img_url('blur:0.5', 'rotate:30')\n```\n\n### Signed URLs\n\nImgproxy allows you to sign your URLs with key and salt, so an attacker won’t\nbe able to cause a denial-of-service attack by requesting multiple different\nimage resizes.\n\n```python\n    from imgproxy import ImgProxy\n\n    url = ImgProxy('https://picsum.photos/1000', proxy_host='https://imgproxy.com', key=\"aa396160c50ea766910eab53\", salt=\"b3fb8f215827bda5d0e7313d\")\n\n    assert str(url) == 'https://imgproxy.com/FrH21u_5bXmv-OJ0APMayxZ0F3982xx437gCpqcQ0BM/g:ce/rs:auto:600:0:0/aHR0cHM6Ly9waWNzdW0ucGhvdG9zLzEwMDA'\n```\n\nIf you need a random key/salt pair real fast, you can quickly generate it\nusing, for example, the following snippet:\n\n```shell\n    echo $(xxd -g 2 -l 64 -p /dev/random | tr -d '\\n')\n```\n\n### Image factories\n\nUsually imgproxy host and signature params are common for a project.\nThe library supports a method to generate a factory with predefined params:\n\n```python\n    from imgproxy import ImgProxy\n\n    img_factory = ImgProxy.factory(proxy_host='https://imgproxy.com', key=\"aa396160c50ea766910eab53\", salt=\"b3fb8f215827bda5d0e7313d\")\n\n    # ...\n\n    # Generate image URL\n    url = img_factory('https://picsum.photos/1000', width=600)\n    assert str(url) == 'https://imgproxy.com/qcKAFfBJwpiKZ6xt-NT6GXGOGizkeq4sgyfoQ4h-080/g:ce/rs:auto:600:0:0/aHR0cHM6Ly9waWNzdW0ucGhvdG9zLzEwMDA'\n```\n\nUsers able to predifine any basic params:\n```python\n\n    thumbnail_factory = ImgProxy.factory(proxy_host='https://imgproxy.com', width=300, height=200)\n    preview_factory = ImgProxy.factory(proxy_host='https://imgproxy.com', width=500, resizing_type='fit')\n\n    # and etc\n```\n\nAdvanced params are also supported:\n\n```python\n    thumbnail_factory = ImgProxy.factory('bg:F00', 'pd:10:10:10:10', proxy_host='https://imgproxy.com', width=300, height=200)\n```\n\n## Changelog\n\n* 2021-11-08: **[1.0.0]**\n    - Support python 3.10\n    - Support advanced options in factories\n\n* 2021-09-14: **[0.4.0]**\n    - Support python 3.7\n    - Basic format has been removed (it's depricated in ImgProxy)\n\n* 2021-04-02: **[0.2.3]** Stable release\n\n\n## Bug tracker\n\nIf you have any suggestions, bug reports or annoyances please report them to\nthe issue tracker at https://github.com/klen/imgproxy/issues\n\n\n## Contributing\n\nDevelopment of the project happens at: https://github.com/klen/imgproxy\n\n\n## License\n\nLicensed under a [MIT License](http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklen%2Fimgproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fklen%2Fimgproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklen%2Fimgproxy/lists"}