Skip to main content

LDAP object mapper

This python module provides a simple LDAP object mapper

License

MIT, so do what you want, but leave the copyright notice in the code

Github

Fork it!

https://github.com/HaDiNet/ldapom

Usage

Playing around:

>>> import ldapom
>>> lc = ldapom.LdapConnection(uri='ldap://localhost:1381', base='dc=example,dc=com', login='cn=admin,dc=example,dc=com', password='admin') # doctest: +SKIP
>>> node = lc.get_ldap_node('cn=jack,dc=example,dc=com')
>>> node # just show
<LdapNode: cn=jack,dc=example,dc=com>
>>> node.sn # show surname
<LdapAttribute: sn=O'Niel>
>>> node.sn = 'Meier' # change givenname
>>> node.save() # save all changes
>>> node.delete() # delete

Create a new ldap node:

>>> node2 = lc.new_ldap_node('cn=newuser,dc=example,dc=com')
>>> node2.objectClass = ['person']
>>> node2.cn = 'newuser'
>>> node2.sn = 'newuser'
>>> node2.save()

Search for attributes:

>>> result = lc.search('objectClass=posixAccount')
>>> list(result)
[<LdapNode: cn=daniel,dc=example,dc=com>, <LdapNode: cn=sam,dc=example,dc=com>]

Howto use TLS:

>>> lc = ldapom.LdapConnection(uri='ldaps://your.server.com', base='dc=example,dc=com', login='cn=admin,dc=example,dc=com', password='admin', cert='/path/to/cert') # doctest: +SKIP

Testing

To install development dependencies use

pip install -r dev-requirements.txt

Make sure, openldap is installed then run

python2 tests.py

Metadata

Release files for ldapom 0.9.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ldapom 0.9.3
File Size Uploaded
ldapom-0.9.3.tar.gz 7.0 kB Details

Release files / ldapom-0.9.3.tar.gz

Download URL ldapom-0.9.3.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7bed3069ed1efc00d13ffdbe586fed04d034282c0b14ab3547dfbf7b6bf53c4c
BLAKE2b-256 checksum
How to use checksums
a6d6cf138d91f0301249e8b0f54aa0a58a7e377133c80c188191f7f4483dea22
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.12.1

1 release file

0.12.0

1 release file

0.11.0

1 release file

0.10.1

1 release file

0.10.0

1 release file

0.9.4

1 release file

This release

0.9.3 This release

1 release file

0.9.2

1 release file

0.9.1

1 release file

0.9

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page