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).

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(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)

Documentation

Documentation is available online with a simple tutorial.

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.5.zip (115.0 kB view details)

Uploaded Source

bonsai-0.8.5.tar.gz (88.5 kB view details)

Uploaded Source

Built Distributions

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

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

Uploaded Source

bonsai-0.8.5-cp35-none-win_amd64.whl (203.2 kB view details)

Uploaded CPython 3.5 Windows x86-64

bonsai-0.8.5-cp35-cp35m-win32.whl (48.0 kB view details)

Uploaded CPython 3.5m Windows x86

bonsai-0.8.5-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.5-cp34-none-win_amd64.whl (51.6 kB view details)

Uploaded CPython 3.4 Windows x86-64

bonsai-0.8.5-cp34-none-win32.whl (46.3 kB view details)

Uploaded CPython 3.4 Windows x86

File details

Details for the file bonsai-0.8.5.zip.

File metadata

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

File hashes

Hashes for bonsai-0.8.5.zip
Algorithm Hash digest
SHA256 d758abeab0a87df2e0568124aea17e1bb028b2018ccd05d95b68385c1b4ac7a5
MD5 3a828c6cfd277d529d950c617c03f7de
BLAKE2b-256 dc98646cff8c6067c168da2b9aac04f2ce1bc571f1d526b9f19035563785fbcf

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for bonsai-0.8.5.tar.gz
Algorithm Hash digest
SHA256 f9f87345091899792bedf579661d64f6e6955722077b94ce598472d25bba1360
MD5 50c92d6f83ff12265562dac46558c581
BLAKE2b-256 8e6ad935d9fb17d8b88bd6de698b03adc161cfc48656cab88602781324a51ccb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bonsai-0.8.5.win-amd64-py3.5.msi
Algorithm Hash digest
SHA256 0c2bed1afb63fac3cb82c57055356f01085a245e79fcfec55191244e79d03499
MD5 c373b23615ab90e3a0212fb384c7db57
BLAKE2b-256 32031c057040058289e605da6620b52cd0b1c0d7a0369314adc83b6121a13df6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bonsai-0.8.5.win-amd64-py3.4.msi
Algorithm Hash digest
SHA256 e8adfe7fcafc07d7ac848e19e1f9fb378c4e3930f5f16362dd53a8c0ddf4c61f
MD5 7b1add8fae37b2516a5896cab6700151
BLAKE2b-256 3c0917ba1fadfc88fd46c83f90559331573513e011479e460179e1a985b351c2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bonsai-0.8.5.win32-py3.5.msi
Algorithm Hash digest
SHA256 d0db1448bb5b0c7752e9aca2659d9caa3b852451a3cb3c1d6c12d4c5574e4e54
MD5 ea5a749729152c0dc60e76de0a359a48
BLAKE2b-256 31ae3969394bfe21845ede430eeb1af85e50a44cb22489076ff414d9743b87b3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bonsai-0.8.5.win32-py3.4.msi
Algorithm Hash digest
SHA256 2039a746304610760059a242cd1406fef51d2d23b179a05a4a2b337607a7e50d
MD5 346d6ddba6a30ba6851f32004e94bac2
BLAKE2b-256 cc2a3061494dbe1efe48bbcd31d249ab663e2359d4e519ac130f47da672194dc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bonsai-0.8.5-cp35-none-win_amd64.whl
Algorithm Hash digest
SHA256 1f261c7f1390b9a784b5fbab39bdc24553d36c81360dc749379118106dd1f4be
MD5 db55f90cb4e49dcd88c1c9accb4b911e
BLAKE2b-256 77d07722350e969be21c5b2874cfc2bb34b68e69990ac8985fd1e5a03319fbc1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bonsai-0.8.5-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 ac5864e7eb9e743ea5509d1055cab90f0beba203597d5b59f5e8ad02dd70cc95
MD5 a69f33cc6023f06ee43a4737fee7ad81
BLAKE2b-256 39044e00069a298306cc1f30e9a77cd22e77116fee4ef7d0727e13b6694f6979

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bonsai-0.8.5-cp35-cp35m-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 16dfff3a1023441abc1e94613119ca9efb8e997d9d696245fbcc8e79e1c764aa
MD5 a8952cc654b3df25f82c7baeed577208
BLAKE2b-256 4ebc0d3d307e7de421b1095783fb0df6fcd277643b97eea4b6e24e7fcdd81efd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bonsai-0.8.5-cp34-none-win_amd64.whl
Algorithm Hash digest
SHA256 4fc9522c4a112993aa0145ffa7516227255c970496d7aecff659c703fb5c7887
MD5 379eafb7152c61f84aab9186328cebbb
BLAKE2b-256 e626279c7ec360ff9c3305fbeb74ab1f4f4569f1761b888dd57093dc96d61059

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bonsai-0.8.5-cp34-none-win32.whl
Algorithm Hash digest
SHA256 7b5c4f631c3a1a99ee198039def3a8e164606724fccf9adb43d2d3e5bdb1251b
MD5 0a7c190add36bb64f42bea1904e76bd7
BLAKE2b-256 1059355ade64c819808190f424471806e2bab10ab459551116b7fad2a0feca0a

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