This release is a pre-release and may not be stable for production use.
ds-provider-mock-py-lib
Mock provider for DS pipeline e2e testing. Read-only, deterministic,
CDC-style change batches that bronze can load as a real ds.providers
plugin.
Installation
pip install ds-provider-mock-py-lib
Or using uv:
uv pip install ds-provider-mock-py-lib
Quick Start
from uuid import uuid4
from ds_provider_mock_py_lib import (
MockDataset,
MockDatasetSettings,
MockLinkedService,
MockLinkedServiceSettings,
)
linked_service = MockLinkedService(
id=uuid4(),
name="mock-ls",
version="1.0.0",
settings=MockLinkedServiceSettings(),
)
dataset = MockDataset(
id=uuid4(),
name="mock-ds",
version="1.0.0",
linked_service=linked_service,
settings=MockDatasetSettings(row_count=25),
)
linked_service.connect()
dataset.read()
assert len(dataset.output.index) == 25
linked_service.close()
Features
- Deterministic snapshot and incremental CDC batches
- Scriptable connect, auth, and per-request failures
- Xledger-style checkpoint (
incremental+pagination) - Pagination resume after injected read failures
Usage
Full load then one incremental change batch:
dataset.settings.incremental_insert_count = 5
dataset.settings.incremental_update_count = 3
dataset.settings.incremental_noop_count = 2
dataset.checkpoint = {}
dataset.read() # batch 0, all inserts
state = dataset.checkpoint
dataset.checkpoint = state
dataset.read() # batch 1: new keys, changed hashes, identical re-delivery
Requirements
- Python 3.11 or higher
ds-resource-plugin-py-libpandas
Documentation
Full documentation is available at:
Development
git clone https://github.com/grasp-labs/ds-provider-mock-py-lib.git
cd ds-provider-mock-py-lib
uv sync --all-extras --dev
make test
See the README for more information.
License
This package is licensed under the Apache License 2.0. See the LICENSE-APACHE file for details.
Support
- Issues: GitHub Issues
- Releases: GitHub Releases
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 ds_provider_mock_py_lib-0.1.0a1.tar.gz.
File metadata
- Download URL: ds_provider_mock_py_lib-0.1.0a1.tar.gz
- Upload date:
- Size: 24.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ecfd03345ceb78b6789112aa2a6421a5ea345c49dfae18c0bad7ca86e3a6a0a
|
|
| MD5 |
1df55709f036e7b57cbc6658d0e83281
|
|
| BLAKE2b-256 |
2abaf2b07ae2452d64dcadf932f9bb91e1825d5c4a1f3bb30e6da8414c9672fc
|
File details
Details for the file ds_provider_mock_py_lib-0.1.0a1-py3-none-any.whl.
File metadata
- Download URL: ds_provider_mock_py_lib-0.1.0a1-py3-none-any.whl
- Upload date:
- Size: 28.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9633a8988364c09d69692bf2c066ccace573acdc89ec1037d5289e68b771fdb
|
|
| MD5 |
aba9d570ce41ed06524d3516104da589
|
|
| BLAKE2b-256 |
635b1fb5154cceb5fb2be824a26fe1702592ce6e59b56caa03e7dcb46777d029
|