Metadata-Version: 2.4
Name: py-dataset-hub
Version: 0.1.3
Summary: Unified ingestion and preprocessing for text, image, audio, video, tabular, and multimodal datasets
License-Expression: MIT
Project-URL: Homepage, https://github.com/anuj7iwari/dataset-hub
Project-URL: Repository, https://github.com/anuj7iwari/dataset-hub
Project-URL: Documentation, https://github.com/anuj7iwari/dataset-hub#readme
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.24
Requires-Dist: torch>=2.1
Requires-Dist: pydantic>=2.6
Requires-Dist: Pillow>=10.0
Provides-Extra: audio
Requires-Dist: scipy>=1.10; extra == "audio"
Provides-Extra: video
Requires-Dist: opencv-python>=4.8; extra == "video"
Provides-Extra: hf
Requires-Dist: datasets>=2.18; extra == "hf"
Provides-Extra: kaggle
Requires-Dist: kagglehub>=0.2; extra == "kaggle"
Provides-Extra: parquet
Requires-Dist: pyarrow>=14; extra == "parquet"
Provides-Extra: yaml
Requires-Dist: PyYAML>=6; extra == "yaml"
Provides-Extra: test
Requires-Dist: pytest>=8; extra == "test"
Requires-Dist: scipy>=1.10; extra == "test"
Requires-Dist: PyYAML>=6; extra == "test"
Provides-Extra: all
Requires-Dist: scipy>=1.10; extra == "all"
Requires-Dist: opencv-python>=4.8; extra == "all"
Requires-Dist: datasets>=2.18; extra == "all"
Requires-Dist: kagglehub>=0.2; extra == "all"
Requires-Dist: pyarrow>=14; extra == "all"
Requires-Dist: PyYAML>=6; extra == "all"
Dynamic: license-file

# py-dataset-hub

`py-dataset-hub` (imported in Python as `data_hub`) is a Python library for loading, normalizing, and preprocessing datasets across multiple modalities into PyTorch Datasets, DataLoaders, and NumPy arrays.


Installation
------------

Install from PyPI:

```bash
pip install py-dataset-hub
```

Optional dependencies for specific modalities:

```bash
pip install "py-dataset-hub[audio]"    # Audio decoding and resampling (scipy)
pip install "py-dataset-hub[video]"    # Video frame extraction (opencv-python)
pip install "py-dataset-hub[hf]"       # Hugging Face datasets integration
pip install "py-dataset-hub[kaggle]"   # Kaggle dataset downloads
pip install "py-dataset-hub[parquet]"  # Parquet support (pyarrow)
pip install "py-dataset-hub[yaml]"     # YAML support (PyYAML)
pip install "py-dataset-hub[all]"      # All optional dependencies
```

To verify installation:

```bash
python -c "import data_hub as dh; print(dh.__version__)"
```


Features
--------

- Multi-modal: Unified `load()` interface for text, image, audio, video, tabular (CSV, TSV, Parquet), JSON, and YAML data.
- Framework integration: Direct export to PyTorch `Dataset` and `DataLoader` with automatic batch collation, or conversion to NumPy arrays.
- Streaming: Memory-efficient streaming for large files (JSONL, CSV, generators) without full materialization.
- Pipelines: Built-in `map`, `filter`, `batch`, `shuffle`, and `split` operations.
- Remote sources: Integration with Hugging Face Hub and Kaggle datasets.


Usage
-----

Import the package as `data_hub`:

```python
import data_hub as dh

# Load data from memory, files, or directories
ds = dh.load([
    {"text": "Sample text one", "label": 1},
    {"text": "Sample text two", "label": 0},
])

# Preview samples
print(ds.preview(2))

# Convert to a PyTorch DataLoader
loader = ds.to_dataloader(batch_size=2, shuffle=True)

# Convert to NumPy arrays
arrays = ds.to_numpy()
```


Links and Resources
-------------------

- GitHub Repository: https://github.com/anuj7iwari/dataset-hub
- Documentation: https://github.com/anuj7iwari/dataset-hub#readme
- Issue Tracker: https://github.com/anuj7iwari/dataset-hub/issues
- License: https://github.com/anuj7iwari/dataset-hub/blob/main/LICENSE
