{"id":27003,"library":"foundry-platform-sdk","title":"Foundry Platform SDK","description":"The official Python library for the Palantir Foundry API. Version 1.82.0, requires Python >=3.10, <4.0. Rapid release cadence (weekly).","status":"active","version":"1.82.0","language":"python","source_language":"en","source_url":"https://github.com/palantir/foundry-platform-python","tags":["foundry","palantir","api-client","sdk"],"install":[{"cmd":"pip install foundry-platform-sdk","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"HTTP client used internally","package":"httpx","optional":false},{"reason":"Data validation and settings management","package":"pydantic","optional":false}],"imports":[{"note":"The package name is 'foundry', not 'foundry_platform_sdk'.","wrong":"from foundry_platform_sdk import FoundryClient","symbol":"FoundryClient","correct":"from foundry import FoundryClient"},{"note":"Models are organized by namespace; User is in admin.","wrong":"from foundry.models import User","symbol":"User","correct":"from foundry.admin import User"}],"quickstart":{"code":"from foundry import FoundryClient\nfrom foundry import os\n\nclient = FoundryClient(\n    hostname=os.environ.get('FOUNDRY_HOSTNAME', ''),\n    token=os.environ.get('FOUNDRY_TOKEN', ''),\n)\n\n# List users\nusers = client.admin.User.list()\nfor user in users.data[:5]:\n    print(user.email)","lang":"python","description":"Initialize client with hostname and token from environment variables."},"warnings":[{"fix":"Upgrade Python to 3.10 or later.","message":"The SDK requires Python >=3.10. Installations on Python 3.9 or lower will fail.","severity":"breaking","affected_versions":"all versions >=1.0.0"},{"fix":"Switch to using FOUNDRY_TOKEN or FoundryClient(token=...).","message":"Authentication via foundry_client_id and foundry_client_secret environment variables is deprecated in favor of token-based auth using FOUNDRY_TOKEN.","severity":"deprecated","affected_versions":">=1.50.0"},{"fix":"Use 'from foundry import FoundryClient'.","message":"The correct import is from foundry import FoundryClient, NOT from foundry_platform_sdk. Many users mistakenly use the PyPI package name as import root.","severity":"gotcha","affected_versions":"all versions"},{"fix":"Use users.data instead of users directly.","message":"List methods return a paginated object, not a plain list. Access .data to get items.","severity":"gotcha","affected_versions":"all versions"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Change import to 'from foundry import FoundryClient'.","cause":"User installed the package but tried to import with the PyPI name instead of the correct module name 'foundry'.","error":"ModuleNotFoundError: No module named 'foundry_platform_sdk'"},{"fix":"Use token-based auth: FoundryClient(hostname=..., token=...).","cause":"Older authentication methods using client_id/client_secret are no longer supported.","error":"TypeError: Client.__init__() got an unexpected keyword argument 'client_id'"},{"fix":"Set FOUNDRY_TOKEN to a valid API token, or pass token parameter to FoundryClient.","cause":"Invalid or missing FOUNDRY_TOKEN environment variable.","error":"httpx.HTTPStatusError: 401 Unauthorized"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}