Metadata-Version: 2.1
Name: dpshdl
Version: 0.0.4
Summary: Framework-agnostic library for loading data
Home-page: https://github.com/dpshai/dpshdl
Author: Benjamin Bolte
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: Pillow
Requires-Dist: requests
Provides-Extra: dev
Requires-Dist: black; extra == "dev"
Requires-Dist: darglint; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: types-Pillow; extra == "dev"
Requires-Dist: types-requests; extra == "dev"

# dpshdl

A framework-agnostic library for loading data.

## Installation

```bash
pip install dpshdl
```

## Usage

Datasets should override a single method, `next`, which returns a single sample.

```python
import dpshdl as dl
import numpy as np

class MyDataset(dl.Dataset[np.ndarray, np.ndarray]):
    def next(self) -> int:
        return 1

    def collate(self, items: list[int]) -> np.ndarray:
        return np.array(items)

loader = dl.Dataloader(MyDataset(), batch_size=2)

# Loops forever.
for sample in loader:
    assert sample.shape == (2,)
```
