Skip to main content

Abraia Python SDK

Project description

Build Status Coverage Status

Abraia API client for Python

Python client for the Abraia API, used to smartly transform and optimize (compress) images on-line. Read more at https://abraia.me/docs.

Optimize images for web with no quality damage based on perception-driven technology.

  • Optimal image compression with our perceptual adjustment to preserve the quality and maximize the compression.
  • Smart crop and resize images with our saliency and aesthetic based model which balances between content and aesthetics.
abraia optimize --width 800 --height 400 https://images.pexels.com/photos/700948/pexels-photo-700948.jpeg images/skater.jpg

Optimized and smart cropped skater

Original image by Willian Was from Pexels (Size: 4865x3321 | Weight: 10.1MB)

Installation

Install the API client and CLI with a simple command:

pip install -U abraia

Verify that the abraia CLI is correctly installed:

abraia --version

Configuration

For configuration you just need to create an account and introduce the API KEYS using the command bellow:

abraia configure

Usage

API usage:

The fluent design of the Abraia API makes easy to compress and transform images. You just need to define the source of the image, the transformation operation, and the sink for the resultant image.

import abraia

abraia.from_file('images/lion.jpg').resize(
  width=600, height=600).to_file('images/lion_600x600.jpg')
abraia.from_url('https://abraia.me/images/random.jpg').resize(
  width=600, height=400).to_file('images/random_600x400.jpg')

CLI usage:

With the CLI tool you can compress and optimize all the images in a folder with a simple command:

abraia optimize images

Batch output

Or you can resize and automatically crop all your images and folders, just adding the image size parameters:

abraia optimize --width 500 images/lion.jpg images/resized.jpg
abraia optimize --width 333 --height 333 images/lion.jpg images/cropped.jpg

Resized lion Cropped lion

License

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

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

abraia-0.2.12.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

abraia-0.2.12-py2.py3-none-any.whl (6.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file abraia-0.2.12.tar.gz.

File metadata

  • Download URL: abraia-0.2.12.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for abraia-0.2.12.tar.gz
Algorithm Hash digest
SHA256 87bc6c6ce0be97df7356468cad0e6e60d705c7d41de2a35627554d65832e99c7
MD5 39d6f9d3c2b099408356787e0dd7831b
BLAKE2b-256 2b942fdce14f2ebb98614622a60ac78ad2160370622a7814a04a8daf3ed2a0f8

See more details on using hashes here.

File details

Details for the file abraia-0.2.12-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for abraia-0.2.12-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c84ea3855df35d3fdff6b90b8ffd3e84fd89c06552077705c8dc072c0eee3c5f
MD5 2295cca27537b3feabca3485e1c53a32
BLAKE2b-256 e022c8c98c2a054569307839718cc89de1410a5cf7e655ae05a78e4a05921a6d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page