Pure Python client for mat-vis PBR textures — HTTP range reads, zero deps
Project description
mat-vis-client
Pure Python client for mat-vis — PBR texture data distributed as Parquet files on GitHub Releases.
- Zero dependencies — stdlib only (
urllib). No pyarrow, no numpy, no binary wheels. - HTTP range reads — fetch a single texture channel with one ranged GET against a consolidated Parquet asset. No whole-archive downloads.
- Local cache — results cached under
~/.cache/mat-vis/with a configurable soft cap. - Search — filter materials by category, roughness / metalness ranges, source, tier.
- MaterialX export — synthesized
UsdPreviewSurfacedocuments or original upstream authored documents (gpuopen). - Format adapters — three.js, glTF 2.0 KHR_materials_pbrSpecularGlossiness, MaterialX.
Install
pip install mat-vis-client
Python 3.10+.
Quick start
from mat_vis_client import MatVisClient
client = MatVisClient() # latest release
png = client.fetch_texture("ambientcg", "Rock064", "color", tier="1k")
with open("rock.png", "wb") as f:
f.write(png)
Search
results = client.search(
category="stone",
roughness_range=(0.4, 0.9),
source="ambientcg",
)
for r in results:
print(r["id"], r["category"], r["roughness"])
Categories come from the release manifest (metal, wood, stone, fabric, plastic,
concrete, ceramic, glass, organic, other). Inspect them at runtime with
client.categories().
MaterialX
Synthesized UsdPreviewSurface wrapper — always available:
src = client.mtlx("ambientcg", "Rock064", tier="1k")
src.export("./out") # writes .mtlx + referenced PNGs
xml = src.xml # raw MaterialX XML
Original upstream document (gpuopen materials only; None elsewhere):
orig = client.mtlx("gpuopen", "<uuid>").original
if orig is not None:
orig.export("./out")
Bulk prefetch
n = client.prefetch("ambientcg", tier="1k") # download + cache every material
CLI
mat-vis-client list # sources × tiers
mat-vis-client materials ambientcg 1k # IDs
mat-vis-client fetch ambientcg Rock064 color 1k -o rock.png
mat-vis-client search metal --roughness 0.2:0.6
mat-vis-client prefetch ambientcg 1k
Environment variables
| Variable | Default | Purpose |
|---|---|---|
MAT_VIS_CACHE |
~/.cache/mat-vis |
Cache directory |
MAT_VIS_CACHE_MAX_SIZE |
5GB |
Soft cap — warning only, no eviction |
MAT_VIS_MAX_FETCH_SIZE |
500MB |
Hard cap per range-read (OOM defense) |
MAT_VIS_MAX_RETRIES |
5 |
Rate-limit retry attempts |
MAT_VIS_BACKOFF_BASE |
1.0 |
Exponential backoff base (seconds) |
MAT_VIS_NO_UPDATE_CHECK |
— | Disable the once-a-day PyPI update check |
MAT_VIS_UPDATE_CHECK |
— | Force update check even when stderr is not a TTY |
Rate limits
Backed by GitHub's unauthenticated rate limit (60 req/h). The client:
- Caches signed CDN URLs for 4 min to skip the github.com redirect
- Retries 429 / 503 / rate-limited 403 with
Retry-After/X-RateLimit-Resethonoring - Raises
mat_vis_client.RateLimitErrorwhen retries are exhausted
Adapters
from mat_vis_client import to_threejs, to_gltf, export_mtlx
scalars = {"roughness": 0.5, "metalness": 0.0}
textures = client.fetch_all_textures("ambientcg", "Rock064", tier="1k")
three = to_threejs(scalars, textures)
gltf = to_gltf(scalars, textures)
Links
- Source / issue tracker: https://github.com/MorePET/mat-vis
- Changelog: https://github.com/MorePET/mat-vis/blob/main/CHANGELOG.md
- Data license: CC0 (AmbientCG, PolyHaven) + MIT (GPUOpen) per material
Project details
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 mat_vis_client-0.5.0.tar.gz.
File metadata
- Download URL: mat_vis_client-0.5.0.tar.gz
- Upload date:
- Size: 72.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10c87932bbbafea0ccbbaf498da4cf7f2550e857c62309dd52bce632fda1049b
|
|
| MD5 |
3459383c2be3b6e6918d183e7537dca9
|
|
| BLAKE2b-256 |
45a0fa7be45b1b66b6d2839805a09dbcfe99d63e6943c328ad8430908cb99605
|
Provenance
The following attestation bundles were made for mat_vis_client-0.5.0.tar.gz:
Publisher:
pypi.yml on MorePET/mat-vis
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mat_vis_client-0.5.0.tar.gz -
Subject digest:
10c87932bbbafea0ccbbaf498da4cf7f2550e857c62309dd52bce632fda1049b - Sigstore transparency entry: 1339990182
- Sigstore integration time:
-
Permalink:
MorePET/mat-vis@a35cb02bb009e64eada0b2bd34002eff8addcda6 -
Branch / Tag:
refs/tags/client/v0.5.0 - Owner: https://github.com/MorePET
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@a35cb02bb009e64eada0b2bd34002eff8addcda6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mat_vis_client-0.5.0-py3-none-any.whl.
File metadata
- Download URL: mat_vis_client-0.5.0-py3-none-any.whl
- Upload date:
- Size: 30.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1331924c7d5001e035d6ae8b2c7e415fbd2bd2f64d083175ad17f27618fae912
|
|
| MD5 |
ba8baf4f1a9a98a606beb3e9015454cf
|
|
| BLAKE2b-256 |
54eaccada22622e2af481b554b27b9a619c5dc2f5f29e7861f28b1a81ff5ca21
|
Provenance
The following attestation bundles were made for mat_vis_client-0.5.0-py3-none-any.whl:
Publisher:
pypi.yml on MorePET/mat-vis
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mat_vis_client-0.5.0-py3-none-any.whl -
Subject digest:
1331924c7d5001e035d6ae8b2c7e415fbd2bd2f64d083175ad17f27618fae912 - Sigstore transparency entry: 1339990184
- Sigstore integration time:
-
Permalink:
MorePET/mat-vis@a35cb02bb009e64eada0b2bd34002eff8addcda6 -
Branch / Tag:
refs/tags/client/v0.5.0 - Owner: https://github.com/MorePET
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@a35cb02bb009e64eada0b2bd34002eff8addcda6 -
Trigger Event:
push
-
Statement type: