BurnLedger Python SDK
Python client for the BurnLedger API — cryptographic deletion certificates for regulatory compliance.
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(id) |
list[WebhookDelivery] |
retry_delivery(webhook_id, delivery_id) |
None |
resolve_delivery(webhook_id, 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
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 burnledger-0.3.0.tar.gz.
File metadata
- Download URL: burnledger-0.3.0.tar.gz
- Upload date:
- Size: 52.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59e79b01bbb48677ba6a38424f8f1fb960c8c511617fa1783467d942c97ea355
|
|
| MD5 |
4a775167f9506bc3fb71f4fab0513337
|
|
| BLAKE2b-256 |
81b61899df2036f0ec794a5c59ad30fe60c24a102f887c887680787f5b6e1a84
|
Provenance
The following attestation bundles were made for burnledger-0.3.0.tar.gz:
Publisher:
publish-py.yml on fdflabs/burnledger
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
burnledger-0.3.0.tar.gz -
Subject digest:
59e79b01bbb48677ba6a38424f8f1fb960c8c511617fa1783467d942c97ea355 - Sigstore transparency entry: 2568805611
- Sigstore integration time:
-
Permalink:
fdflabs/burnledger@79672606477874b4d921371ebaeffa6dafce4d26 -
Branch / Tag:
refs/tags/py-v0.3.0 - Owner: https://github.com/fdflabs
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-py.yml@79672606477874b4d921371ebaeffa6dafce4d26 -
Trigger Event:
release
-
Statement type:
File details
Details for the file burnledger-0.3.0-py3-none-any.whl.
File metadata
- Download URL: burnledger-0.3.0-py3-none-any.whl
- Upload date:
- Size: 34.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a34ed613edbace1d873fae5de22dc024efec85e4a1ac99d230c94d32c153cfcf
|
|
| MD5 |
e8b46ee8b4d523e3a745336ff3526068
|
|
| BLAKE2b-256 |
df4107899ee49e4ae79a537155b7344861a743cd6ece094ee07aec1b2dfae4b0
|
Provenance
The following attestation bundles were made for burnledger-0.3.0-py3-none-any.whl:
Publisher:
publish-py.yml on fdflabs/burnledger
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
burnledger-0.3.0-py3-none-any.whl -
Subject digest:
a34ed613edbace1d873fae5de22dc024efec85e4a1ac99d230c94d32c153cfcf - Sigstore transparency entry: 2568805651
- Sigstore integration time:
-
Permalink:
fdflabs/burnledger@79672606477874b4d921371ebaeffa6dafce4d26 -
Branch / Tag:
refs/tags/py-v0.3.0 - Owner: https://github.com/fdflabs
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-py.yml@79672606477874b4d921371ebaeffa6dafce4d26 -
Trigger Event:
release
-
Statement type: