scrift
Python SDK for the Scrift brand asset API. Fetch brand colours, SVG logos, raster exports, and metadata for thousands of companies - one API call at a time.
Installation
pip install scrift
Quick start
from scrift import Scrift
with Scrift(api_key="scrf_...") as client:
# Look up a single brand
brand = client.catalog.get("stripe")
print(brand.name, brand.brand_color) # Stripe 635BFF
print(brand.rate_limit) # RateLimitInfo from X-RateLimit-* headers (or None)
# List the catalog
page = client.catalog.list(limit=10)
for item in page.items:
print(item.slug)
# Batch lookup (up to 50 slugs)
batch = client.catalog.batch(["stripe", "github", "vercel"])
print(batch.found, batch.not_found)
# Search by name
results = client.catalog.search("stripe")
for match in results.matches:
print(match.slug, match.name)
# Fetch an SVG logo
svg_bytes = client.svg.get("stripe", variant="dark")
# PNG / WebP (size is an API-defined enum, e.g. 32 … 512)
png_bytes = client.raster.get_png("stripe", size=128, variant="mono")
webp_bytes = client.raster.get_webp("stripe", size=256)
# Look up a brand by domain
info = client.brand.get("stripe.com")
print(info.variants) # ['color', 'mono', 'wordmark']
Method reference
| Method | Description |
|---|---|
client.catalog.get(slug) |
Single brand by slug |
client.catalog.list(limit=, offset=) |
Paginated catalog list |
client.catalog.batch(slugs) |
Batch lookup (max 50) |
client.catalog.search(query, limit=) |
Search by name (min 2 chars) |
client.svg.get(slug, variant=) |
Raw SVG bytes |
client.raster.get_png(slug, size=, variant=) |
Raw PNG bytes |
client.raster.get_webp(slug, size=, variant=) |
Raw WebP bytes |
client.brand.get(domain) |
Brand lookup by domain |
SVG variants
mono, color, dark, light, wordmark, icon
Error handling
from scrift import Scrift, NotFoundError, RateLimitError
with Scrift(api_key="scrf_...") as client:
try:
brand = client.catalog.get("nonexistent")
except NotFoundError as e:
print(e.error_code) # service_not_found
except RateLimitError as e:
print(f"Retry after {e.retry_after}s")
All exceptions inherit from ScriftError and carry status_code, error_code, and message.
| Exception | HTTP status |
|---|---|
AuthenticationError |
401 |
NotFoundError |
404 |
ValidationError |
422 |
RateLimitError (ScriftRateLimitError) |
429 (auto-retries once, capped at 30s) |
APIError |
everything else |
Links
License
MIT
Metadata
Release files for scrift 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| scrift-0.2.2.tar.gz | 16.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| scrift-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 29.1 kB
Release files / scrift-0.2.2.tar.gz
| Download URL | scrift-0.2.2.tar.gz |
|---|---|
| Size | 16.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b2ded2ef793b7c4a8e03cc080437a087e0a60499b5324f15e24735bda5afacf3
|
|
BLAKE2b-256 checksum How to use checksums |
a3c6cee1a806d72fbbc9baae478144d586f4f965ffc2e0e93df1e357072f9da0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / scrift-0.2.2-py3-none-any.whl
| Download URL | scrift-0.2.2-py3-none-any.whl |
|---|---|
| Size | 12.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ad56828a9637c28183e040c6fbea93ead7a538da3d044f8115786d6c3a20bb4a
|
|
BLAKE2b-256 checksum How to use checksums |
679c7aac00878a6be62eaccb8cc63a11ca80b3bf0965429c44c2a23a38220ed1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|