Metadata-Version: 2.4
Name: ds-provider-mock-py-lib
Version: 0.1.0a3
Summary: Mock provider for DS pipeline e2e testing
Author-email: Kristoffer Varslott <hello@grasplabs.com>
Maintainer-email: Kristoffer Varslott <hello@grasplabs.com>
License-Expression: Apache-2.0
Project-URL: Documentation, https://grasp-labs.github.io/ds-provider-mock-py-lib/
Project-URL: Repository, https://github.com/grasp-labs/ds-provider-mock-py-lib/
Project-URL: Issues, https://github.com/grasp-labs/ds-provider-mock-py-lib/issues/
Project-URL: Changelog, https://github.com/grasp-labs/ds-provider-mock-py-lib/releases
Keywords: ds,python,mock,provider,e2e
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE-APACHE
Requires-Dist: ds-resource-plugin-py-lib<1.0.0,>=0.1.0rc2
Requires-Dist: ds-common-logger-py-lib<1.0.0,>=0.1.0a5
Requires-Dist: ds-common-serde-py-lib<1.0.0,>=0.1.0b1
Requires-Dist: pandas<3.0.0,>=2.2.0
Provides-Extra: dev
Requires-Dist: ruff>=0.1.8; extra == "dev"
Requires-Dist: mypy>=1.7.0; extra == "dev"
Requires-Dist: pandas-stubs>=2.0.0; extra == "dev"
Requires-Dist: types-pyyaml>=6.0.0; extra == "dev"
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: pytest-xdist>=3.3.0; extra == "dev"
Requires-Dist: pre-commit>=3.6.0; extra == "dev"
Requires-Dist: build>=1.0.0; extra == "dev"
Requires-Dist: twine>=4.0.0; extra == "dev"
Requires-Dist: sphinx>=7.1.0; extra == "dev"
Requires-Dist: sphinx-autoapi>=3.0.0; extra == "dev"
Requires-Dist: sphinx-material>=0.0.35; extra == "dev"
Requires-Dist: bandit>=1.7.0; extra == "dev"
Requires-Dist: jsonschema>=4.20.0; extra == "dev"
Provides-Extra: test
Requires-Dist: pytest>=7.4.0; extra == "test"
Requires-Dist: pytest-cov>=4.1.0; extra == "test"
Requires-Dist: pytest-xdist>=3.3.0; extra == "test"
Requires-Dist: jsonschema>=4.20.0; extra == "test"
Provides-Extra: docs
Requires-Dist: sphinx>=7.1.0; extra == "docs"
Requires-Dist: sphinx-autoapi>=3.0.0; extra == "docs"
Requires-Dist: sphinx-material>=0.0.35; extra == "docs"
Dynamic: license-file

# 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

```bash
pip install ds-provider-mock-py-lib
```

Or using uv:

```bash
uv pip install ds-provider-mock-py-lib
```

## Quick Start

```python
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:

```python
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-lib`
- `pandas`

## Documentation

Full documentation is available at:

- [GitHub Repository](https://github.com/grasp-labs/ds-provider-mock-py-lib)
- [Documentation Site](https://grasp-labs.github.io/ds-provider-mock-py-lib/)

## Development

```bash
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](https://github.com/grasp-labs/ds-provider-mock-py-lib#readme)
for more information.

## License

This package is licensed under the Apache License 2.0.
See the [LICENSE-APACHE](https://github.com/grasp-labs/ds-provider-mock-py-lib/blob/main/LICENSE-APACHE)
file for details.

## Support

- **Issues**: [GitHub Issues](https://github.com/grasp-labs/ds-provider-mock-py-lib/issues)
- **Releases**: [GitHub Releases](https://github.com/grasp-labs/ds-provider-mock-py-lib/releases)
