Python

Our SDK will help you easily integrate Autoenhance.ai into your codebase in a matter of minutes. We've prepared methods for interacting with our API in all possible ways you might need.

Requirements

You can find the PyPI package for our SDK on pypi

Installation

Install Autoenhance.ai SDK with a simple CLI command

With pip:

pip install autoenhance

With poetry:

poetry add autoenhance

Configuration

Follow these simple steps in order to implement and configure our SDK

Import Autoenhance SDK package:

import autoenhance

Create a constant, and add your API key

autoenhance = autoenhance.Autoenhance('YOUR API KEY');

Boom, that's it! Now you can interact with our API in a matter of seconds.

Examples

Uploading image

  import requests

  def upload_image(image_properties: dict, image_buffer):

    response = autoenhance.create_image(**image_properties)
    requests.put(
      response.s3PutObjectUrl,
      headers={
        "Content-Type": "image/jpeg",
      },
      body=image_buffer
    )

Retrieving order

  def get_order(order_id):
    order = autoenhance.retrieve_order(orderId)

Retrieving list of orders

  def get_orders():
    response = autoenhance.list_orders()
    orders = response.orders

Downloading enhanced image

  def download_image(image_id):
    image_url = autoenhance.download_enhanced_image(image_url, size="large")
    return image_url.url

Last updated