https://github.com/tinify/tinify-python
Python client for the Tinify API.
https://github.com/tinify/tinify-python
image-compression image-optimization python python-client tinyjpg tinypng
Last synced: 25 days ago
JSON representation
Python client for the Tinify API.
- Host: GitHub
- URL: https://github.com/tinify/tinify-python
- Owner: tinify
- License: mit
- Created: 2015-07-29T21:12:43.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2025-03-28T09:37:21.000Z (about 1 month ago)
- Last Synced: 2025-03-28T10:35:45.110Z (about 1 month ago)
- Topics: image-compression, image-optimization, python, python-client, tinyjpg, tinypng
- Language: Python
- Homepage: https://tinypng.com/developers
- Size: 288 KB
- Stars: 133
- Watchers: 11
- Forks: 23
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE
Awesome Lists containing this project
README
[ ](https://github.com/tinify/tinify-python/blob/main/LICENSE)
[](https://github.com/tinify/tinify-python/actions/workflows/ci-cd.yml)
[](https://pypi.org/project/tinify/#history)
[](https://pypi.org/project/tinify/)
[](https://pypi.org/project/tinify/)# Tinify API client for Python
Python client for the Tinify API, used for [TinyPNG](https://tinypng.com) and [TinyJPG](https://tinyjpg.com). Tinify compresses your images intelligently. Read more at [http://tinify.com](http://tinify.com).
## Documentation
[Go to the documentation for the Python client](https://tinypng.com/developers/reference/python).
## Installation
Install the API client:
```
pip install tinify
```## Usage
```python
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](LICENSE).