@helge @soapdog I agree. I spent a couple of weeks reading the source code of a dozen different AP implementations and couldn't find one big lib that I could port or extract for my purposes. They were all either too tightly integrated with their host app or utterly incomprehensible.
However I did manage to make use of the signature parsing and generating code from Takahe which took care of the hardest part.
https://github.com/jointakahe/takahe/blob/main/core/signatures.py