thumbrella-client
Python client for Thumbrella — a fast thumbnail API for images, video, documents, and more.
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
- Client docs — full API reference and examples
- Thumbrella — main site
- GitHub — source and issues
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff4ab3de045ad498c4062a0099ffb62cfb05971d61c21685bde86adc8e085012
|
|
| MD5 |
5a0ccccadb1110beec2cdc3a8901d82a
|
|
| BLAKE2b-256 |
d74637785bb3d9ae6b31379c66540fb4c8c90c8300df43f63c7250b9499ddd74
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e33c3d3fbb579650dfdd9ff5b31528ec2cd3ebc80a78ed7fae53a1c4a97adba2
|
|
| MD5 |
9b88f7bb17ddcd6d03809e64a92876b0
|
|
| BLAKE2b-256 |
be9dbc856389b327174fbb3df9c961884b0f0ac3b8e66bcb392a0e6cbec7203b
|