satchel-adapter-sdk
The small public contract for Satchel source adapters: packages that read an upstream tool's metadata (dbt, Cube, SQLMesh, ...) and describe it in Satchel's canonical IR. The Satchel server turns that IR into ordinary context items, keeps them in sync, and never lets a sync overwrite what analysts added on top.
This distribution depends on pydantic and pyyaml only. It has no web framework, ORM or
database driver; an adapter must not need them either.
from satchel_adapter_sdk import AdapterInfo, SourceAdapter, SourceFiles, SourceSnapshot
What you write
An adapter is an object with an info: AdapterInfo manifest and a pure load method:
class MyAdapter:
info = AdapterInfo(kind="mytool", display_name="My tool", version="0.1.0",
maturity="experimental", capabilities=frozenset({"assets"}),
config_model=MyConfig, file_inputs=(FileInput(name="export", required=True),))
def load(self, config: MyConfig, files: SourceFiles) -> SourceSnapshot: ...
adapter = MyAdapter()
Register it under the satchel.sources entry-point group in your pyproject.toml:
[project.entry-points."satchel.sources"]
mytool = "satchel_source_mytool:adapter"
pip install satchel-source-mytool is then enough; satchel source list shows it as external.
Start from templates/adapter/ and read
docs/adapters/writing-an-adapter.md.
Rules
- Pure.
load(config, files)is deterministic and does no database access. It does no network access either, unless you declare thenetworkcapability. The host reads the input files (named byAdapterInfo.file_inputs, a path in the config or an upload) and hands you bytes. - No server imports. Never import
satchel.*, SQLAlchemy, a database driver or FastAPI. Built-in adapters are held to the same rule by a test. - Folders and optional dependencies.
FileInput(multiple=True, extensions=...)lets the path be a folder (read it withSourceFiles.group(name));AdapterInfo.requiresnames the optional modules an adapter imports lazily, so the host can list it as unavailable with an install hint. - Normalised names. Emit
schema.tablefqns in lower case (normalise_fqn). Put the database inSourceAsset.database. - Warnings, not failures. A construct you cannot map goes into
SourceSnapshot.warnings; one bad node must not fail the sync. - Trust. Installed adapters run in the Satchel process as trusted code. Install only adapters you would run on the server.
IR versioning
satchel_adapter_sdk.IR_VERSION is a semantic version carried by every snapshot.
| Change | Bump |
|---|---|
| New optional field, new optional model, new capability | minor |
| Removed or renamed field, changed meaning, new required field | major |
The server accepts a snapshot whose major equals its own SDK's major and refuses others with a
clear message. Within a major, the server ignores nothing it does not understand and requires
nothing new, so an adapter written against 1.0.0 keeps working on every 1.x.
Conformance kit
from satchel_adapter_sdk.testing import assert_conformant
def test_conformance(update_golden):
assert_conformant(adapter, MyConfig(export="..."), files,
golden=Path(__file__).parent / "golden" / "snapshot.json",
update_golden=update_golden)
It checks the manifest, that the snapshot validates and round-trips, the IR version, determinism
(two loads equal), a stable fingerprint, normalised fqns and unique keys, valid MDL, declared
capabilities, no network (unless declared) and no server imports, and compares the snapshot to a
committed golden file. Add pytest_plugins = ["satchel_adapter_sdk.pytest_plugin"] to your
conftest.py for the --update-golden flag (or set SATCHEL_UPDATE_GOLDEN=1).
Wren MDL
If your tool has governed metrics, build a Wren MDL manifest with MdlBuilder (models over
warehouse tables plus cubes of measures and dimensions) and return it in a
SourceSemanticModel. Satchel serves it through query_metrics.
Develop
cd sdk && uv sync && uv run pytest -q && uv run ruff check . && uv run mypy satchel_adapter_sdk
Licence: Apache-2.0.
Metadata
Release files for satchel-adapter-sdk 1.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 |
|---|---|---|---|---|
| satchel_adapter_sdk-1.2.0.tar.gz | 57.0 kB | Without provenance | Details for satchel_adapter_sdk-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| satchel_adapter_sdk-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for satchel_adapter_sdk-1.2.0-py3-none-any.whl |
Total release size: 76.3 kB
Release files / satchel_adapter_sdk-1.2.0.tar.gz
| Download URL | satchel_adapter_sdk-1.2.0.tar.gz |
|---|---|
| Size | 57.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bb30f028a8eb997590dea3ec2f25c09d9b2dc6a7d406a79530c114b24c41c05c
|
|
BLAKE2b-256 checksum How to use checksums |
651039b449d5a01e2eb27d1deeed755ad03c3dd36521eacfebda9e95982aefe5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / satchel_adapter_sdk-1.2.0-py3-none-any.whl
| Download URL | satchel_adapter_sdk-1.2.0-py3-none-any.whl |
|---|---|
| Size | 19.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
adee019f4c3e3029d4712e017c643026ef970dedec85aec7fcad06c5aff3b3f0
|
|
BLAKE2b-256 checksum How to use checksums |
30170e3e07290039192c0bb06e03d61970b5fe563b5e59b85560bda1084d3d14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for satchel-adapter-sdk 1.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.