Skip to main content

Python 3 module for accessing LDAP directory servers.

Project description

PyPI Version Travis CI Build Status AppVeyor CI 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.4 or newer, and LDAPv3.

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

Requirements for building

  • python3.4-dev or newer

  • libldap2-dev

  • libsasl2-dev

  • libkrb5-dev or heimdal-dev (optional)

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 Distribution

bonsai-0.9.0.tar.gz (107.2 kB view details)

Uploaded Source

Built Distributions

bonsai-0.9.0.win-amd64-py3.6.msi (151.6 kB view details)

Uploaded Source

bonsai-0.9.0.win-amd64-py3.5.msi (155.6 kB view details)

Uploaded Source

bonsai-0.9.0.win-amd64-py3.4.msi (151.6 kB view details)

Uploaded Source

bonsai-0.9.0.win32-py3.6.msi (147.5 kB view details)

Uploaded Source

bonsai-0.9.0.win32-py3.5.msi (147.5 kB view details)

Uploaded Source

bonsai-0.9.0.win32-py3.4.msi (147.5 kB view details)

Uploaded Source

bonsai-0.9.0-cp36-cp36m-win_amd64.whl (61.4 kB view details)

Uploaded CPython 3.6m Windows x86-64

bonsai-0.9.0-cp36-cp36m-win32.whl (54.9 kB view details)

Uploaded CPython 3.6m Windows x86

bonsai-0.9.0-cp35-cp35m-win_amd64.whl (63.7 kB view details)

Uploaded CPython 3.5m Windows x86-64

bonsai-0.9.0-cp35-cp35m-win32.whl (57.2 kB view details)

Uploaded CPython 3.5m Windows x86

bonsai-0.9.0-cp34-cp34m-win_amd64.whl (58.2 kB view details)

Uploaded CPython 3.4m Windows x86-64

bonsai-0.9.0-cp34-cp34m-win32.whl (53.6 kB view details)

Uploaded CPython 3.4m Windows x86

File details

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

File metadata

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

File hashes

Hashes for bonsai-0.9.0.tar.gz
Algorithm Hash digest
SHA256 0ebd945e5e8bac7ff6ae7455822b519978dd540d11e54940cf4c131ca7d779a1
MD5 37528aa2f6199f2e79dccc54195d0038
BLAKE2b-256 64a25f5b4f8052c6a2ae5fe157fce065a60525925af9ca67756543e57bfd875c

See more details on using hashes here.

File details

Details for the file bonsai-0.9.0.win-amd64-py3.6.msi.

File metadata

File hashes

Hashes for bonsai-0.9.0.win-amd64-py3.6.msi
Algorithm Hash digest
SHA256 c3b67068b9cdfa867b9e641517ab62b4462b2ad57d4a9653ce75bd3ec11943c6
MD5 7f5bbc6f04e24542fce3ac9dd0b0710e
BLAKE2b-256 ef801015ddc9f35568227339623c7a4c1166a46c7f10934b7dfa1baec71b8205

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bonsai-0.9.0.win-amd64-py3.5.msi
Algorithm Hash digest
SHA256 de61e2b569aa43a8495c55a2f9d4704e75dee0fa42a9977c9317c169a8ab66aa
MD5 dfbe9a6f7e1ec8f3fa642b2b36c21fd2
BLAKE2b-256 40b9991aa4d12dd3e4cbc8284d3aecd5ab58aed4c4a19967f03f5fd17eefb537

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bonsai-0.9.0.win-amd64-py3.4.msi
Algorithm Hash digest
SHA256 fafb7a4cefd6eee9faeb5498e8867dd4aae2fa6f3ccc1ff024a200374b762fe1
MD5 f33c0405030356217a2d0ac61cef34bd
BLAKE2b-256 e7fc180e1ebce1c3bead2ffb52db95eb4e3ce402de6da3d70b944714119695ba

See more details on using hashes here.

File details

Details for the file bonsai-0.9.0.win32-py3.6.msi.

File metadata

File hashes

Hashes for bonsai-0.9.0.win32-py3.6.msi
Algorithm Hash digest
SHA256 ce53b255d4206751e85f2b567d7d4a8ac30daefe523f3236539b4733cc0ba855
MD5 a2d32a8d6da30183c99df3430e141d9f
BLAKE2b-256 a3b780e1d156589f675ab6ac9e2ec49a350988fc1599c7c3d935f3df11108ee6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bonsai-0.9.0.win32-py3.5.msi
Algorithm Hash digest
SHA256 3763b52d3503f6db54ba5d83bbc2f50cd29475c3072bf7661e306e57c0a16bf9
MD5 8f270af3c13e224fe3c436f2a47e6c17
BLAKE2b-256 3e57b9815b8461e39467ffdc818ba255a8657852d6d5a2a8652deab9045409fb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bonsai-0.9.0.win32-py3.4.msi
Algorithm Hash digest
SHA256 e6d9075d969b18d64563a4a7e7da03d9ce3d994dc9b8c8490fc84dc564ec043c
MD5 754402fe2abdde7b5b54be9cd052e70c
BLAKE2b-256 cd58e207e5f38cbe103bb8e47e9ee438e44beb52076dd6ae5d3aabe75509cfa7

See more details on using hashes here.

File details

Details for the file bonsai-0.9.0-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for bonsai-0.9.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 49f49be0ba7f70216a6d365f1d12203881d87c3a8cba9da6fbebb6fae50eb045
MD5 6fcb4d6e2ea58bcc0ac0ad9eb57a5cc1
BLAKE2b-256 3e342c4d3e7ddfab0e70de402401ff2d20137c9fe5300e1ac19590292520ecc2

See more details on using hashes here.

File details

Details for the file bonsai-0.9.0-cp36-cp36m-win32.whl.

File metadata

File hashes

Hashes for bonsai-0.9.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 f006ac31c4c029e251e17a0965e5d58814a42ae718cacc81b548937e71e81ecf
MD5 97ce5ed63a91bc7635c088ed754eccd2
BLAKE2b-256 2a8780b6909b25a1e8c836200638a9ce3071f5d0a5fe8d6916dfbe967e6683d3

See more details on using hashes here.

File details

Details for the file bonsai-0.9.0-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for bonsai-0.9.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 a799c3b394eee567aee0925f5aeb0cc0388cbc316823b2960b7c9d09acbde4a8
MD5 f646a0bfda6f6944329bf8b43d6ef267
BLAKE2b-256 099b4358335bcfed19ab27a864dc2d0b9e7174408eb26b9f1d27580cf46f53af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bonsai-0.9.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 19128e37d16e4a9f927e7b0419f5ffea4cc9096e5e7fd90ea866bed03c9fca55
MD5 88b07f8391b2a5d62e9cfc781814fc10
BLAKE2b-256 09cd3d219ab81fb4ab4a0f1ddaf8231828ae9f0bc61de4d7291b5d1b8e208860

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bonsai-0.9.0-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 4abf03a1c44b1f0b873962965a06e2c20135ad86fb3c0cae1f6f200a646340ee
MD5 ff4e241b53db4b1238c96d54e797acf0
BLAKE2b-256 b4ede2c98d0851a65d8c830840d165aa6a85e07f37d2877d4b45fe6eb57cc7a4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bonsai-0.9.0-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 1bf96d2410f11daf22a1184e41a3c1a130d2a8a342cbd08400bc1c866a01c3ae
MD5 67c8b3a9da8d41f6097c90dd63aa8ff1
BLAKE2b-256 5ed3a07205716ac6990bfc95281e243e0c72d117157746305d2b79da745e4495

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