Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pywaltid

PyPI Python License: MIT Typing: typed

Async Python SDK for the Walt.id Community Stack Wallet, Issuer, and Verifier APIs.

The package is distributed as pywaltid and imported as waltid.

Install

uv add pywaltid

Or with pip:

pip install pywaltid

Quick Start

import asyncio

from waltid import CredentialIssuer, EnterpriseAgentCredential, IssuerAPI, WalletAPI


async def main() -> None:
    async with WalletAPI() as wallet, IssuerAPI() as issuer:
        holder_did = await wallet.create_did()

        claims = EnterpriseAgentCredential(
            org_id="org-a",
            org_name="Org A",
            org_did="did:key:org-a",
            agent_id="agent-1",
            agent_did=holder_did,
            spending_limit=100_000,
        )

        credential_id = await CredentialIssuer(
            issuer=issuer,
            wallet=wallet,
        ).issue(holder_did=holder_did, claims=claims)

        print("Holder DID:", holder_did)
        print("Credential ID:", credential_id)


asyncio.run(main())

Run the example against mocked SDK responses:

WALTID_MOCK=true python example.py

For real HTTP calls, run the Walt.id Community Stack APIs and keep the default local ports:

Service Default URL
Wallet API http://localhost:7001
Issuer API http://localhost:7002
Verifier API http://localhost:7003

Configuration

Settings are read from environment variables with the WALTID_ prefix.

Variable Default
WALTID_WALLET_URL http://localhost:7001
WALTID_ISSUER_URL http://localhost:7002
WALTID_VERIFIER_URL http://localhost:7003
WALTID_ISSUER_CREDENTIAL_ISSUER_URL http://waltid-issuer:7002/openid4vci
WALTID_VERIFIER_SESSION_URL http://waltid-verifier:7003/verification-session
WALTID_TIMEOUT 30.0
WALTID_MAX_RETRIES 3
WALTID_MOCK false

API Surface

Low-level async adapters:

  • WalletAPI for DID creation, credential import, credential offer receipt, and VP signing.
  • IssuerAPI for OID4VCI credential offers.
  • VerifierAPI for OID4VP session creation and result polling.

High-level facades:

  • CredentialIssuer issues an EnterpriseAgentCredential to a wallet-held DID.
  • PresentationVerifier creates OID4VP challenges, asks a wallet to present, and verifies results.

Development

uv sync
uv run ruff check .
uv run python -m build
uv run twine check dist/*

Publish a release:

uv publish

Links

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages