graphique-client

A Python client to Graphique


License
MIT
Install
pip install graphique-client==1.0

Documentation

Build Status Latest Version Supported Python versions

Python Client for Graphique

Usage

import graphiqueclient

# Client instances are thread-safe, and also very lightweight.
# Use however you like.
client = graphiqueclient.create_client(hostname='localhost', port=8980)

Image Submission

image = client.submit_image(open('/home/amr/an_image.jpg', 'rb'))
print(image.servable_url())

Image Variant Creation

variant = graphiqueclient.Image(tag='137a07962e49a58b6161ace95bb1b07d.jpg')\
    .sized_within(500, 400).formatted_to_jpeg(0.75)
client.create(image);
print(image.servable_url())

Directly Obtaining a Servable URL for an Image

# If you are sure that an image variant already exists on the server, you can obtain its
# publicly-servable URL directly without making an explicit request to the server.
variant = graphiqueclient.Image(tag='137a07962e49a58b6161ace95bb1b07d.jpg')\
    .sized_within(500, 400).formatted_to_jpeg(0.75)
print(variant.servable_url())