An adaption of tinify as a flask extension
Project description
flask_tinify
An adaption of tinify as a flask extension
Installation
Install the API client:
pip install flask-tinify
Usage
from flask import Flask
from flask_tinify import Tinify
app = Flask(__name__)
tinify = Tinify(app)
Basic example
from flask import Flask, request
from flask_tinify import Tinify
app = Flask(__name__)
tinify = Tinify(app)
@app.route('/tinify', methods=['POST'])
def hello_png():
image = request.form['image']
if not image:
return '', 400
with image.strem as stream:
tinify.from_buffer(stream.read()).to_buffer()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
flask_tinify-1.2.tar.gz
(4.4 kB
view hashes)
Built Distribution
Close
Hashes for flask_tinify-1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f27c108614ddbedaf299192ec824f6fe70f89160e5c3fbc1c850aee28a97740 |
|
MD5 | 83401e05c75067005c7d0fcd77302397 |
|
BLAKE2b-256 | e95e8b5629e2e2fb18ec577cc405b456c31ad35a9425bf22dee98defef7caa16 |