Metadata-Version: 2.4
Name: contract-attestation
Version: 0.2.0
Summary: Python SDK for on-chain smart contract attestation (ERC-8004)
Author: Contract Attestation
License-Expression: 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: 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

# contract-attestation (Python SDK)

Python client for the Contract Attestation API — on-chain security attestation for smart contracts (ERC-8004).

## Install

```bash
pip install contract-attestation
# Optional crypto helpers
pip install "contract-attestation[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 contract_attestation 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 contract_attestation 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 contract_attestation 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 contract_attestation 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/*
```
