semvec/pypi-packages huggingface dataset:
code-review-validator 0.1.0
Python SDK for the Code Review Validator API
License: MIT
Requires Python: >=3.11
Keywords: solidity, smart-contract, security, attestation, erc-8004, web3

# 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/*
```