Skip to main content

thumbrella-client

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

PyPI version Python License

Thumbrella is still in prerelease. The server functionality is operational, but several production components have yet to appear. Recommended for early evaluation only.

The client git repository also has packages for other languages and environments. See Typescript, Rust, React, Astro, and more coming soon.

Features

  • Client defaults to synchronous requests with requests
  • Async support via thumbrella-client[async] using aiohttp
  • The batch() call processes multiple URLs in parallel
  • In-memory LRU cache takes full advantage of HTTP cache headers
  • Binary thumbnail data loads easily into PIL, Qt, Pygame, or any other image library
  • The client and server always provide placeholder images, even when disconnected or misconfigured
  • Optional verify() methods promote failed results into exceptions
  • Media classification and lightweight metadata provided with every result
  • Thumbrella server supports hundreds of formats

Quickstart

Install with your package manager of choice using thumbrella-client or thumbrella-client[async].

uv add thumbrella-client
pip install thumbrella-client
import thumbrella

# Connect to server and generate a thumbnail.
tbr = thumbrella.Client()
result = tbr.thumb("https://example.com/photo.jpg")
print(result.status, len(result.media.thumbnail), "bytes")

# Pillow can decode from a zero-copy buffer.
from PIL import Image
img = Image.open(result.media.thumbnail.io)

The source comes with several starting point examples. See the client documentation for more details and examples.

Servers

This client works with self-hosted Thumbrella servers and the online Thumbrella Cloud service. Both are configured using the $TBR_CONNECT environment variable. Alternatively, a connect string can be passed to the Client constructor.

Thumbrella provides a demo gallery and server that can be used for free with no account and no signup.

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.1.tar.gz (24.9 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.1-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: thumbrella_client-0.5.1.tar.gz
  • Upload date:
  • Size: 24.9 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.1.tar.gz
Algorithm Hash digest
SHA256 46eee7286af30f13e88d97e61e2e8407c36b17028238a4497d21d7582426166d
MD5 4c9a7bcdde4b3a6000e3508621c9fff0
BLAKE2b-256 308fff1df6c1a486ec462411ad140221a9817c75453669b6c28253977c4892be

See more details on using hashes here.

File details

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

File metadata

  • Download URL: thumbrella_client-0.5.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0d1c39ee1761befc6b8bc5dd6634f9d0c14feb3932be894fc4229dd92d4d5509
MD5 2b8d0d63a271b5c3c3215aa79a09668b
BLAKE2b-256 c6616c75aa5c6aa05a41366b0b7548134acb6a40417dfc25b96f123514fbdcc8

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

This release

0.5.1 This release

2 files

0.5.0

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