The ldap.dn module defines the following functions:
escape_dn_chars(
s)
This function escapes characters in string s which
are special in LDAP distinguished names. You should use this function when
building LDAP DN strings from arbitrary input.
str2dn(
s)
This function takes dn and breaks it up into its component parts
down to AVA level.
explode_dn(
dn [, notypes=0])
This function takes dn and breaks it up into its component parts.
Each part is known as an RDN (Relative Distinguished Name). The
notypes parameter is used to specify that only the RDN values be
returned and not their types.
For example, the DN "cn=Bob, c=US" would be
returned as either ["cn=Bob", "c=US"] or ["Bob","US"]
depending on whether notypes was 0 or 1,
respectively.
explode_rdn(
rdn [, notypes=0])
This function takes a (multi-valued) rdn and breaks it up
into a list of characteristic attributes. The
notypes parameter is used to specify that only the RDN values be
returned and not their types.