@banjofox @Gargron ActivityPub (well ActivityStream entities in general) do not lend themselves to either object or relational mapping (and ORM is right out lol).
In my futzing around with AS in Python I have just stored such entities in a PostgreSQL table inside an indexed jsonb field rather than create a full on schema for the various entities so far.
As for the Python side I'm playing with some non-OO approaches. I gotta put that out there in my git repo some time soon.