The `__magic__` of the Python Model for Magic™ data
summary
Shows how the Python data model and dunders turn messy Scryfall JSON into typed abstractions: namedtuples, enums and dataclasses that implement __getitem__ and __len__ to act like a container. Builds a PyTorch-compatible PyTorch Dataset that lazily downloads card images, returns (image, set_code) or a transformed tensor, and lets the label swap to artist or set via a label property swap. Demo runs in PyScript but the live fetch times out.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 1:48Data vs Object Standard Programming
- 3:52Object Data Model
- 6:33Magic Methods
- 13:02What is Magic
- 13:57Data of Magic
- 14:47Scrapple
- 20:54Machine Learning
- 23:19Pi Script
related talks
25mThe Magic of Python
31mPython Data Model
30mThe Wizardry of Metaprogramming
29mDatabase Sorcery 101 Ditch the Ancient SQL Scrolls for SQLModel
21mLet JSON Schema and Pydantic write your data models
01h 10mIt's Pythons All The Way Down: Python Types & Metaclasses Made Simple
26mThe Magic of Self: How Python Inserts self Into Methods
26mThe Magic of Self How Python inserts self into methods
