Metadata-Version: 2.4
Name: genomic-attribute-index
Version: 0.2.4
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Rust
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Summary: Python bindings for the deterministic Genomic Attribute Index
Author: GAI contributors
License: Apache-2.0
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

# `genomic-attribute-index` Python bindings

The `gai` package wraps the Rust Genomic Attribute Index compressor, builder, and indexed reader.
It provides BGZF compression with a CSI built in the same pass, deterministic GAI construction,
TBI/CSI-backed exact, prefix, contains, or regex attribute queries, structured records and metadata,
and typed exceptions for stale or corrupt inputs.

```python
from pathlib import Path
import gai

sorted_source = Path("annotations.sorted.gff3")
bgzf_source = Path("annotations.sorted.gff3.gz")
gai.compress(sorted_source, bgzf_source)  # writes annotations.sorted.gff3.gz.csi
csi = Path("annotations.sorted.gff3.gz.csi")
gai.build_index(bgzf_source, csi, Path("annotations.sorted.gff3.gz.gai"), ["Name"])
records = gai.query_index(
    bgzf_source, csi, Path("annotations.sorted.gff3.gz.gai"), "BRCA1"
)
prefix_records = gai.query_index(
    bgzf_source, csi, Path("annotations.sorted.gff3.gz.gai"), "BRCA", match="prefix"
)
contains_records = gai.query_index(
    bgzf_source, csi, Path("annotations.sorted.gff3.gz.gai"), "RCA", match="contains"
)
regex_records = gai.query_index(
    bgzf_source, csi, Path("annotations.sorted.gff3.gz.gai"), r"^BRCA[0-9]+$", match="regex"
)
```

See the repository README for the complete API and development instructions.

