palantir-sdk-patterns

Featured

Apply production-ready Palantir Foundry SDK patterns for Python and TypeScript. Use when implementing Foundry integrations, refactoring SDK usage, or establishing team coding standards for Foundry API calls. Trigger with phrases like "palantir SDK patterns", "foundry best practices", "palantir code patterns", "idiomatic foundry SDK".

AI & Automation 2,944 stars 440 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Palantir SDK Patterns ## Overview Production-ready patterns for Foundry Platform SDK and OSDK usage. Covers client singletons, typed error handling, pagination helpers, retry logic, and multi-tenant client factories. ## Prerequisites - Completed `palantir-install-auth` setup - Familiarity with async/await patterns - `foundry-platform-sdk` or `@osdk/client` installed ## Instructions ### Step 1: Singleton Client (Python) ```python # src/foundry_client.py import os import foundry from functools import lru_cache @lru_cache(maxsize=1) def get_client() -> foundry.FoundryClient: """Thread-safe singleton — cached after first call.""" auth = foundry.ConfidentialClientAuth( client_id=os.environ["FOUNDRY_CLIENT_ID"], client_secret=os.environ["FOUNDRY_CLIENT_SECRET"], hostname=os.environ["FOUNDRY_HOSTNAME"], scopes=["api:read-data", "api:write-data"], ) auth.sign_in_as_service_user() return foundry.FoundryClient(auth=auth, hostname=os.environ["FOUNDRY_HOSTNAME"]) ``` ### Step 2: Typed Error Handling ```python import foundry from dataclasses import dataclass from typing import TypeVar, Generic, Optional T = TypeVar("T") @dataclass class Result(Generic[T]): data: Optional[T] = None error: Optional[str] = None status_code: Optional[int] = None def safe_call(fn, *args, **kwargs) -> Result: """Wrap any Foundry SDK call with structured error handling.""" try: return Result(data=fn(*args, **kwargs)) e...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category