Skip to content

Conversation

@Al-Pragliola
Copy link
Contributor

@Al-Pragliola Al-Pragliola commented Jan 5, 2026

⚠️ Note: This client is intended for internal testing purposes only (E2E tests, API validation). It is not designed as a user-facing SDK and should not be published to PyPI.

Description

Adds a Python client library for the Model Catalog API.

What's Included

  • model_catalog.CatalogAPIClient - High-level client with methods for sources, models, artifacts, filtering, and source preview
  • Custom exceptions - CatalogError, CatalogConnectionError, CatalogAPIError, CatalogNotFoundError, CatalogValidationError
  • Generated OpenAPI client (catalog_openapi/) - Auto-generated from api/openapi/catalog.yaml
  • Build tooling - Makefile, Poetry, Nox (Python 3.10-3.12), Schemathesis config

Quick Example

from model_catalog import CatalogAPIClient

with CatalogAPIClient("http://localhost:8081") as client:
    models = client.get_models(order_by="ACCURACY", sort_order="DESC")

Follow-up

E2E tests and Kustomize deployment overlay in separate PR

How Has This Been Tested?

make lint

Merge criteria:

  • All the commits have been signed-off (To pass the DCO check)
  • The commits have meaningful messages
  • Automated tests are provided as part of the PR for major new functionalities; testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work.
  • Code changes follow the kubeflow contribution guidelines.
  • For first time contributors: Please reach out to the Reviewers to ensure all tests are being run, ensuring the label ok-to-test has been added to the PR.

@Al-Pragliola Al-Pragliola force-pushed the al-pragliola-catalog-python-client branch from 8229a5b to 9c2b57c Compare January 5, 2026 14:50
Copy link
Member

@pboyd pboyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I think this will be useful.

I was trying to follow the docs but I keep running into errors related to missing tests.

$ make deploy
...
/bin/sh: line 1: cd: ../../../manifests/kustomize/options/catalog/overlays/e2e: No such file or directory
$ make test-e2e
CATALOG_URL=${CATALOG_URL:-http://localhost:8081} poetry run pytest --e2e -v -rA
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --e2e
  inifile: /home/pboyd/dev/kubeflow/model-registry/catalog/clients/python/pyproject.toml
  rootdir: /home/pboyd/dev/kubeflow/model-registry/catalog/clients/python

make: *** [Makefile:89: test-e2e] Error 4

(make test-fuzz is similar)

Should those be removed from the docs and Makefile for now? Or, maybe, if it's simple enough could you add stubs so those commands work?


Python client and E2E tests for the Kubeflow Model Catalog.

## Installation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this mention virtualenv? I guess it's not absolutely required, but practically most folks will need virtualenv or uv or something.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Installation
## Installation
```bash
# Install dependencies (Poetry creates a virtual environment automatically)
poetry install
# Or, if you prefer to manage your own virtualenv:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -e .

something like that?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, like that. Except, they should still run poetry instead of pip, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, thanks

@pboyd
Copy link
Member

pboyd commented Jan 6, 2026

Nevermind, I didn't see #2066.

/lgtm

@google-oss-prow google-oss-prow bot removed the lgtm label Jan 7, 2026
@pboyd
Copy link
Member

pboyd commented Jan 7, 2026

/lgtm
/approve

@google-oss-prow google-oss-prow bot added the lgtm label Jan 7, 2026
@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pboyd

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot merged commit cf0c712 into kubeflow:main Jan 7, 2026
22 checks passed
@Al-Pragliola Al-Pragliola deleted the al-pragliola-catalog-python-client branch January 7, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants