Skip to content

dusking/ldappy

Repository files navigation

ldappy

Build Status PypI

ldappy gives api to query LDAP server, without the need to know about LDAP. Supporting both Active Directory and Open LDAP servers.

Why are there two p's in ldappy and not only one? you may ask.. well.. it's because it's the Happy way to use ldap with python :)

ldappy uses pyldap for the communication with the LDAP server.

Installation

pip install ldappy

Or from source:

git clone git@github.com:dusking/ldappy.git
cd ldappy
make install

You may need to install the following packages

sudo apt-get install python-dev, python3-dev, libpython3-dev, libpython3.4-dev, libpython3.5-dev
python3.4 -m pip install pyldap
python3.5 -m pip install pyldap

Usage

Sample usage

ldappy = Ldappy(config)
all_users = ldappy.user_objects.all()
user = all_users[0]
print user.pretty_data()

You can see a full sample usage at samples/sample_usage.py or at the tests.

Info

There is User object and Group object. Each of them inherit from dict, so all the relevant data can be seen easly. BUT, since there are some different field name convenstions between the Open LDAP and Active Directory, there is the pretty_data methos, which return the same data, but with common name convenstion.. for example, full_name insttead of fn..

Testing

NOTE: Running the tests require an internet connection

NOTE: You may need to install some dependencies, as described above..

git clone git@github.com:dusking/ldappy.git
cd ldappy
pip install tox
tox

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published