Skip to main content

Python client for the AgentScore trust and reputation API

Project description

agentscore-py

PyPI version License: MIT

Python client for the AgentScore trust and reputation API.

Install

pip install agentscore-py

Quick Start

from agentscore import AgentScore

client = AgentScore(api_key="as_live_...")

# Look up cached reputation (free)
rep = client.get_reputation("0x1234...")
print(rep["score"]["value"], rep["score"]["grade"])

# Filter to a specific chain
base_rep = client.get_reputation("0x1234...", chain="base")

# On-the-fly assessment with policy (paid)
result = client.assess("0x1234...", policy={"min_grade": "B", "min_score": 35})
print(result["decision"], result["decision_reasons"])

# Compliance assessment with verification policy
gated = client.assess("0x1234...", policy={
    "require_kyc": True,
    "require_sanctions_clear": True,
    "min_age": 21,
})

if gated["decision"] == "deny":
    print(gated["decision_reasons"])  # ["kyc_required"]
    print(gated.get("verify_url"))    # URL for operator verification

# Check verification level
rep = client.get_reputation("0x1234...")
print(rep.get("verification_level"))  # "none" | "wallet_claimed" | "kyc_verified"

Async

async with AgentScore(api_key="as_live_...") as client:
    rep = await client.aget_reputation("0x1234...")
    result = await client.aassess("0x1234...", policy={"min_grade": "B"})

Context Manager

with AgentScore(api_key="as_live_...") as client:
    rep = client.get_reputation("0x1234...")

Configuration

Parameter Default Description
api_key None API key from agentscore.sh
base_url https://api.agentscore.sh API base URL
timeout 10.0 Request timeout (seconds)

Error Handling

from agentscore import AgentScore, AgentScoreError

try:
    rep = client.get_reputation("0xinvalid")
except AgentScoreError as e:
    print(e.code, e.status_code, str(e))

Documentation

License

MIT

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

agentscore_py-1.4.2.tar.gz (48.9 kB view details)

Uploaded Source

Built Distribution

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

agentscore_py-1.4.2-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file agentscore_py-1.4.2.tar.gz.

File metadata

  • Download URL: agentscore_py-1.4.2.tar.gz
  • Upload date:
  • Size: 48.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for agentscore_py-1.4.2.tar.gz
Algorithm Hash digest
SHA256 e0688ca6a256638c77638be9fd03a49d18e05fb7633392840855c71b3098f01d
MD5 8167ecce7aec2d7970171b93712717e0
BLAKE2b-256 bfad41e6c7772ab4b3dea33aa2154f9e367af685db4338c9bcef85a9f68eab66

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentscore_py-1.4.2.tar.gz:

Publisher: publish.yml on agentscore/python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agentscore_py-1.4.2-py3-none-any.whl.

File metadata

  • Download URL: agentscore_py-1.4.2-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for agentscore_py-1.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bbff04b57eb243884677a648e4f964e95823e5dae2d0bf268388017e285623bc
MD5 b72345d6d01e0d76ba630be4c069a31a
BLAKE2b-256 ec9a93284316a8dbcd4f1da8ffff54135b526eb3b49df7906078914e05e98763

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentscore_py-1.4.2-py3-none-any.whl:

Publisher: publish.yml on agentscore/python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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