Metadata-Version: 2.4
Name: arglib
Version: 0.1.3
Summary: Build a general-purpose, batteries-included Python library for creating, importing, analyzing, and reasoning over argument graphs derived from text and multimodal evidence.
License-Expression: MIT
Project-URL: Repository, https://github.com/vasanthsarathy/arglib
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# ArgLib

[![PyPI](https://img.shields.io/pypi/v/arglib)](https://pypi.org/project/arglib/)
[![Python](https://img.shields.io/pypi/pyversions/arglib)](https://pypi.org/project/arglib/)
[![CI](https://github.com/vasanthsarathy/arglib/actions/workflows/ci.yml/badge.svg)](https://github.com/vasanthsarathy/arglib/actions/workflows/ci.yml)
[![Docs](https://github.com/vasanthsarathy/arglib/actions/workflows/docs.yml/badge.svg)](https://vasanthsarathy.github.io/arglib/)
[![License](https://img.shields.io/github/license/vasanthsarathy/arglib)](LICENSE)

ArgLib is a batteries-included Python library for creating, importing, analyzing, and reasoning over argument graphs derived from text and multimodal evidence.

## Highlights
- Canonical `ArgumentGraph` model with provenance-aware nodes and relations.
- Dung semantics (grounded/preferred/stable/complete) and basic ABA tooling.
- Diagnostics for cycles, components, reachability, and degree stats.
- JSON IO with schema validation and Graphviz DOT export.
- CLI tools for DOT, diagnostics, validation, and ABA.
- Argument bundles for higher-level reasoning and credibility propagation scoring.
- Evidence cards and supporting documents for evidence pipelines.
- Deterministic evidence scoring and edge validation helpers (LLM adapters planned).

## Install
```bash
python -m pip install arglib
```

## Quickstart
```python
from arglib.core import ArgumentGraph
from arglib.reasoning import Reasoner

graph = ArgumentGraph.new(title="Parks")
c1 = graph.add_claim("Green spaces reduce urban heat.", type="fact")
c2 = graph.add_claim("Cities should fund parks.", type="policy")
graph.add_support(c1, c2, rationale="Cooling improves health")

reasoner = Reasoner(graph)
results = reasoner.run(["grounded_extension", "grounded_labeling"])
```

## Evidence and scoring
```python
from arglib.ai import score_evidence, validate_edges

scores = score_evidence(graph)
edge_report = validate_edges(graph)
```

## Bundles and credibility propagation
```python
from arglib.reasoning import compute_credibility

bundle = graph.define_argument([c1, c2], bundle_id="arg-1")
cred = compute_credibility(graph)
```

## CLI examples
```bash
arglib dot path/to/graph.json
arglib diagnostics path/to/graph.json --validate
arglib validate path/to/graph.json
arglib aba path/to/aba.json --semantics preferred
```

## Development
This repo uses `uv` for dependency management.
```bash
uv sync
scripts/check.sh
```

## Documentation
Full docs and guides are available at https://vasanthsarathy.github.io/arglib/.
