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 Python 3.11+ and semblance 0.10.x (>=0.10.0,<1.0). Python 3.10 users can use Foundry 0.1.x with semblance<0.10.
Install
pip install "semblance-foundry[test]"
The [test] extra installs the in-process HTTP client used in the quick start.
For CLI-only use, pip install semblance-foundry is enough.
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.2.0)
- 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.
Metadata
Release files for semblance-foundry 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| semblance_foundry-0.2.0.tar.gz | 22.5 kB | With provenance | Details for semblance_foundry-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| semblance_foundry-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for semblance_foundry-0.2.0-py3-none-any.whl |
Total release size: 49.5 kB
Release files / semblance_foundry-0.2.0.tar.gz
| Download URL | semblance_foundry-0.2.0.tar.gz |
|---|---|
| Size | 22.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4f491609e5f0bb788413992fa7e3d4745cd9f8d9752fcb9303fbe7f064468d81
|
|
BLAKE2b-256 checksum How to use checksums |
17980bc5c065375bc929eaf378ec9e63f2a87d6c53360f884b5abd46581ba9b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.
Transparency logRelease files / semblance_foundry-0.2.0-py3-none-any.whl
| Download URL | semblance_foundry-0.2.0-py3-none-any.whl |
|---|---|
| Size | 27.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d3bfcdb69ffc417966ecc511be5dd34e9f89bf0bd6252c628e382303148eca8a
|
|
BLAKE2b-256 checksum How to use checksums |
e4017af8c1cd3e57dc455744f720a01083f7ba5a84e1a6cb1f3af0c94b1113ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.
Transparency logSecurity for semblance-foundry 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for semblance_foundry-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.