title: Python property factory or descriptor class for wrapping an external library
body: <p>I am writing a Python wrapper class for a C# API accessed through Pythonnet.
  As I want to extend the API with my own methods I decided to wrap it using the composition approach outlined <a href="http://ginstrom.com/scribbles/2009/03/27/the-adapter-pattern-in-python/" rel="noreferrer">here</a>:</p>
  <p>The C# API makes heavy use of properties which I want to mimic in my Python code. The following minimal example shows my current approach for the example of the C# Surface class with the two properties width and height:</p>
  <pre><code>class MySurface:
      def __init__(api_surface):
          self.api_surface = api_surface
      
      @property
      def width(self):
          return self.api_surface.width
  
      @width.setter
      def width(self, value):
          self.api_surface.width = value
  
      @property
      def height(self):
          return self.api_surface.height
  
      @height.setter
      def height(self, value):
          self.api_surface.height = value
  </code></pre>
  <p>In total, I have to deal with about 50 properties. For several groups of properties I want to add my own error checks, type conversions, etc.
  What I am looking for is a Pythonic way of defining the properties, e.g. through a factory or using descriptors. Thanks for your help!</p>
  <p>Edit: I want to be able to use tab completion within a python shell, i.e. surface. {hit tab} should propose surface.width and surface.height. This does not seem to be possible with the <strong>getattr</strong> approach outlined by Greg.</p>