Skip to main content
Help us improve Python packaging – donate today!

Python client library and CLI tool for FilePreviews.io

Project Description

Build Status PyPI Status

Python client library and CLI tool for the FilePreviews.io service. Generate image previews and metadata from almost any kind of file.

Installation

Using pip:

$ pip install filepreviews

Using easy_install:

$ easy_install filepreviews

Usage

>>> from filepreviews import FilePreviews
>>> fp = FilePreviews(api_key='API_KEY_HERE', api_secret='API_SECRET_HERE')
>>> fp.generate('http://www.getblimp.com/images/screenshot1.png')
<PreviewResult at 4497022216> JSON: {
  "id": "220214ec-17ec-4f37-a790-eaea64522bf2",
  "original_file": null,
  "preview": null,
  "status": "pending",
  "thumbnails": null,
  "url": "https://api.filepreviews.io/v2/previews/220214ec-17ec-4f37-a790-eaea64522bf2/",
  "user_data": null
}

Options

Check out the endpoint docs for all available options.

>>> options = {
...   'sizes': ['200x200'],
...   'format': 'png',
...   'metadata': ['exif'],
...   'pages': '1',
...   'data': {
...     'content_id': '1234'
...   }
... }
>>> fp.generate('http://www.getblimp.com/images/screenshot1.png', **options)

CLI

$ filepreviews \
    --api_key=API_KEY_HERE \
    --api_secret=API_SECRET_HERE \
    generate http://www.getblimp.com/images/screenshot1.png
{
  "id": "e48c645d-8c02-40ab-9f11-2b3f2316be15",
  "original_file": null,
  "preview": null,
  "status": "pending",
  "thumbnails": null,
  "url": "https://api.filepreviews.io/v2/previews/e48c645d-8c02-40ab-9f11-2b3f2316be15/",
  "user_data": null
}
$ filepreviews \
    --api_key=API_KEY_HERE \
    --api_secret=API_SECRET_HERE \
    retrieve e48c645d-8c02-40ab-9f11-2b3f2316be15
{
  "id": "e48c645d-8c02-40ab-9f11-2b3f2316be15",
  "original_file": null,
  "preview": null,
  "status": "pending",
  "thumbnails": null,
  "url": "https://api.filepreviews.io/v2/previews/e48c645d-8c02-40ab-9f11-2b3f2316be15/",
  "user_data": null
}

Release history Release notifications

This version
History Node

2.0.2

History Node

2.0.1

History Node

2.0.0

History Node

1.1.0

History Node

1.0.7

History Node

1.0.6

History Node

1.0.5

History Node

1.0.4

History Node

1.0.3

History Node

1.0.2

History Node

1.0.1

History Node

1.0.0

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
filepreviews-2.0.2-py2.py3-none-any.whl (8.5 kB) Copy SHA256 hash SHA256 Wheel 2.7 Nov 16, 2015
filepreviews-2.0.2.tar.gz (6.1 kB) Copy SHA256 hash SHA256 Source None Nov 16, 2015

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page