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.7.tar.gz
(4.5 kB
view details)
Built Distribution
flask_tinify-1.7-py3-none-any.whl
(152.3 kB
view details)
File details
Details for the file flask_tinify-1.7.tar.gz
.
File metadata
- Download URL: flask_tinify-1.7.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86ee7c786e0a08b4e23c391d8289ec191129f9d2a4f297e72ba9a94407288ef2 |
|
MD5 | b3614533751cdf1af28c5cf0ab9497bb |
|
BLAKE2b-256 | 6db841e3bf66f1b183c80d5b15fdb3774956b8de86a0c84f4e45a09ec31ea6b8 |
File details
Details for the file flask_tinify-1.7-py3-none-any.whl
.
File metadata
- Download URL: flask_tinify-1.7-py3-none-any.whl
- Upload date:
- Size: 152.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fcb6cd781c307702341b31c5b4cd76de141831b99744a419d9eada20f90a8f1c |
|
MD5 | ffa5ce27b555da1b354051c25eeae427 |
|
BLAKE2b-256 | eb7c16fb701755c732e9ee509d03c50478e78f2feaa06b6ca67e35767860b2d8 |