Metadata-Version: 1.1
Name: Represent
Version: 1.0
Summary: Create __repr__ automatically or declaratively.
Home-page: https://github.com/RazerM/represent
Author: Frazer McLean
Author-email: frazer@frazermclean.co.uk
License: MIT
Description: Represent
        ---------
        
        Installation
        ~~~~~~~~~~~~
        
        .. code:: bash
        
            $ pip install represent
        
        Automatic Generation
        ~~~~~~~~~~~~~~~~~~~~
        
        .. code:: python
        
            from represent import RepresentationMixin
        
        
            class Rectangle(RepresentationMixin, object):
                def __init__(self, name, color, width, height):
                    self.name = name
                    self.color = color
                    self.width = width
                    self.height = height
        
                    super(Rectangle, self).__init__()
        
            rect = Rectangle('Timothy', 'red', 15, 4.5)
            print(rect)
        
        ::
        
            Rectangle(name='Timothy', color='red', width=15, height=4.5)
        
        Declarative Generation
        ~~~~~~~~~~~~~~~~~~~~~~
        
        .. code:: python
        
            from represent import RepresentationHelper
        
        
            class ContrivedExample(object):
                def __init__(self, description, radians, shape, color, miles):
                    self.description = description
                    self.degrees = radians * 180 / 3.141592654
                    self.shape = shape
                    self._color = color
                    self.km = 1.60934 * miles
        
                def __repr__(self):
                    r = RepresentationHelper(self)
                    r.positional_from_attr('description')
                    r.positional_with_value(self.degrees * 3.141592654 / 180)
                    r.keyword_from_attr('shape')
                    r.keyword_from_attr('color', '_color')
                    r.keyword_with_value('miles', self.km / 1.60934)
                    return str(r)
        
            ce = ContrivedExample('does something', 0.345, 'square', 'red', 22)
            print(ce)
        
        ::
        
            ContrivedExample('does something', 0.345, shape='square', color='red', miles=22.0)
        
        For pretty printer support and more information, `visit the
        documentation <http://pythonhosted.org/Represent/>`__!
        
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
