Skip to main content

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.

from jabs.io import save, load
from jabs.core.types.keypoints import FrameKeypoints

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

Installation extras

jabs-io ships optional extras for format-specific backends:

Extra Installs Enables
nwb pynwb, ndx-pose NWB pose file read/write
parquet pyarrow Parquet feature cache I/O

jabs-io depends on jabs-core, which requires h5py directly, so HDF5 support is always available with no extra needed. pyarrow is also a direct dependency of jabs-behavior-classifier, so the parquet backend is available automatically when jabs-io is installed as part of the full JABS application. The nwb extra must always be installed explicitly:

pip install "jabs-behavior-classifier[nwb]"

When using jabs-io as a standalone library:

pip install "jabs-io[nwb,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.

from jabs.io.base import (
    JSONAdapter,
    ParquetAdapter,
    # TODO: HDF5Adapter,
)

To register your adapter for use, use the register adapter decorator.

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):
    ...

Future Work

  • NWB: segmentation data roundtripPoseData.segmentation_data is not currently stored by the NWB adapter. If possible, we might want to consider writing it as an additional TimeSeries in the behavior processing module (similar to jabs_identity_mask) so it survives a write/read roundtrip.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jabs_io-0.46.2.tar.gz (36.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jabs_io-0.46.2-py3-none-any.whl (48.8 kB view details)

Uploaded Python 3

File details

Details for the file jabs_io-0.46.2.tar.gz.

File metadata

  • Download URL: jabs_io-0.46.2.tar.gz
  • Upload date:
  • Size: 36.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for jabs_io-0.46.2.tar.gz
Algorithm Hash digest
SHA256 e4d1fdddf0de68ed83feee8f594618adbc844d86e9d9b325a644a47ddccbd146
MD5 84fa853d1976aa2a4f94d5fe3241c289
BLAKE2b-256 6ffe9603356a3336f7030b970c90b176a9a237ec17aa9a30b42601926b0cd73a

See more details on using hashes here.

File details

Details for the file jabs_io-0.46.2-py3-none-any.whl.

File metadata

  • Download URL: jabs_io-0.46.2-py3-none-any.whl
  • Upload date:
  • Size: 48.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for jabs_io-0.46.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5f94efd74e5e6bd25ffa8864000f4b3386c397bc0592bc67e164d5a52ac6225b
MD5 ba7dd659c963928faf9e911fd3469a07
BLAKE2b-256 8e75d7c146f2c61741b8781c6f139c800acff4141c5c1da62bf4d38d85310371

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.46.2 This release

2 files

0.46.1

2 files

0.46.0

2 files

0.45.0

2 files

0.44.2

2 files

0.44.1

2 files

0.44.0

2 files

0.43.0

2 files

0.42.1

2 files

0.42.0

2 files

0.41.0

2 files

0.2.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page