Skip to main content

BurnLedger Python SDK

Python client for the BurnLedger API — cryptographic deletion certificates for regulatory compliance.

Scope

The SDK covers the data plane: systems, attestations, certificates, webhooks, API keys, /v1/me, and the transparency log — everything involved in measuring a datastore and verifying what came back.

Account management (teams, TOTP enrolment, subscriptions, invoices, the audit log, billing) is deliberately not part of the SDK. Those are administrative actions people take once, in the dashboard at https://dashboard.burnledger.io, and they are available on the raw /v1 API for anyone who needs to automate them.

Install

pip install burnledger

Requirements: Python 3.10+

Quick Start

from burnledger import BurnLedger

with BurnLedger(api_key="dp_...") as dp:
    # 1. Attest — snapshot systems before deletion
    att = dp.attest("user@example.com", system_ids=["sys_abc", "sys_def"])

    # 2. Delete data (your code, your tools)

    # 3. Verify — confirm deletion and get certificate
    result = dp.verify(att.id, "user@example.com", timeout=60)

    # 4. Download certificate PDF
    dp.save_pdf(result.certificate.id, "./deletion-cert.pdf")

Async

from burnledger import AsyncBurnLedger

async with AsyncBurnLedger(api_key="dp_...") as dp:
    att = await dp.attest("user@example.com", system_ids=["sys_abc"])
    result = await dp.verify(att.id, "user@example.com", timeout=60)

Offline Verification

Verify certificates without network access using Ed25519 signatures:

from burnledger import verify_certificate, verify_transparency, PublicKeyInfo

key = PublicKeyInfo.from_hex("abcdef...", revoked=False)
keys = {key.key_id: key}

cert_result = verify_certificate(certificate, keys)
# VerificationResult.VALID or raises VerificationError

log_result = verify_transparency(certificate, keys)
# TransparencyResult.INCLUDED or raises VerificationError

Webhook Verification

Verify incoming webhook signatures (HMAC-SHA256):

from burnledger import verify_webhook_signature

valid = verify_webhook_signature(
    secret=webhook_secret,         # from dp.register_webhook()
    body=request.body,             # raw request body
    signature=request.headers["X-BurnLedger-Signature"],
)

API Reference

Client

BurnLedger(
    api_key: str,
    *,
    base_url: str = "https://api.burnledger.io",
    timeout: float = 30.0,
    max_retries: int = 2,
)

Systems

Method Returns
register_system(**opts) System
get_system(id) System
list_systems(limit=25) SyncPaginator[System]
deregister_system(id) None
health_check(id) System

Attestations

Method Returns
attest(subject, **opts) Attestation
batch_attest(subjects, **opts) BatchAttestationResponse
get_attestation(id) Attestation
wait_for(id, **opts) Attestation
verify(id, subject, **opts) VerifyResult

Certificates

Method Returns
get_certificate(id) CertificateResponse
list_certificates(limit=25) SyncPaginator[CertificateResponse]
get_certificate_stats() CertificateStats
export_certificates(**opts) bytes
download_pdf(id) bytes
save_pdf(id, path) None
get_revocation_status(id) RevocationStatus
revoke_certificate(id, reason=...) CertificateResponse

Webhooks

Method Returns
register_webhook(url=...) Webhook
list_webhooks(limit=25) SyncPaginator[Webhook]
delete_webhook(id) None
rotate_webhook_secret(id) WebhookRotateResponse
commit_webhook_rotation(id) None
list_failed_deliveries(limit=25) SyncPaginator[FailedDelivery]
retry_delivery(delivery_id) None
resolve_delivery(delivery_id) None

API Keys

Method Returns
list_api_keys() list[ApiKeyListItem]
create_api_key() ApiKeyResponse
revoke_api_key(id) None

Transparency Log

These methods do not require authentication.

Method Returns
get_log_head() SignedTreeHead
get_log_entry(index) LogEntry
get_log_entries(start, end) list[LogEntry]
get_inclusion_proof(index, tree_size) InclusionProof
get_consistency_proof(old_size, new_size) ConsistencyProof

Pagination

All list_* methods return a paginator that auto-fetches pages:

for cert in dp.list_certificates():
    print(cert.id)

# async
async for cert in dp.list_certificates():
    print(cert.id)

License

MIT

Download files

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

Source Distribution

burnledger-0.5.0.tar.gz (77.2 kB view details)

Uploaded Source

Built Distribution

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

burnledger-0.5.0-py3-none-any.whl (46.2 kB view details)

Uploaded Python 3

File details

Details for the file burnledger-0.5.0.tar.gz.

File metadata

  • Download URL: burnledger-0.5.0.tar.gz
  • Upload date:
  • Size: 77.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.12.14

File hashes

Hashes for burnledger-0.5.0.tar.gz
Algorithm Hash digest
SHA256 c51604e3da5d04a7df4f2c0f87e1000f5bbdb9f89573ff5de7dcf7d55e899df0
MD5 5b7367fe62cc3ca321105855acef2113
BLAKE2b-256 7896908e7d91ec2e561a6cf32d3e5be3f9d9b060f97a29bcbd42c4c4c78b9a41

See more details on using hashes here.

File details

Details for the file burnledger-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: burnledger-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 46.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.12.14

File hashes

Hashes for burnledger-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ece215e7ee06d355b3f1357710228baf77c005cf858ab47290317993bcb1584
MD5 bb7f0bd907125aedfe8d39e610d0de64
BLAKE2b-256 5320f82ef32cf4a49491557d7d255058742d65f4bdaa6aa95c825e9d3eb28f77

See more details on using hashes here.

Release history Release notifications | RSS feed

0.8.0

2 files

0.7.0

2 files

0.6.1

2 files

0.6.0

2 files

This release

0.5.0 This release

2 files

0.4.0

2 files

0.3.0

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page