Skip to content

tinify/tinify-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ce7f6b6 · Mar 28, 2025
Mar 18, 2025
Mar 18, 2025
Mar 18, 2025
Sep 20, 2022
Mar 18, 2025
Jan 4, 2018
Oct 3, 2022
Mar 28, 2025
Jun 22, 2016
Jul 29, 2015
Mar 28, 2025
Jun 22, 2016
Jul 8, 2022
Sep 29, 2021

Repository files navigation

MIT License CI PyPI PyPI - Python Version PyPI - Wheel

Tinify API client for Python

Python client for the Tinify API, used for TinyPNG and TinyJPG. Tinify compresses your images intelligently. Read more at http://tinify.com.

Documentation

Go to the documentation for the Python client.

Installation

Install the API client:

pip install tinify

Usage

import tinify
tinify.key = 'YOUR_API_KEY'

tinify.from_file('unoptimized.png').to_file('optimized.png')

Running tests

pip install -r requirements.txt -r test-requirements.txt
py.test

To test more runtimes, tox can be used

tox

Integration tests

pip install -r requirements.txt -r test-requirements.txt
TINIFY_KEY=$YOUR_API_KEY py.test test/integration.py

License

This software is licensed under the MIT License. View the license.