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.6.zip (117.2 kB view details)

Uploaded Source

bonsai-0.8.6.tar.gz (90.4 kB view details)

Uploaded Source

Built Distributions

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

bonsai-0.8.6-cp35-none-win_amd64.whl (203.6 kB view details)

Uploaded CPython 3.5 Windows x86-64

bonsai-0.8.6-cp35-cp35m-win32.whl (48.4 kB view details)

Uploaded CPython 3.5m Windows x86

bonsai-0.8.6-cp35-cp35m-macosx_10_11_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.5m macOS 10.11+ x86-64

bonsai-0.8.6-cp34-none-win_amd64.whl (52.1 kB view details)

Uploaded CPython 3.4 Windows x86-64

bonsai-0.8.6-cp34-none-win32.whl (46.7 kB view details)

Uploaded CPython 3.4 Windows x86

File details

Details for the file bonsai-0.8.6.zip.

File metadata

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

File hashes

Hashes for bonsai-0.8.6.zip
Algorithm Hash digest
SHA256 645c1257ccab1824083cbfddfd0b6005cf3dd88b75635e6d977ac2cb3d295f52
MD5 9a818d3a98755c0ee6a61003859dff29
BLAKE2b-256 374a3ff2c3a9d8e7e445f70176db6b8c0f8810894c869f85d98d595023dcb4f3

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for bonsai-0.8.6.tar.gz
Algorithm Hash digest
SHA256 3b70c8fe5e67e2a4be3753dc2c4704c6b01065dd5a6db0557e4bff10e436d613
MD5 6f27a598ecda0b114c6c299806cc2ddb
BLAKE2b-256 cca276343fcf92f9b07e831c0255d8d6d2ffda0bb30d2a0719e4f7f17b41a057

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bonsai-0.8.6.win-amd64-py3.5.msi
Algorithm Hash digest
SHA256 d4da6ee3597bfd3fc73036fb3cf6d802365725caf7fcf3d76f416d227082962c
MD5 a2a5ec6576343a7ece93942297424aa7
BLAKE2b-256 08c20b8d27fe67d5ab364bf64218c32f694a512e5bfde32e456feaa786cfb2f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bonsai-0.8.6.win-amd64-py3.4.msi
Algorithm Hash digest
SHA256 639c1ffccec87621817ae2a59705f8114b6972fc797b678bcfab6a468058cb4b
MD5 0146acdba856456114b9d4fb417ef7dd
BLAKE2b-256 ac1f055db6a4d4ca687ec93d529382ca6b07f0a7c506040d351e2cc43ef2444e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bonsai-0.8.6.win32-py3.5.msi
Algorithm Hash digest
SHA256 8f4b83462246a5a811ac8afec7c024edb79cbf8374ece0777a7c33a035db69a0
MD5 0e03070a751ab0d19316b88ce1f6f610
BLAKE2b-256 8dd524119b642ad708e1dfb9c2ad417afb6574f2dbe590bd0988bb98d6e27948

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bonsai-0.8.6.win32-py3.4.msi
Algorithm Hash digest
SHA256 5bed1bdb1c8c0f8ec97e3dc7210f11a11c4026310eda099003666ca7c54dd9eb
MD5 7af23cc864d81fd55f14e9d9b3d3a73a
BLAKE2b-256 c34bcf3d7ca7dcd756143f2c3a494ae9841b6f09f6a0c1081250555dc58ddf0b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bonsai-0.8.6-cp35-none-win_amd64.whl
Algorithm Hash digest
SHA256 569902ddb327b21fa66e6f2749e77a97c78a241ea7759b33b395f3e3bce12288
MD5 df0d3bcd9678884766936535fb5a0be7
BLAKE2b-256 df1a221acc7f8f9a98e320c910c3fa1246cec7949f53f87154296c09dbc6bc91

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bonsai-0.8.6-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 c03b54114b0c534c3cb1fae18887bdd79da82e5844cdfa433a8dfbb7dd3ae3c3
MD5 60233fe2cfbf804f3d3a5a4a8fb17b73
BLAKE2b-256 b38de7a2a234c723b70009eb7c0f1643af770116be0b05a253b9b976aad7722c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bonsai-0.8.6-cp35-cp35m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 611bc7bac5a1f4cca71e1513468ee35b321b9c47da12a0a15d329e71d6d79fe0
MD5 1ea4269a596e05f08fb0a4872e8db5e4
BLAKE2b-256 75570622c46ca46a302fe5cfdefb7be32e5fd148f6ae6837c717aa3704e77757

See more details on using hashes here.

File details

Details for the file bonsai-0.8.6-cp34-none-win_amd64.whl.

File metadata

File hashes

Hashes for bonsai-0.8.6-cp34-none-win_amd64.whl
Algorithm Hash digest
SHA256 3e601a011b573a475ada4fe9129521f7bf589ae0154e046aaf98b280336c244b
MD5 656fc39068af0a63af6dc964715ebee6
BLAKE2b-256 3f644fa3b28a09dcb6abe8f453d6c84005633bf5414d2badacd300d06bbe7800

See more details on using hashes here.

File details

Details for the file bonsai-0.8.6-cp34-none-win32.whl.

File metadata

File hashes

Hashes for bonsai-0.8.6-cp34-none-win32.whl
Algorithm Hash digest
SHA256 d9392f283e098f8ed27c42ea292c47143b1812819fc06c70ff7e2e0f7cfc67c2
MD5 aa8a5f9646b161391b6946460de65e7c
BLAKE2b-256 2ab9b811770f4ec22aa730f8a811eea6cc7ba7f4c3f84e49dcd660cd96bed6ec

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