Synchronizing Objects to YAML using Black Magic
summary
A small Python library called YORM maps object attributes to yaml files and performs automatic bidirectional sync with the filesystem; it serializes to a JSON-compatible YAML subset, coerces types on fetch/store, and sorts keys and expands lists for consistent diffs in version control. Implementation uses magic methods, runtime monkey‑patching and converters, runs on Python 3.3+, installs via pip, and is proven in three use cases: a submodule loader, Dropbox state sync, and game-state persistence that all work as described.
AI-written summary · about
chapters (23)
- 0:00Synchronizing Objects to YAML using Black Magic
- 3:36Configuration vs. Data
- 4:02Storage Requirements
- 4:30Alternatives Explored
- 5:38Code Requirements
- 6:34Class Decorator or Function
- 7:07Optimized Formatting
- 8:07Conversation on Load
- 9:01Type Inference
- 9:51Metaclass
- 10:59Monkey Patching: Method
- 11:38Monkey Patching: Class
- 12:24Data Model: Setting Attributes
- 15:10Subclass Lookup
- 16:34Update File from Object
- 16:50Update Object from File
- 17:21Builtin Types
- 17:31Container Types
- 17:47Nested Types
- 18:14Custom Types
- 19:08Loading Configuration
- 20:41Synchronizing State
- 21:28Persisting Data
related talks
39mYAML and YAMLScript
42mFrom YOLO to Pyproject.toml: The Saga of a Surviving Python Dev
47mWriting Python Codemods for Fun and Profit
16mBecause Your Infrastructure Deserves Real Code in Python, Not a YAML Soup
59mLightning Talks
23mPydantic Configuration Management with ConfZ
25mSPONSOR WORKSHOP / Paul Prescod / SalesForce
29mRCE via legacy dependency in Python
