A simple interface to use ImageKiIO API with Flask.
Project description
Flask-CKEditor-Manager
Flask-ImageKitIO provides a simple interface to use ImageKitIO API with Flask.
🚧 This package is under heavy development..
Installation
Install the extension with pip:
pip install flask-imagekitio
Install with poetry:
poetry add flask-imagekitio
Configuration
This are some of the settings available
Config | Description | Type | Default |
---|---|---|---|
IMAGEKITIO_URL_ENDPOINT | The ImagekitIO account url endpoint | str | None |
IMAGEKITIO_PRIVATE_KEY | The ImagekitIO Private Key | str | None |
IMAGEKITIO_PUBLIC_KEY | The ImagekitIO Public Key | str | None |
Usage
Once installed ImagekitIO is easy to use. Let's walk through setting up a basic application. Also please note that this is a very basic guide: we will be taking shortcuts here that you should never take in a real application.
To begin we'll set up a Flask app:
from flask import Flask
from flask_imagekitio import ImagekitIO
app = Flask(__name__)
imagekitio = ImagekitIO()
imagekitio.init_app(app)
result = imagekit.upload_file(data, file.filename)
img_url = imagekit.url({
'src': result.url,
'transformation': [
{
'width': '600',
'aspect_ratio': '5-3'
}
]
})
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
flask_imagekitio-0.1.1.tar.gz
(2.4 kB
view hashes)
Built Distribution
Close
Hashes for flask_imagekitio-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e8529098f01fbba912adc2b8e562a627e9916e3ab8228010c8e1d99e53a84b3 |
|
MD5 | 907e8be978c6d3f9ac0b4378edb33a5b |
|
BLAKE2b-256 | 66af4f5541514d0fbe6b9c78b887d9c09599e5768a7257eefbbbfcd0efc5fd89 |