Metadata-Version: 2.4
Name: code-review-validator
Version: 0.1.0
Summary: Python SDK for the Code Review Validator API
Author: Code Review Validator
License: MIT
Project-URL: Homepage, https://code-review-validator.fly.dev
Project-URL: Repository, https://gitlab.com/danielpwhite/code-review-validator
Project-URL: Documentation, https://gitlab.com/danielpwhite/code-review-validator/-/blob/master/sdk/python/README.md
Keywords: solidity,smart-contract,security,attestation,erc-8004,web3
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Security
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.27.0
Requires-Dist: pydantic>=2.0.0
Provides-Extra: crypto
Requires-Dist: eciespy>=0.4.0; extra == "crypto"
Requires-Dist: coincurve>=20.0.0; extra == "crypto"
Requires-Dist: web3>=7.6.0; extra == "crypto"
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: anyio>=4.0.0; extra == "dev"
Dynamic: license-file

# code-review-validator (Python SDK)

Python client for the Code Review Validator API.

## Install

```bash
pip install code-review-validator
# Optional crypto helpers
pip install "code-review-validator[crypto]"
```

## Development Install

```bash
pip install -e .
pip install -e ".[dev]"
# Optional crypto helpers while developing
pip install -e ".[dev,crypto]"
```

## Quickstart (async)

```python
from code_review_validator import AsyncClient

async def main() -> None:
    async with AsyncClient(api_key="your-key") as client:
        review = await client.review("contract C {}")
        print(review.score, review.evidence_level)
```

## Quickstart (sync)

```python
from code_review_validator import SyncClient

with SyncClient(api_key="your-key") as client:
    review = client.review("contract C {}")
    print(review.score, review.attestation_status)
```

## CI Gate

```python
from code_review_validator import GatePolicy, check_contract

policy = GatePolicy(min_score=80)
result = check_contract("contract C {}", api_key="your-key", policy=policy)
if not result.passed:
    raise SystemExit(1)
```

## Optional Crypto Helpers

```python
from code_review_validator import verify_response_hash, decrypt_findings

ok = verify_response_hash(ipfs_payload, on_chain_hash)
findings = decrypt_findings(ipfs_payload, private_key_hex)
```

## Manual Publish Fallback

```bash
pip install build twine
cd sdk/python
python -m build
TWINE_USERNAME=__token__ TWINE_PASSWORD="$PYPI_TOKEN" twine upload dist/*
```
