Skip to main content

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 UsdPreviewSurface documents 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

# Ergonomic path — VisAsset binds (source, material_id, tier) and
# exposes lazy scalars/textures + format adapters.
asset = client.asset("ambientcg", "Rock064", tier="1k")
three  = asset.to_threejs()   # MeshPhysicalMaterial dict
gltf   = asset.to_gltf()      # glTF 2.0 material dict
mtlx   = asset.to_mtlx()      # MtlxSource (.xml() / .export(dir))

# Lower-level — when you just want the bytes for one channel.
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-Reset honoring
  • Raises mat_vis_client.RateLimitError when retries are exhausted

Adapters

The recommended entry point is client.asset(...).to_threejs() (see Quick start). The free functions below are the lower-level primitive layer — use them when you've already got scalars and textures dicts in hand (e.g. building a custom pipeline, porting to another language, or unit-testing without instantiating a client).

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

Metadata

Release files for mat-vis-client 0.6.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mat-vis-client 0.6.4
File Size Uploaded Provenance
mat_vis_client-0.6.4.tar.gz 105.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mat-vis-client 0.6.4
File Interpreter ABI Platform
mat_vis_client-0.6.4-py3-none-any.whl Python 3 none any Details

Total release size: 146.2 kB

Release files / mat_vis_client-0.6.4.tar.gz

Download URL mat_vis_client-0.6.4.tar.gz
Size 105.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ea54a4356692ca2a936105010baba123e43e75655183cd6828fc9fb35bc36616
BLAKE2b-256 checksum
How to use checksums
766f7c557095a18e616a08da2352f823eb33f54c1c74abc7b370897126d101e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 6, 2026.

Transparency log

Release files / mat_vis_client-0.6.4-py3-none-any.whl

Download URL mat_vis_client-0.6.4-py3-none-any.whl
Size 40.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fc0baa7a762e24bafc3375016dc8f24bf54dfd1166c5a4998cdc6be285aa490e
BLAKE2b-256 checksum
How to use checksums
d9783afe55ce4a8a653ae85b62d563189056dabd87d13a66f578b5ec3ee5266d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 6, 2026.

Transparency log

Security for mat-vis-client 0.6.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mat_vis_client-0.6.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page