Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WWSrapport Python client

Official Python SDK for the WWSrapport API.

Official Links

Official clients:

pip install wwsrapport
from wwsrapport import ReportResponse, WwsrapportClient

client = WwsrapportClient(api_key="wwsr_live_...")

report: ReportResponse = client.reports.create(
    {
        "address": {
            "postcode": "3905RB",
            "house_number": "4",
            "city": "Veenendaal",
        },
        "customer_reference": "demo-001",
    },
    idempotency_key="demo-001",
)

print(report["id"], report["status"])

Type hints

The package exports TypedDict definitions for the public API contract, including property prefill, reports, calculations, improvement advice, documents, usage, rulesets, webhooks, and webhook delivery attempts.

The runtime response remains the normal Python dict returned by the API, while editors and type checkers can use the exported types for safer integrations.

Webhooks

from wwsrapport import parse_webhook_event, verify_webhook_signature

raw_body = request.get_data(as_text=True)

if not verify_webhook_signature(raw_body, request.headers, "whsec_..."):
    raise ValueError("Invalid WWSrapport webhook signature")

event = parse_webhook_event(raw_body)
print(event["type"], event["data"])

The verifier expects:

  • WWS-Webhook-Timestamp
  • WWS-Webhook-Signature

The signature format is v1=<hex-hmac-sha256>, signed over:

{timestamp}.{raw_body}

Development

python -m pip install -e ".[dev]"
python -m unittest discover -s tests

About

Official Python client for the WWSrapport API, including report creation, downloads, JSON results, and webhook verification.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages