Introduction¶
metaframe
is a MetaClass infrastructure to intercept instance
creation/initialization enabling modification of args/kwargs and instance.
Features:¶
MetaFrame
metaclass to apply to any object - With embedded staticmethod with_metaclass to enable inheritanceMetaFrameBase
class from which classes can inherit- 3 hooks (classmethods)
_new_pre
: called before object creation_new_do
: called for object creation_init_pre
: called after object creation / before object initialization_init_do
: called fo 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