Metadata-Version: 2.3
Name: jabs-io
Version: 0.2.0
Summary: Add your description here
Author: Glen Beane, Alexander Berger-Liedtka, Keith Sheppard
License: Proprietary
Requires-Dist: jabs-core
Requires-Dist: numpy>=2.2.6
Requires-Dist: h5py>=3.15.1 ; extra == 'h5py'
Requires-Dist: ndx-pose>=0.2.2 ; extra == 'nwb'
Requires-Dist: pynwb>=3.1.3 ; extra == 'nwb'
Requires-Dist: pyarrow>=18.0.0 ; extra == 'parquet'
Requires-Python: >=3.10, <3.15
Project-URL: Repository, https://github.com/KumarLabJax/JABS-behavior-classifier
Project-URL: Issues, https://github.com/KumarLabJax/JABS-behavior-classifier/issues
Provides-Extra: h5py
Provides-Extra: nwb
Provides-Extra: parquet
Description-Content-Type: text/markdown

# JABS IO (`jabs-io`)

This package handles all serialization/deserialization logic.

## Overview

`jabs-io` decouples the JABS data representation from specific file formats or legacy
versions. It provides a unified way to interact with pose estimation data, behavioral
features, and annotations.

### API

The package provides a high level API that's intended to cover most use-cases.
```python
from jabs.io import save, load
from jabs.core.types.keypoints import FrameKeypoints

data_instance = load('frames.json', FrameKeypoints)
save(data_instance, 'frames.parquet')
```

## Development

Data models are defined as dataclasses in `jabs-core`: `jabs.core.types`. Some backends
will be able to implicitly handle most dataclasses, but if the dataclass is 
complicated, or if there is special handling required of the type for a backend, then a 
type specific adapter should be defined.

All adapters must inherit from `jabs.io.base.Adapter`.

For convenience, backend specific subclasses are provided that handle shared 
functionality for specific file backends.
```python
from jabs.io.base import (
    JSONAdapter,
    ParquetAdapter,
    # TODO: HDF5Adapter,
)
```

To register your adapter for use, use the `register` adapter decorator.
```python
from jabs.core.enums import StorageFormat
from jabs.io.base import JSONAdapter
from jabs.io.registry import register_adapter

@register_adapter(StorageFormat.JSON)
class DataclassJSONAdapter(JSONAdapter):
    ...
```
