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.
![image](https://user-images.githubusercontent.com/39496491/222187293-2ac82371-ec90-40ca-807e-20cd15746bbf.png)
The example.py uses a combination of sqlalchemy’s Model class inheritance and Marshmallow auto schema for serialization.
![image](https://user-images.githubusercontent.com/39496491/222187629-3cfd8593-057e-4090-a89e-56e28a4974de.png)
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