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.

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.11.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

abraia-0.2.11-py2.py3-none-any.whl (5.7 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

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

File hashes

Hashes for abraia-0.2.11.tar.gz
Algorithm Hash digest
SHA256 f08fd75dd465fc79b1da545a5929f0d9b65e96b72018fae7c2fa634138c8b65d
MD5 597e88de2cede37056d6869186fc1d10
BLAKE2b-256 d4a293054a7ed27fe7e0e9aea4f41a7c5b31c54764289bb99b05c1745a7a803e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for abraia-0.2.11-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 834e7b548933a7dc46a34c8359e19a6492395c62ca921956d6c5ad2c7131b019
MD5 76e74e3bba9f0ae26d601bd0362b1529
BLAKE2b-256 35cc44d250fe72d4c5abae5ad8816c84c60601bbc3e6eafc5a9687f09b5d50be

See more details on using hashes here.

Supported by

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