You can iterate the columns and relations of a SqlAlchemy model / table. Search terms like "iterate sqlachemy model columns" and you'll see many examples. Some advanced items may require the inspect feature (
https://docs.sqlalchemy.org/en/13/core/inspection.html)
In terms of implementing it, you could make an external function that reads your model package... or make a mixin class that offers a method for generating it, and just inherit from that. I do the latter for creating json 'fingerprints' of a model that seem similar to what the avro schema format looks like.