Introduction¶
metaframe is a MetaClass infrastructure to intercept instance
creation/initialization enabling modification of args/kwargs and instance.
Features:¶
MetaFramemetaclass to apply to any object - With embedded staticmethod with_metaclass to enable inheritanceMetaFrameBaseclass from which classes can inherit- 3 hooks (classmethods)
_new_pre: called before object creation_init_pre: called after object creation / before object initialization_init_post: called after object initialization
Installation¶
metaframe is self-contained with no external dependencies
From pypi:
pip install metaframe
From source:
- Place the metaframe directory found in the sources inside your project