Skip to main content

Module for Python 3 to access LDAP directory servers.

Project description

PyPI Version Build Status Coverage Status Documentation Status GitHub License

This is a module for handling LDAP operations in Python. Uses libldap2 on Unix platforms and WinLDAP on Microsoft Windows. LDAP entries are mapped to a special Python case-insensitive dictionary, tracking the changes of the dictionary to modify the entry on the server easily.

Supports only Python 3.3 or newer, and LDAPv3.

Requirements for building

  • python3.3-dev or newer

  • libldap2-dev

  • libsasl2-dev

  • libkrb5-dev or heimdal-dev (optional)

Features

  • Uses LDAP libraries (OpenLDAP and WinLDAP) written in C for faster processing.

  • Simple pythonic design.

  • Implements an own dictionary-like object for mapping LDAP entries that makes easier to add and modify them.

  • Works with various asynchronous library (like asyncio, gevent).

Documentation

Documentation is available online with a simple tutorial.

Example

Simple search and modify:

import bonsai

client = bonsai.LDAPClient("ldap://localhost")
client.set_credentials("SIMPLE", ("cn=admin,dc=bonsai,dc=test", "secret"))
with client.connect() as conn:
    res = conn.search("ou=nerdherd,dc=bonsai,dc=test", 2, "(cn=chuck)")
    res[0]['givenname'] = "Charles"
    res[0]['sn'] = "Carmichael"
    res[0].modify()

Using with asnycio:

import asyncio
import bonsai

@asyncio.coroutine
def do():
    client = bonsai.LDAPClient("ldap://localhost")
    client.set_credentials("DIGEST-MD5", ("admin", "secret", None, None))
    with (yield from client.connect(is_async=True)) as conn:
        res = yield from conn.search("ou=nerdherd,dc=bonsai,dc=test", 2)
        print(res)
        who = yield from conn.whoami()
        print(who)

Changelog

Currently, you can read the changelog here.

Contribution

Any contributions and advices are welcome. Please report any issues at the GitHub page.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

bonsai-0.8.7.zip (120.1 kB view details)

Uploaded Source

bonsai-0.8.7.tar.gz (92.0 kB view details)

Uploaded Source

Built Distributions

bonsai-0.8.7.win-amd64-py3.5.msi (294.9 kB view details)

Uploaded Source

bonsai-0.8.7.win-amd64-py3.4.msi (143.4 kB view details)

Uploaded Source

bonsai-0.8.7.win32-py3.5.msi (139.3 kB view details)

Uploaded Source

bonsai-0.8.7.win32-py3.4.msi (135.2 kB view details)

Uploaded Source

bonsai-0.8.7-cp35-none-win_amd64.whl (204.3 kB view details)

Uploaded CPython 3.5 Windows x86-64

bonsai-0.8.7-cp35-cp35m-win32.whl (49.0 kB view details)

Uploaded CPython 3.5m Windows x86

bonsai-0.8.7-cp35-cp35m-macosx_10_11_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.5m macOS 10.11+ x86-64

bonsai-0.8.7-cp34-cp34m-win_amd64.whl (52.8 kB view details)

Uploaded CPython 3.4m Windows x86-64

bonsai-0.8.7-cp34-cp34m-win32.whl (47.5 kB view details)

Uploaded CPython 3.4m Windows x86

File details

Details for the file bonsai-0.8.7.zip.

File metadata

  • Download URL: bonsai-0.8.7.zip
  • Upload date:
  • Size: 120.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for bonsai-0.8.7.zip
Algorithm Hash digest
SHA256 b8b1ae00c10588b4748ea169ab48484bcf73c1970c5b9e5c942d711a5582393b
MD5 98a8cb4d89485ce357959c0d3d47304d
BLAKE2b-256 1678f35229af2d2df552bce4971ecf3cd3fdccc6a0956941b956c41499d5d893

See more details on using hashes here.

File details

Details for the file bonsai-0.8.7.tar.gz.

File metadata

  • Download URL: bonsai-0.8.7.tar.gz
  • Upload date:
  • Size: 92.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for bonsai-0.8.7.tar.gz
Algorithm Hash digest
SHA256 4825055b5f145259f7328fc549f75f0e80841782f38ac205e43fd3959f5f6a82
MD5 02751c8d0de45b274054e71e2aa2211a
BLAKE2b-256 02f1233d9089044c8c3d332cb0b31acdc12a1514dc9183dcd0c6a37f986c41db

See more details on using hashes here.

File details

Details for the file bonsai-0.8.7.win-amd64-py3.5.msi.

File metadata

File hashes

