Skip to main content

MetaClass supporting fine grained control of object creationand initialization

Project description

metaframe

PyPi Version PyPi Monthly Donwloads License Travis-ci Build Status Documentation Status Pytghon versions

MetaClass infrastructure to intercept instance creation/initialization enabling modification of args/kwargs and instance.

Documentation

Read the full documentation at readthedocs.org:

Python 2/3 Support

  • Python 2.7

  • Python 3.2/3.3/3.4/3.5

  • It also works with pypy and pypy3

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

Features:

  • MetaFrame metaclass to apply to any object - With embedded staticmethod with_metaclass to enable inheritance

  • MetaFrameBase class 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

metaframe-1.0.0.zip (8.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page