Metadata-Version: 2.5
Name: dbx-model-catalog
Version: 0.1.9
Summary: Shared Pydantic models and query services for the Databricks model catalog
Requires-Python: >=3.12
Requires-Dist: brotli<2,>=1.1
Requires-Dist: diskcache<6,>=5.6
Requires-Dist: platformdirs<5,>=4.3
Requires-Dist: pydantic<3,>=2.14
Requires-Dist: python-dateutil<3,>=2.9
Requires-Dist: rapidfuzz<4,>=3.14
Description-Content-Type: text/markdown

# dbx-model-catalog

This Python package contains the Pydantic schema and local read, filter, query,
and search client for the Databricks model catalog.

Load the public catalog:

```py
from dbx_model_catalog import ModelCatalogClient

catalog = ModelCatalogClient.from_published()
models = catalog.list()
active = catalog.filter({"status": ["active"]})
ranked = catalog.search("claude reasoning", limit=5)
```

`from_published()` downloads
<https://raw.githubusercontent.com/reggie-db/dbx-model-catalog/main/packages/js/web/catalog/v15/catalog.json>
and caches the
payload for one hour in the platform-native user cache directory. Pass
`refresh=True` to replace the cached value or `cache_ttl` to change its
lifetime. The package selects the schema lane it was built against; newer
catalog schema versions can coexist without changing this URL. Every catalog
includes its source-derived last update timestamp in `updated_at`.

Load explicit data when the published endpoint is not appropriate:

```py
from pathlib import Path
from dbx_model_catalog import ModelCatalogClient

local = ModelCatalogClient.from_json(Path("catalog.json").read_bytes())
remote = ModelCatalogClient.from_url("https://example.com/catalog.json")
```

The client also supports Brotli payloads through `from_brotli()`. Search builds
one in-memory index for the loaded catalog and uses RapidFuzz across model
identity, publisher, capabilities, tasks, use cases, modalities, availability,
leaderboards, benchmarks, and notices. Relevance is combined with independent
version, freshness, lifecycle, leaderboard, and benchmark scores. Query and
filter operations return standard typed `CatalogModelRecord` lists.
