Metadata-Version: 2.4
Name: cap_anndata
Version: 0.5.1
Summary: Partial read/write of AnnData (h5ad) files for low-memory operations with large datasets.
Home-page: https://github.com/cellannotation/cap-anndata
Author: R. Mukhin, A. Isaev
Author-email: roman@ebookapplications.com
Project-URL: Bug Tracker, https://github.com/cellannotation/cap-anndata/issues
Project-URL: Changelog, https://github.com/cellannotation/cap-anndata/blob/main/CHANGELOG.md
Project-URL: Documentation, https://github.com/cellannotation/cap-anndata/blob/main/HOWTO.md
Classifier: Programming Language :: Python :: 3.9
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.23.5
Requires-Dist: pandas>=2.2.0
Requires-Dist: anndata>=0.10.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: setuptools~=69.1.1; extra == "dev"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: project-url
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# CAP-AnnData: Partial I/O for AnnData (.h5ad) Files

[![PyPI version](https://img.shields.io/pypi/v/cap-anndata)](https://pypi.org/project/cap-anndata/) [![Build Status](https://github.com/cellannotation/cap-anndata/actions/workflows/python-app.yml/badge.svg)](https://github.com/cellannotation/cap-anndata/actions)

## Overview
CAP-AnnData offering functionalities for selective reading and writing of [AnnData](https://pypi.org/project/anndata/) 
file fields without the need for loading entire dataset (or even entire field) into memory. 
For example, it allows to read and modify the single `obs` column taking nothing into memory except the column itself.
Package eager to replicate the original AnnData API as much as possible, 
while providing additional features for efficient data manipulation for heavy datasets.

## Installation
Install CAP-AnnData via pip:

```commandline
pip install -U cap-anndata
```

## Basic Example

The example below displayes how to read a single `obs` column, create new obs column and propagate it to the `.h5ad` file.
```python
from cap_anndata import read_h5ad

file_path = "your_data.h5ad"
with read_h5ad(file_path=file_path, edit=True) as cap_adata:
    print(cap_adata.obs_keys())  # ['a', 'b', 'c']
    print(cap_adata.obs) # Empty DataFrame
    cap_adata.read_obs(columns=['a'])
    print(cap_adata.obs.columns) # ['a']
    cap_adata.obs['new_col'] = cap_adata.obs['a']
    cap_adata.overwrite(fields=['obs'])
```

More example can be found in the [How-TO](https://github.com/cellannotation/cap-anndata/blob/main/HOWTO.md) file. 
