Skip to main content

semblance-foundry

Unofficial local HTTP simulation of selected Palantir Foundry API v2 ontology-read operations.

This package is not affiliated with, endorsed by, or equivalent to Palantir. It does not implement Foundry's ontology engine, permissions, or compute. It is a test double for client development and CI.

Verified against public API v2 documentation dated 2026-08-18. See compatibility.yaml (also served at /.well-known/foundry-mock-compatibility.json).

Requires semblance 0.8.x or 0.9.x (>=0.8.0,<1.0).

Install

pip install semblance-foundry

From a clone of this repository:

pip install -e ".[dev]"
pip install -e "packages/semblance-foundry[dev]"

Optional official SDK extra (not installed in default CI):

pip install "semblance-foundry[sdk]"
pytest packages/semblance-foundry/tests -m sdk

Pinned SDK: foundry-platform-sdk==1.101.0. Untested SDK versions are not implied compatible.

Quick start (HTTP)

from semblance_foundry import FoundryMock, FoundryMockConfig
from semblance_foundry.testing import foundry_test_client

foundry = FoundryMock(FoundryMockConfig(seed=42, auth="optional"))
foundry.load_bundled_fixture()
client = foundry_test_client(foundry)

r = client.get("/api/v2/ontologies/acme/objects/Employee?pageSize=2")
assert r.status_code == 200

CLI:

semblance-foundry fixture init --output foundry.yaml
semblance-foundry validate foundry.yaml
semblance-foundry operations
semblance-foundry serve --fixture foundry.yaml --port 8765
# or: semblance-foundry serve   # bundled acme fixture

Environment variables for local clients (not Palantir credentials): SEMBLANCE_FOUNDRY_HOST, SEMBLANCE_FOUNDRY_TOKEN.

Auth modes

  • disabled — ignore Authorization
  • optional (default) — missing token is OK; malformed Bearer values return 401
  • strict — token must be in FoundryMockConfig.tokens

Authentication errors never echo the token. This is not an OAuth server and does not validate real Palantir credentials.

Fixtures

YAML/JSON version 1. Extra fields are rejected. Fixtures are data only — no expressions are evaluated. Register query callbacks in Python:

foundry.register_query("employeesByOffice", lambda params, state: {"data": []})

load_bundled_fixture() loads the shipped acme example (one ontology, Employee + Office, worksAt links, renameEmployee action metadata, and employeesByOffice static query result). Use load_fixture(path) for your own files.

Pagination

List endpoints use pageSize / pageToken / nextPageToken. Tokens are opaque and checksummed. Tampering or cross-resource reuse returns InvalidPageToken (400). Default page size 100, max 1000.

Known unsupported (0.1.3)

  • Action apply / applyBatch — 501 UnsupportedOperation only when auth=strict; otherwise 404
  • Aggregates, object sets, datasets, transactions, orchestration, streams
  • Search filters other than eq and and of eq (400 InvalidQuery)

Unknown paths return Foundry-style 404.

Compatibility matrix (MVP)

Level Operations
exact list/get ontologies, object types, objects, linked objects, action types (metadata), query types
representative object search (eq/and), query execute (static or callback)
unsupported apply, applyBatch

Security

  • Do not put production secrets in fixtures or tokens used with this mock
  • Tokens are compared in-process and never written to error bodies
  • Query/action behavior must be allow-listed Python, never YAML eval

License

MIT. Palantir and Foundry are trademarks of their respective owners.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

semblance_foundry-0.1.3.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

semblance_foundry-0.1.3-py3-none-any.whl (26.8 kB view details)

Uploaded Python 3

File details

Details for the file semblance_foundry-0.1.3.tar.gz.

File metadata

  • Download URL: semblance_foundry-0.1.3.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for semblance_foundry-0.1.3.tar.gz
Algorithm Hash digest
SHA256 924e635174a2fb43f816c08af3ff4c3272d6853b4c97cb0091629e19d1b98e1b
MD5 bc6a934dd193ab9152dadfbe91d9409f
BLAKE2b-256 3fd9f0fd00307f122f90ebb22be6c9e2bd8e626560761f00563de9680df8d34a

See more details on using hashes here.

Provenance

The following attestation bundles were made for semblance_foundry-0.1.3.tar.gz:

Publisher: release.yml on eddiethedean/semblance

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file semblance_foundry-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for semblance_foundry-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 013d91f07fa0c2fd9db6f33099a7116595b4bbde39646bc9c00acb191fa5818b
MD5 5491cdcb894240f1a6fa9af2c6a54bf7
BLAKE2b-256 86ce612c915e20349a74a05468e85a627217679ea6eb6201be480a710f38f191

See more details on using hashes here.

Provenance

The following attestation bundles were made for semblance_foundry-0.1.3-py3-none-any.whl:

Publisher: release.yml on eddiethedean/semblance

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page