python packages

You start with some code ... which becomes a class .. and now you want to make it a package. A joke gets inplements as the funniest package

def joke():
    return (u'Wenn ist das Nunst\u00fcck git und Slotermeyer? Ja! ... '
            u'Beiherhund das Oder die Flipperwaldt gersput.')

so that is and I have put this into __init__.py

class funniest(object):

  def __init__(self):
     self.something=1

  def joke():
    return (u'Wenn ist das Nunst\u00fcck git und Slotermeyer? Ja! ... '
            u'Beiherhund das Oder die Flipperwaldt gersput.')

Directory Structure looks like this

funniest/
    funniest/
        __init__.py
    setup.py

The top "funniest" is my git layer... then the package is the 2nd "funniest" directory

Building a Setup file

this is the basic format

from distutils.core import setup
setup(name='email_search',
      version='1.0',
      packages=['funniest'],
      author='Tim',
      author_email='tim@bla.bla.com',
      description=('email search for dummies'))

To Test this works - do the following

 python setup sdist

This wraps the code into a gz file in the dist folder - you can unpack and view this to make sure all your files got included.

If this looks ok - then you can install the package