Metadata-Version: 2.5
Name: disputeguard
Version: 0.1.0
Summary: Checks whether a chargeback dispute-evidence bundle satisfies Visa's reason-code evidence requirements, before you submit it.
Author: Jay
License: MIT
License-File: LICENSE
Keywords: chargeback,dispute-resolution,fintech,llm,payments
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Office/Business :: Financial
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.30; extra == 'anthropic'
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Provides-Extra: openai
Requires-Dist: openai>=1.0; extra == 'openai'
Description-Content-Type: text/markdown

# disputeguard

Checks whether a chargeback dispute-evidence bundle actually satisfies
Visa's reason-code-specific evidence requirements — **before** you submit
it. Representment windows are days, not weeks, and a weak submission
auto-loses; this catches the gaps while there's still time to fix them.

No open-source tool does this today — the space is dominated by paid
platforms (Stripe Smart Disputes, Chargeflow, Lorikeet).

## Quick start — no API key needed

```bash
pip install disputeguard
disputeguard check examples/sample_evidence.json --reason-code 10.4 --deadline 2099-01-01
```

That runs in **rules-only mode**: it checks that every required piece of
evidence is present and the deadline hasn't passed — no LLM, no signup,
instant result.

## With AI-judged evidence quality

Rules-only mode can tell you a field is empty. It can't tell you whether
the *content* of a customer email actually proves delivery. For that, add
a provider:

```python
from disputeguard import check_evidence
from disputeguard.providers.anthropic_provider import AnthropicProvider

report = check_evidence(
    reason_code="10.4",
    deadline="2026-08-25",
    evidence={
        "avs_match": "AVS check returned Y/Y full match.",
        "cvv_match": "CVV verified at time of sale.",
        "customer_history": "3 prior completed orders, same address.",
    },
    provider=AnthropicProvider(),  # or OpenAIProvider(), or OllamaProvider() for a free local model
)

print(report.verdict)        # "ready" | "weak" | "missing-required"
print(report.score)          # 0-100
print(report.action_items)   # ["Strengthen evidence for '...' — ...", ...]
```

No paid API? Use `OllamaProvider()` with a local model — same interface,
zero cost.

## Async

```python
from disputeguard import acheck_evidence
report = await acheck_evidence(reason_code="10.4", deadline="2026-08-25", evidence={...})
```

## v0.1 scope

- Visa only, 6 reason codes: `10.4`, `13.1`, `13.3`, `13.6`, `12.6.1`, `13.7`.
- Not in scope yet: Mastercard/Amex/Discover, auto-drafting the rebuttal
  letter, direct submission to Visa.

See [DETAILS.md](DETAILS.md) for the full design, and
[docs/USAGE.md](docs/USAGE.md) for the complete API/CLI reference.

## Integration examples

See [examples/](examples/) for FastAPI and Django webhook handlers.

## License

MIT
