FilePreviews.io
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("https://filesamples.com/samples/image/heic/sample1.heic")
<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("https://filesamples.com/samples/image/heic/sample1.heic", **options)
CLI
$ filepreviews \
--api_key=API_KEY_HERE \
--api_secret=API_SECRET_HERE \
generate https://filesamples.com/samples/image/heic/sample1.heic
{
"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
}
Metadata
Release files for filepreviews 3.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| filepreviews-3.0.0-py3.8.egg | Legacy Egg format | - | - | Details |
Release files / filepreviews-3.0.0-py3.8.egg
| Download URL | filepreviews-3.0.0-py3.8.egg |
|---|---|
| Size | 13.6 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
86d22546de69d7041dafdab45c073b704970c750cee9031fa796184cc401db56
|
|
BLAKE2b-256 checksum How to use checksums |
64fd2a30e1a44850609272f9a981456de6db215b87a887895f65174cb776d9e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.0
|