This repository was archived by the owner on Oct 16, 2025. It is now read-only.

Description
Objectives for new design
The current design is ungainly in places, let's improve on it!
Old API
Problems:
- Long argument names
- url, encoding, timeout, custom_headers, and signing secret added to request/response by the decorator. What's a better way to do it?
>>> @webhook(sender_callable=targeted.sender, hash_function=uuid.uuid4)
>>> def basic(wife, husband, url, encoding, timeout, custom_headers, signing_secret):
>>> return {"husband": husband, "wife": wife}
New API
Objectives:
- Shorten argument names for ease of use
- Add a recorder decorator argument so implementors can save results to logs, db, or whatever they way
- TODO Try to find a better way to add url, encoding, timeout, custom_headers, and signing_secret to requests
>>> import uuid
>>> from webhook import webhook
>>> from mystff import sender_func, save_to_db
>>>
>>> @webhook(sender=sender_func, hasher=uuid.uuid4, recorder=save_to_db)
>>> async def basic(wife, husband, url, encoding, timeout, custom_headers, signing_secret):
>>> # I'm not happy with how arguments are managed right now, still thinking about it
>>> return {"husband": husband, "wife": wife}
>>> await basic(...args here)