Hashes for bonsai-0.8.7.win-amd64-py3.5.msi
Algorithm Hash digest
SHA256 b34a370f72f9f7fb17c4efea4d1bcb14e6b0b90b6b71e68a4133c2ad1809337a
MD5 1c3b8ce916670492b2567864a7032d1b
BLAKE2b-256 9776c09172555bb01ef2c758b0abbb1ece51dcffa11c1a820e00f6b7450bbba7

See more details on using hashes here.

File details

Details for the file bonsai-0.8.7.win-amd64-py3.4.msi.

File metadata

File hashes

Hashes for bonsai-0.8.7.win-amd64-py3.4.msi
Algorithm Hash digest
SHA256 138d7559407a9458b09dae60d85eddf46166b99c11650bea1c25c1da264c356f
MD5 c2197709a9200c59cad2dd7dc82d2b4e
BLAKE2b-256 f9904bb9238eeb4b46591f3dd543276822b688a0ca9baa87eb3ecc46fb425917

See more details on using hashes here.

File details

Details for the file bonsai-0.8.7.win32-py3.5.msi.

File metadata

File hashes

Hashes for bonsai-0.8.7.win32-py3.5.msi
Algorithm Hash digest
SHA256 f3809d846c99c2bd3a31381889ace22d9c9735b045b7ba47a14923a61bd4369d
MD5 82e1f6c1ae1ffbc2b8c47b432f1dc67b
BLAKE2b-256 0afd6ec8ec6eadf851215b851293a1ff246a46cf96171104f00f9aad1e00f49e

See more details on using hashes here.

File details

Details for the file bonsai-0.8.7.win32-py3.4.msi.

File metadata

File hashes

Hashes for bonsai-0.8.7.win32-py3.4.msi
Algorithm Hash digest
SHA256 b60c3c73ebe70917f6dacabb781876893f88f6248fb0a821d0b0943a1f9e9024
MD5 b6bb73675043cac7c20ba47636244309
BLAKE2b-256 6ed1e8e92c6b684803e6db46aefb4f7441e603bf8b3442a31df890a84345631c

See more details on using hashes here.

File details

Details for the file bonsai-0.8.7-cp35-none-win_amd64.whl.

File metadata

File hashes

Hashes for bonsai-0.8.7-cp35-none-win_amd64.whl
Algorithm Hash digest
SHA256 77ad57b7d5d5c5be97a62aad68c862fc7d099319a9bfa5f605e90624edb62f12
MD5 4628df546f4219febc86fe1c0bd903ab
BLAKE2b-256 ac7be9fe247da9412baafffa5ee4c2371c23e08a3d2eee873a9243a7944c9340

See more details on using hashes here.

File details

Details for the file bonsai-0.8.7-cp35-cp35m-win32.whl.

File metadata

File hashes

Hashes for bonsai-0.8.7-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 27e32d1331842115fa0fb3a337d708399ed8b611c798d6d2c2ba9741e3e50bc1
MD5 ff5f4d63eaf8e7803ae2b7321811923c
BLAKE2b-256 4ece95e0c5472c4c91ede33a4924b99d36034bbc02aa359e4d036718ec548aa1

See more details on using hashes here.

File details

Details for the file bonsai-0.8.7-cp35-cp35m-macosx_10_11_x86_64.whl.

File metadata

File hashes

Hashes for bonsai-0.8.7-cp35-cp35m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 1714b52d5cee85baeb088fb2cc77e05bea57a392660e0cba3e2f36e57d8b2277
MD5 881b84539ccacd43ed90ae29df9eaa48
BLAKE2b-256 e188ca3d1e7bf6d31ee3271019aa1f0d5abeb53e5a52a03da7a4879616ca440a

See more details on using hashes here.

File details

Details for the file bonsai-0.8.7-cp34-cp34m-win_amd64.whl.

File metadata

File hashes

Hashes for bonsai-0.8.7-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 9d53d5800c27c81c1cca56a4579d106dcd4c22ba63796d1f9e664e9dd32f2ea6
MD5 e0b23dfdd506cdd167c523684f5ee3d2
BLAKE2b-256 d3ba2c58fd888bdf6ad3d6d0cfbd96af6cc9119fda4d8cc8eeeb91474528cf36

See more details on using hashes here.

File details

Details for the file bonsai-0.8.7-cp34-cp34m-win32.whl.

File metadata

File hashes

Hashes for bonsai-0.8.7-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 60f718b5602f6d98f3ae0b87384ab8508b6635784155f50b51322d2e24580102
MD5 bf76a821a7028b74816187e759ef6af8
BLAKE2b-256 7a3ad6ea721102ade9fe5e0b6f5aef2a6e61bb9b254ab9250c3d9a41db57e271

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page