Skip to main content

Python SDK for the Code Review Validator API

Project description

code-review-validator (Python SDK)

Python client for the Code Review Validator API.

Install

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

Development Install

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

Quickstart (async)

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)

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

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

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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

code_review_validator-0.1.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

code_review_validator-0.1.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file code_review_validator-0.1.0.tar.gz.

File metadata

  • Download URL: code_review_validator-0.1.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for code_review_validator-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bae8c82eb0f57317b1c966da8f6ff05455db9ff72fd91d5dadb66f90839e530f
MD5 a744dc9f87165d2e3ed22ce212f12281
BLAKE2b-256 0b25868d7cf11040f6d99593b98bf194637cf6830885bc77cf15ed4ad8928fc4

See more details on using hashes here.

File details

Details for the file code_review_validator-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for code_review_validator-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3557c948267c9dc795066cc07dfc1573326d8feccb269d2e06a1a38accb5d639
MD5 2a330b2015f1081566a28553bd403966
BLAKE2b-256 896ccaf8941a38d2f2fd621bd7213a78fa4738a5f23e93de74833bf55dab85ed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page