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 credentialverify_credential()- Verify a credential with compliance scoringrevoke_credential()- Revoke a credentialget_credential_status()- Check on-chain attestation statusget_credential()- Look up credential by IDlist_credentials()- List credentials by subject DID
Verification
verify_presentation()- Verify a W3C Verifiable Presentation
Issuers
get_issuer()- Get issuer detailslist_issuers()- List registered issuerscheck_issuer_can_issue()- Check credential type authorization
Disputes
file_dispute()- File a dispute against a credentialget_dispute()- Get dispute detailslist_disputes()- List disputes
Reputation
get_reputation()- Get issuer reputation scoresubmit_feedback()- Submit verifier feedback
Webhooks
register_webhook()- Register a webhook endpointlist_webhooks()- List registered webhooksdelete_webhook()- Remove a webhook
Billing
get_subscription()- Get current planget_usage()- Get usage and remaining quotasubscribe()- Change billing planget_billing_portal_url()- Self-service billing management
Keys
rotate_key()- Rotate signing key for a DIDlist_key_versions()- List key version history
License
MIT
Project details
Release history Release notifications | RSS feed
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea64163f19429f7571f4b350536054861abf90d431cda917e6b6065acce48867
|
|
| MD5 |
f709b580d51a75a439a587410b7bb13c
|
|
| BLAKE2b-256 |
e3716f57a586f4ce70db3ecfb5921483ee63979f39e89f0ea906a409a6bb36a4
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83a557a095c7256fff800379132e4549b1fc7b36f8c3b350b255a5d4f43335e8
|
|
| MD5 |
c931b492d2151f6137acf1bfc581fcd8
|
|
| BLAKE2b-256 |
f6c65e4dec4dcc805e8ba59a1a1a03a20404c0d7c7d9b012a93e2b8346a09bfb
|