Skip to main content

Python module and command-line tool for creating thumbs on Amazon S3

Project description

thumbS3
=======

Python module and command-line tool for creating thumbs on Amazon S3


### Installation

Install required packages:
```
sudo apt-get install python-dev libjpeg-dev libfreetype6 libfreetype6-dev zlib1g-dev
ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib
ln -s /usr/lib/x86_64-linux-gnu/libfreetype.so /usr/lib
ln -s /usr/lib/x86_64-linux-gnu/libz.so /usr/lib
```

Install module:
```
sudo pip install thumbS3
```


### Module Usage:
```
from thumbs3 import ThumbS3

th = ThumbS3("my_aws_key", "my_aws_secret", "http://s3-eu-west-1.amazonaws.com/my_bucket_name", 150, 150)
th.setDestinationFolder("/thumbs")
th.setSuffix("_thumb")
th.setVerbose()

photos = ["photo1.jpg", "photo2.jpg", "photo3.jpg"]

for name in photos:
th.create(name)

# Resulting thumbs (150x150px)
# http://s3-eu-west-1.amazonaws.com/my_bucket_name/thumbs/photo1_thumb.jpg
# http://s3-eu-west-1.amazonaws.com/my_bucket_name/thumbs/photo2_thumb.jpg
# http://s3-eu-west-1.amazonaws.com/my_bucket_name/thumbs/photo3_thumb.jpg
```

### Command-line Usage:
```
usage: thumbs3.py [-h] [-k KEY] [-s SECRET] [-f FILENAME] [--url URL]
[--folder FOLDER] [--suffix SUFFIX] [--width WIDTH]
[--height HEIGHT] [-v]

thumbS3 command-line tool for creating thumbs on Amazon S3

Arguments:
-h, --help show this help message and exit
-k KEY, --key KEY Amazon AWS access key
-s SECRET, --secret SECRET
Amazon AWS access key secret
-f FILENAME, --filename FILENAME
Image filename
--url URL Amazon S3 bucket url
--folder FOLDER Thumbs destination folder
--suffix SUFFIX Thumbs filename suffix
--width WIDTH Thumb width
--height HEIGHT Thumb height
-v, --verbose increase output verbosity
```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

thumbS3-0.1.3.tar.gz (2.6 kB view details)

Uploaded Source

File details

Details for the file thumbS3-0.1.3.tar.gz.

File metadata

  • Download URL: thumbS3-0.1.3.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for thumbS3-0.1.3.tar.gz
Algorithm Hash digest
SHA256 dc6d81dd26762825bce73c9220f83b8d79075c41d8b426aafedf56a5da59c634
MD5 3d7caa082c23000c4b84d39932857f50
BLAKE2b-256 e39be1a64e3d89a81f817e6dff733c7dafe3386b74776ef563ee6198e80d3156

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