Skip to content

Commit

Permalink
Restore python 2.7 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
jrrodri committed Oct 16, 2020
1 parent 97b243a commit 064628e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,26 @@ Automatically crop, resize, and compress images for web.

## Installation

The Abraia python client and CLI works in Windows, Mac, and Linux with Python 3, and can be installed with a simple command:
The Abraia python client and CLI works in Windows, Mac, and Linux with Python 2 and 3 (python>=2.6.5), and can be installed and upgraded with a simple command:

```sh
pip install -U abraia
python -m pip install -U abraia
```

Get your [API Key](https://abraia.me/console/settings) and configure it as an environment variable:
Moreover, you have to configure your [ABRAIA_KEY](https://abraia.me/console/settings) as an environment variable:

```sh
export ABRAIA_KEY=api_key
```

On Windows you need to use set instead of export:

```sh
set ABRAIA_KEY=api_key
```

NOTE: To persist the configuration use your system options to set your ABRAIA_KEY environment variable and avoid to run the previous command every time you start a terminal/console session.

## Fluent API

The Abraia fluent API is the easiest way to resize and compress images with Python. You just need to define the source of the image, the transformation operation, and the sink for the resultant image.
Expand Down
5 changes: 2 additions & 3 deletions scripts/abraia
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ abraia = Abraia(folder='batch/')


@click.group('abraia')
@click.version_option('0.6.1')
@click.version_option('0.6.2')
def cli():
"""Abraia CLI tool"""
pass
Expand All @@ -40,7 +40,7 @@ def configure():
@cli.command()
def info():
"""Show user account information"""
click.echo('abraia, version 0.6.1')
click.echo('abraia, version 0.6.2')
try:
user = abraia.load_user()
click.echo('Name: %s' % user.get('name'))
Expand Down Expand Up @@ -136,7 +136,6 @@ def metadata(src):
@click.argument('src')
def detect(src, mode):
"""Detect image data"""
print(mode) # Refactor to fix src and path
path = abraia.userid + '/' + abraia.folder
resp = abraia.upload_file(src, path)
labels = abraia.detect_labels(resp['source'])
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='abraia',
version='0.6.1',
version='0.6.2',
description='Abraia Python SDK',
long_description=long_description,
long_description_content_type='text/markdown',
Expand Down

0 comments on commit 064628e

Please sign in to comment.