The goal of this project is to develop skills around serializing Python classes to and from both SQL and JSON.
Codebase here: https://github.com/jed-gore/serlialized_python_objects/blob/main/README.md
Reference:
https://marshmallow-sqlalchemy.readthedocs.io/en/latest/
User Story:
AS A financial analyst
I WANT TO map my companies across various things like KPIS and SECTORS
SO THAT I can visualize mappings easily in an app with JSON (and share with Javascript front end apps) but also maintain a second form database structure on the back end in SQL
This project uses flask and marshmallow along with sqlalchemy as an ORM.
The example.py uses a combination of sqlalchemy’s Model class inheritance and Marshmallow auto schema for serialization.
Run setup.py to initialize the SQLite database.
Credit Anthony @ Pretty Printed – I updated his code for the new version of Marshmallow: https://www.youtube.com/watch?v=kRNXKzfYrPU