Metadata-Version: 2.4
Name: jentic-apitools-pipelines
Version: 1.0.0a17
Summary: Jentic Apitools Pipelines - Orchestrate score, repair, and storage into workflow pipelines
Author: Jentic
Author-email: Jentic <hello@jentic.com>
License-Expression: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Requires-Dist: pydantic>=2.7,<3.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: jsonschema>=4.20,<5.0
Requires-Dist: oas-patch>=0.6,<1.0
Requires-Dist: jentic-apitools-common~=1.0.0a17
Requires-Dist: jentic-apitools-llm~=1.0.0a17
Requires-Dist: jentic-apitools-analyze~=1.0.0a17
Requires-Dist: jentic-apitools-score~=1.0.0a17
Requires-Dist: jentic-apitools-storage~=1.0.0a17
Requires-Dist: jentic-openapi-transformer>=1.0.0a56
Requires-Dist: jentic-openapi-transformer-redocly>=1.0.0a56
Requires-Dist: datadog>=0.52.1
Requires-Python: >=3.11
Project-URL: Homepage, https://github.com/jentic/jentic-apitools
Description-Content-Type: text/markdown

# Jentic API Tools - Pipelines

High-level workflows that orchestrate analyze, score, repair, and storage operations for OpenAPI specifications.

## Key Features

The pipelines package provides three main workflow functions: `import_openapi` runs the full import pipeline (fetch, parse, validate, convert, bundle, repair, score, store), `score_openapi` runs a lighter scoring pipeline (fetch, parse, bundle, validate, score), and `improve_openapi` orchestrates the apply-overlays-and/or-replace-spec, score, and lay-out-per-run-snapshot flow used behind `/public-apis/improve` and the `jentic-apitools improve` CLI command. The first two accept an `OASJsonRequest` with processing configuration and an optional progress callback for real-time updates. By default, `import_openapi` rejects specs with invalid server URLs and invalid security definitions; these are controlled by `reject_invalid_server_urls` and `reject_invalid_security` in `OASProcessConfiguration`. The improve orchestrator depends on the `repair.overlay` backend to apply overlays and to verify the cumulative-overlays invariant, raising `CumulativeInvariantError` (with a structured diff) when applying `cumulative + per_run` overlays to the immutable bundled input does not reproduce the produced spec. The package handles format conversion from Swagger 2.0 and Google Discovery to OpenAPI 3.x, reference bundling via Redocly, and artifact management through configurable storage contexts. The `repo_tools` module provides `rebuild_scores_json` and `rebuild_apis_json` for rebuilding the root `scores.json` and `apis.json` catalog files from all API specs in a local repository clone.

## Dependencies

Internal: `common`, `llm`, `analyze`, `score`, `repair`, `storage`. External: jentic-openapi-transformer (with redocly), datadog. Note: `repair` is a hard dependency (used by both the import flow and the new improve orchestrator).

## Installation

```bash
pip install jentic-apitools-pipelines
```

## Quick Start

```python
from jentic.apitools.common.models import OASJsonRequest, OASRequestMeta, OASProcessConfiguration
from jentic.apitools.pipelines import score_openapi

request = OASJsonRequest(meta=OASRequestMeta(oas_process_configuration=OASProcessConfiguration()))
result = score_openapi(request, spec_url="https://petstore3.swagger.io/api/v3/openapi.json")
print(f"Success: {result.success}")
```

## Testing

```bash
pytest tests -v
```
