Skip to main content

ldaptools

Helper modules to work with LDAP directories and test LDAP tools against OpenLDAP.

  • ldaptools.ldif_utils: simple parser for LDIF files

  • ldaptools.ldap_source: generate a stream of LDAP entries from an LDAP URL

  • ldaptools.synchronize: synchronization class to synchronize a source of LDAP records with a target

  • ldaptools.paged: an LDAPObject implementating paged search requests

  • ldaptools.ldapsync: a command line client to the Synchronize class

ldapsync

usage: ldapsync [-h] –object-class-pivot OBJECT_CLASS_PIVOT

[–attributes-file ATTRIBUTES_FILE] [–attributes ATTRIBUTES] –source-uri SOURCE_URI –source-base-dn SOURCE_BASE_DN [–source-bind-dn SOURCE_BIND_DN] [–source-bind-password SOURCE_BIND_PASSWORD] –target-uri TARGET_URI –target-base-dn TARGET_BASE_DN [–target-bind-dn TARGET_BIND_DN] [–target-bind-password TARGET_BIND_PASSWORD] [–fake] [–verbose]

Synchronize an LDIF file or a source LDAP directory to another directory Base DN of the source is remapped to another DN in the target directory

optional arguments:
-h, --help

show this help message and exit

--object-class-pivot OBJECT_CLASS_PIVOT

an objectClass and an attribute name which is the unique identifier for this class

--attributes-file ATTRIBUTES_FILE

a file containing the list of attributes to synchronize

--attributes ATTRIBUTES

a list of attribute names separated by spaces

--source-uri SOURCE_URI

URL of an LDAP directory (ldapi://, ldap:// or ldaps://) or path of and LDIF file

--source-base-dn SOURCE_BASE_DN

base DN of the source

--source-bind-dn SOURCE_BIND_DN

bind DN for a source LDAP directory

--source-bind-password SOURCE_BIND_PASSWORD

bind password for a source LDAP directory

--target-uri TARGET_URI

URL of the target LDAP directory

--target-base-dn TARGET_BASE_DN

base DN of the target LDAP directory

--target-bind-dn TARGET_BIND_DN

bind DN for a target LDAP directory

--target-bind-password TARGET_BIND_PASSWORD

bind password for a target LDAP directory

--fake

compute synchronization actions but do not apply

--verbose

print all actions to stdout

Exemple

Synchronize tree of organizational units and people between an LDIF file and a local OpenLDAP directory:

ldapsync --attributes 'uid cn givenName sn dc ou o description mail member' \
         --object-class-pivot 'inetOrgPerson uid' \
         --object-class-pivot 'organizationalUnit ou' \
         --object-class-pivot 'dcobject dc' \
         --source-uri dump.ldif \
         --source-base-dn dc=myorganization,dc=fr \
         --target-uri ldapi:// \
         --target-base-dn o=myorganization,dc=otherorganization,dc=fr \
         --verbose

Synchronize tree of organizational units and people between two LDAP directories:

ldapsync --attributes 'uid cn givenName sn dc ou o description mail member' \
         --object-class-pivot 'inetOrgPerson uid' \
         --object-class-pivot 'organizationalUnit ou' \
         --object-class-pivot 'dcobject dc' \
         --source-uri ldap://ldap.myorganization.fr \
         --source-bind-dn uid=admin,ou=people,dc=myorganization,dc=fr
         --source-bind-password password
         --source-base-dn dc=myorganization,dc=fr \
         --target-uri ldap://ldap.otherorganization.fr
         --target-bind-dn uid=admin,o=myorganization,dc=otherorganization,dc=fr
         --target-bind-password password
         --target-base-dn o=myorganization,dc=otherorganization,dc=fr \
         --verbose

Release files for ldaptools 0.6

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

Built distribution (wheel)

Table of built distributions (wheels) for ldaptools 0.6
File Interpreter ABI Platform
ldaptools-0.6-py2-none-any.whl Python 2 none any Details

Release files / ldaptools-0.6-py2-none-any.whl

Download URL ldaptools-0.6-py2-none-any.whl
Size 30.9 kB
Tags Python 2
SHA-256 checksum
How to use checksums
a9412a9c4ca1c3bfe7fcf344e8557bd206cb15dd238297afeabd61b948afa9a5
BLAKE2b-256 checksum
How to use checksums
676264ff70c0a5b37f49b6b7bbd73dcf03edae52daaa75627316083161371288
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.24

2 release files

0.21

2 release files

0.18

1 release file

0.17

1 release file

0.15

1 release file

0.14

1 release file

0.13

1 release file

0.12

1 release file

0.10

1 release file

0.9

1 release file

0.8

1 release file

This release

0.6 This release

1 release file

0.5

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