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.6.1 or 0.7.x.
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— ignoreAuthorizationoptional(default) — missing token is OK; malformedBearervalues return 401strict— token must be inFoundryMockConfig.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.1)
- Action apply / applyBatch —
501 UnsupportedOperationonly whenauth=strict; otherwise 404 - Aggregates, object sets, datasets, transactions, orchestration, streams
- Search filters other than
eqandandofeq(400InvalidQuery)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file semblance_foundry-0.1.1.tar.gz.
File metadata
- Download URL: semblance_foundry-0.1.1.tar.gz
- Upload date:
- Size: 21.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d642c344619cbc0f87e0679598658888a63f561ac395852b6ed69e01bb4b7d8
|
|
| MD5 |
5c06956765ddf27de9db6e09b7d5a6c4
|
|
| BLAKE2b-256 |
a1c0df0bbd7778d74f7372f7c9de740a0dd54f7dc8420dab0403f70ce5ba21e1
|
Provenance
The following attestation bundles were made for semblance_foundry-0.1.1.tar.gz:
Publisher:
release.yml on eddiethedean/semblance
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
semblance_foundry-0.1.1.tar.gz -
Subject digest:
9d642c344619cbc0f87e0679598658888a63f561ac395852b6ed69e01bb4b7d8 - Sigstore transparency entry: 2516391182
- Sigstore integration time:
-
Permalink:
eddiethedean/semblance@bb276e924702004290866a3296e20afe94f8f187 -
Branch / Tag:
refs/tags/foundry-v0.1.1 - Owner: https://github.com/eddiethedean
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bb276e924702004290866a3296e20afe94f8f187 -
Trigger Event:
push
-
Statement type:
File details
Details for the file semblance_foundry-0.1.1-py3-none-any.whl.
File metadata
- Download URL: semblance_foundry-0.1.1-py3-none-any.whl
- Upload date:
- Size: 26.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a60c7795814efb5acd1bad0ec6e68e676fffb8fe810c906b5c985cb1231b74b3
|
|
| MD5 |
1c37c85bc4fab44e1ddbe2ea52964201
|
|
| BLAKE2b-256 |
b358542cf024fa27d12eef43e9f865c7ef9dea79240104dbac119b72d97eb032
|
Provenance
The following attestation bundles were made for semblance_foundry-0.1.1-py3-none-any.whl:
Publisher:
release.yml on eddiethedean/semblance
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
semblance_foundry-0.1.1-py3-none-any.whl -
Subject digest:
a60c7795814efb5acd1bad0ec6e68e676fffb8fe810c906b5c985cb1231b74b3 - Sigstore transparency entry: 2516391357
- Sigstore integration time:
-
Permalink:
eddiethedean/semblance@bb276e924702004290866a3296e20afe94f8f187 -
Branch / Tag:
refs/tags/foundry-v0.1.1 - Owner: https://github.com/eddiethedean
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bb276e924702004290866a3296e20afe94f8f187 -
Trigger Event:
push
-
Statement type: