This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Cloudglue Python SDK - Official SDK for the Cloudglue API that turns video into LLM-ready data. Python 3.10+.
make setup # Create venv and install dependencies
make submodule-init # Initialize API spec Git submodule (required first time)
make submodule-update # Update API spec to latest version
make generate # Regenerate SDK from OpenAPI spec
make build # Build wheel + sdist
make publish # Upload to PyPI
make clean # Remove all build artifactsInstall in development mode:
source .venv/bin/activate
pip install -e .Prerequisite: brew install openapi-generator
-
Custom Client Layer (
cloudglue/client/) - User-friendly interface you editmain.py-Cloudgluemain class, initializes all resourcesresources/- 15 resource wrappers (Chat, Files, Collections, etc.)resources/base.py-CloudglueErrorexception class
-
Generated SDK Layer (
cloudglue/sdk/) - Auto-generated, DO NOT EDIT- Generated from OpenAPI spec via
make generate api/- API endpoint classesmodels/- Pydantic models
- Generated from OpenAPI spec via
Resource wrappers convert ApiException to CloudglueError:
try:
return self.api.some_method(...)
except ApiException as e:
raise CloudglueError(str(e), e.status, e.data, e.headers, e.reason)Filter helpers use static methods to convert dicts to Pydantic filter objects (see chat.py for example).
Configuration: API key via constructor or CLOUDGLUE_API_KEY env var.
The OpenAPI spec is a Git submodule in spec/ pointing to cloudglue-api-spec repo. After updating the submodule, run make generate to regenerate the SDK. The fix-oneof-constraints.py script runs post-generation to fix oneOf validation issues.
- Ensure the API spec includes the new endpoints
- Run
make generateto create API classes and models - Create a new resource wrapper in
cloudglue/client/resources/ - Import the API class in
cloudglue/client/main.py - Add the resource to
Cloudglue.__init__() - Export from
cloudglue/client/resources/__init__.py