Metadata-Version: 2.5
Name: pyimporters-obo
Version: 1.6.253
Summary: Sherpa OBO knowledge import plugin
Author-email: Olivier Terrier <olivier.terrier@kairntech.com>
License: Proprietary
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System Administrators
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.12
Requires-Dist: collections-extended
Requires-Dist: obonet
Requires-Dist: pyimporters-plugins<1.7.0,>=1.6.0
Provides-Extra: sbom
Requires-Dist: cyclonedx-bom; extra == 'sbom'
Requires-Dist: pip-audit; extra == 'sbom'
Provides-Extra: test
Requires-Dist: pip; extra == 'test'
Requires-Dist: pytest; extra == 'test'
Requires-Dist: ruff; extra == 'test'
Description-Content-Type: text/markdown

# pyimporters_obo

[![license](https://img.shields.io/badge/license-proprietary-red)](LICENSE)
[![version](https://img.shields.io/pypi/v/pyimporters-obo)](https://pypi.org/project/pyimporters-obo/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pyimporters-obo)](https://pypi.org/project/pyimporters-obo/)

Sherpa importer (`obo`) for ontologies in [OBO format](https://owlcollab.github.io/oboformat/doc/obo-syntax.html)
(Gene Ontology, Cellosaurus, ChEBI…). Each named, non-obsolete `[Term]` becomes a lexicon term: `id` → identifier,
`name` → preferred form, `synonym` → alternative forms, `namespace` (or the header's `default-namespace`) and the
first `xref: Wikidata:…` → properties.

| Option | Default | Effect |
|---|---|---|
| `synonym_scopes` | all | Comma-separated scopes to keep among `EXACT`, `BROAD`, `NARROW`, `RELATED`, case-insensitive. An unknown scope fails the import. |
| `namespaces` | all | Comma-separated namespaces of the terms to import. |

Synonyms without an xref list (`"x" EXACT`) or with escaped quotes (`"5\" end" EXACT []`) are read; an unparsable
synonym is skipped and logged. User documentation, with examples recorded by the tests:
[docs/sherpa/obo.en.md](docs/sherpa/obo.en.md) ([français](docs/sherpa/obo.fr.md)).

## Requirements

- Python 3.12+
- obonet for the parsing part.

## Installation

```
pip install pyimporters-obo
```

## Development

```
task py:test        # tests, which also record the help page examples
task py:help        # regenerate the generated blocks of docs/sherpa/*.md
task py:help-check  # fails if the help pages are out of date
```

## SBOM & vulnerability check

Install the SBOM dependencies:

```
uv sync --extra sbom
```

Generate a CycloneDX SBOM from the current environment:

```
uv run cyclonedx-py environment -o sbom.cdx.json --output-format json
```

Audit dependencies for known vulnerabilities:

```
uv run pip-audit --format json --output audit-report.json
```

To fail on any known vulnerability (useful in CI):

```
uv run pip-audit --strict
```
