Skip to main content

Python SDK for the VERCRE Verifiable Credentials API

Project description

vercre-sdk

Python SDK for the VERCRE Verifiable Credentials API.

Installation

pip install vercre-sdk

Quick Start

from vercre_sdk import VercreClient

client = VercreClient(
    api_key="vercre_admin_your_key_here",
    base_url="https://api.vercre.io",
)

# Issue a credential
credential = client.issue_credential(
    issuer_did="did:key:z6Mk...",
    subject_did="did:key:z6Mp...",
    credential_type="KYCBasic",
    claims={"name": "Alice Johnson", "country": "US"},
)
print(f"Issued: {credential.credential_id}")

# Verify a credential
result = client.verify_credential(credential=credential.credential)
print(f"Valid: {result.valid}, Decision: {result.compliance_decision}")

Async Usage

import asyncio
from vercre_sdk import AsyncVercreClient

async def main():
    async with AsyncVercreClient(api_key="vercre_admin_xxx") as client:
        result = await client.verify_credential(credential=my_credential)
        print(result.compliance_decision)

asyncio.run(main())

Error Handling

from vercre_sdk import VercreClient, RateLimitError, AuthenticationError

client = VercreClient(api_key="...")

try:
    result = client.verify_credential(credential=cred)
except RateLimitError as e:
    print(f"Rate limited. Retry after {e.retry_after}s")
except AuthenticationError:
    print("Invalid API key")

Available Methods

Credentials

  • issue_credential() - Issue a new verifiable credential
  • verify_credential() - Verify a credential with compliance scoring
  • revoke_credential() - Revoke a credential
  • get_credential_status() - Check on-chain attestation status
  • get_credential() - Look up credential by ID
  • list_credentials() - List credentials by subject DID

Verification

  • verify_presentation() - Verify a W3C Verifiable Presentation

Issuers

  • get_issuer() - Get issuer details
  • list_issuers() - List registered issuers
  • check_issuer_can_issue() - Check credential type authorization

Disputes

  • file_dispute() - File a dispute against a credential
  • get_dispute() - Get dispute details
  • list_disputes() - List disputes

Reputation

  • get_reputation() - Get issuer reputation score
  • submit_feedback() - Submit verifier feedback

Webhooks

  • register_webhook() - Register a webhook endpoint
  • list_webhooks() - List registered webhooks
  • delete_webhook() - Remove a webhook

Billing

  • get_subscription() - Get current plan
  • get_usage() - Get usage and remaining quota
  • subscribe() - Change billing plan
  • get_billing_portal_url() - Self-service billing management

Keys

  • rotate_key() - Rotate signing key for a DID
  • list_key_versions() - List key version history

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

vercre_sdk-1.0.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

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

vercre_sdk-1.0.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file vercre_sdk-1.0.0.tar.gz.

File metadata

  • Download URL: vercre_sdk-1.0.0.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for vercre_sdk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ea64163f19429f7571f4b350536054861abf90d431cda917e6b6065acce48867
MD5 f709b580d51a75a439a587410b7bb13c
BLAKE2b-256 e3716f57a586f4ce70db3ecfb5921483ee63979f39e89f0ea906a409a6bb36a4

See more details on using hashes here.

File details

Details for the file vercre_sdk-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: vercre_sdk-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for vercre_sdk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 83a557a095c7256fff800379132e4549b1fc7b36f8c3b350b255a5d4f43335e8
MD5 c931b492d2151f6137acf1bfc581fcd8
BLAKE2b-256 f6c65e4dec4dcc805e8ba59a1a1a03a20404c0d7c7d9b012a93e2b8346a09bfb

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