Skip to main content

thumbrella-client

Python client for Thumbrella — a fast thumbnail API for images, video, documents, and more.

PyPI version Python License

Install

pip install thumbrella-client

Or with uv:

uv add thumbrella-client

Async streaming needs aiohttp:

pip install "thumbrella-client[async]"

Quickstart

import thumbrella

tbr = thumbrella.Client().verify()
result = tbr.thumb("https://example.com/photo.jpg")

print(result.status, len(result.media.thumbnail), "bytes")

# Use with Pillow
from PIL import Image
img = Image.open(result.media.thumbnail.io)

How It Works

Create a Client, call verify() to check connectivity, then use thumb(), batch(), or stream() to generate thumbnails.

The client reads $TBR_CONNECT for server config. Override it with a connect string:

tbr = thumbrella.Client("http://localhost:3114")                  # local dev
tbr = thumbrella.Client("https://cloud.thumbrella.dev,tbr_s_...")  # cloud token

Every URL gets a Result — failures get a placeholder image too. Use result.verify() to raise on failure, or check result.is_success() for inline handling. See the client docs for the full Result and Media field reference.

Errors

from thumbrella import ThumbError, ConnectionError, TimeoutError, VerifyError

All errors extend ThumbError. Client.verify() raises VerifyError on bad config. Network issues raise ConnectionError or TimeoutError. Per-result failures return a Result with a failure status — call result.verify() to convert to an exception.

Caching

Each Client defaults to an in-memory LRU cache (256 entries). Disable with caches=[] or layer custom backends:

tbr = thumbrella.Client(caches=[])                      # no caching
tbr = thumbrella.Client(caches=[thumbrella.MemoryCache(max_items=1000)])

Implement thumbrella.Cache to add persistent storage (SQLite, S3, etc.).

Examples

# Download one thumbnail to disk (with PIL inspection)
python examples/basic.py https://demo.thumbrella.dev/media/raw-canon.cr2 cam.jpeg

# Stream batch progress
python examples/stream.py https://example.com/a.jpg https://example.com/b.png

# Build a collage grid from streamed thumbnails
python examples/collage.py urls.txt

# Batch download with persistent caching
python examples/gallery.py https://example.com/a.jpg https://example.com/b.png

See examples/ for full source.

Next Steps

License

Apache-2.0. See LICENSE.

Download files

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

Source Distribution

thumbrella_client-0.5.0.tar.gz (24.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

thumbrella_client-0.5.0-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

Details for the file thumbrella_client-0.5.0.tar.gz.

File metadata

  • Download URL: thumbrella_client-0.5.0.tar.gz
  • Upload date:
  • Size: 24.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for thumbrella_client-0.5.0.tar.gz
Algorithm Hash digest
SHA256 ff4ab3de045ad498c4062a0099ffb62cfb05971d61c21685bde86adc8e085012
MD5 5a0ccccadb1110beec2cdc3a8901d82a
BLAKE2b-256 d74637785bb3d9ae6b31379c66540fb4c8c90c8300df43f63c7250b9499ddd74

See more details on using hashes here.

File details

Details for the file thumbrella_client-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: thumbrella_client-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 21.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for thumbrella_client-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e33c3d3fbb579650dfdd9ff5b31528ec2cd3ebc80a78ed7fae53a1c4a97adba2
MD5 9b88f7bb17ddcd6d03809e64a92876b0
BLAKE2b-256 be9dbc856389b327174fbb3df9c961884b0f0ac3b8e66bcb392a0e6cbec7203b

See more details on using hashes here.

Release history Release notifications | RSS feed

1.4.0

2 files

1.2.0

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.5.1

2 files

This release

0.5.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page