Installation and configuration
===============================

Using ``easy_install``::

  $ easy_install afpy.ldap

Edit your ``~/.ldap.cfg``:

.. literalinclude:: ldap.cfg
   :language: ini

Add a ``myldap.py`` module to your  ``PYTHON_PATH``

.. literalinclude:: myldap.py
   :language: py

Try ``ldapsh`` script (see :doc:`shell`)::

  $ ldapsh -h
  Usage: ldapsh [options]

  Options:
    -h, --help            show this help message and exit
    -s SECTION, --section=SECTION
                          A config section to get ldap info from

  $ ldapsh -s myldap

You can now use the :class:`~afpy.ldap.connection.Connection` class in your own code:

.. sourcecode:: py

    >>> from afpy.ldap.connection import Connection
    >>> conn = Connection(section='myldap')

Enjoy !

