{ "info": { "author": "Mike Helderman", "author_email": "mike.helderman@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "Ldappr\n======\n\n|PyPI version|\n\nLdappr is a wrapper around python-ldap, meant for quick and easy handling of common administrative tasks concerning your LDAP compliant repository. It is particularly useful in small, one-time scripts to get things done, or interactively within an iPython shell.\n\nInstallation\n------------\n\nOf course, python-ldap is supposed to be already installed.\n\n::\n\n pip install ldappr\n\nConnect\n-------\n\n.. code:: python\n\n import ldappr\n\n # authenticated bind\n ldap = ldappr.connect_to('127.0.0.1', 'uid=admin,ou=system', 'secret')\n\nRetrieve objects\n----------------\n\nWhen you have a connection, you can search on it. First, specify the\nseach base.\n\n.. code:: python\n\n ldap.search_base = 'ou=users,ou=system'\n\nThen, get one or more objects to manipulate.\n\n.. code:: python\n\n # retrieve a single object\n user = ldap.get('cn=jdoe')\n\n # retrieve a list of objects\n users = ldap.search('objectClass=inetOrgPerson')\n\nDo stuff\n--------\n\nOnce you got an object, you can easily manipulate it. All changes will immediately reflect in your LDAP repository.\n\n.. code:: python\n\n # pretty print the retrieved user\n print(user)\n\n # get an attribute value\n sn = user.attrs['sn']\n\n # set an attribute value (existing value will be removed)\n user.set_value('givenName', 'Jack')\n\n # add a value to a multi-valued attribute\n user.add_value('mobile', '0123456789')\n user.add_value('mobile', '9876543210')\n\n # remove a value from a multi-valued attribute\n user.remove_value('mobile', '9876543210')\n\nOther examples\n--------------\n\n.. code:: python\n\n # anonymous bind\n ldap = ldappr.connect_to('127.0.0.1')\n\n # authenticated bind with more options\n ldap = ldappr.connect_to('127.0.0.1', 'uid=admin,ou=system', 'secret',\n protocol='ldaps', port='10636', verify=False, \n search_base='ou=users,ou=system')\n\n # delete all objects with employeeType manager\n for dn in ldap.get_dn('employeeType=manager'):\n ldap.delete(dn)\n\n # set an attribute value for a known dn\n ldap.set_value('cn=jdoe,ou=users,ou=system', 'givenName', 'Jack')\n\n # make an LDIF export for all users\n with open('export.ldif', 'a') as file:\n for user in ldap.search('objectClass=inetOrgPerson'):\n file.write(user.to_ldif())\n\n.. |PyPI version| image:: https://badge.fury.io/py/ldappr.svg\n :target: http://badge.fury.io/py/ldappr", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nanu2/ldappr", "keywords": "", "license": "ICS", "maintainer": "", "maintainer_email": "", "name": "ldappr", "package_url": "https://pypi.org/project/ldappr/", "platform": "", "project_url": "https://pypi.org/project/ldappr/", "project_urls": { "Homepage": "https://github.com/nanu2/ldappr" }, "release_url": "https://pypi.org/project/ldappr/0.1.5/", "requires_dist": null, "requires_python": "", "summary": "Wrapper around python-ldap.", "version": "0.1.5" }, "last_serial": 3816930, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "29cb22395694603ef5d3c939ec5b9035", "sha256": "afe208d0ffb4834583abfb464ce5f9f630ce7296859c1bd6961417d143cdab0b" }, "downloads": -1, "filename": "ldappr-0.1.tar.gz", "has_sig": false, "md5_digest": "29cb22395694603ef5d3c939ec5b9035", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5378, "upload_time": "2014-09-14T13:50:29", "url": "https://files.pythonhosted.org/packages/c4/ff/6e737a92a321736c485dd473ba459cced434ca9f88f5599f043c5906310e/ldappr-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "3eaa9c9c0f6642ef824d25f8629648c7", "sha256": "63ef08e2386a6f39a9704a33874ab7919b3ce00b3d99cb20308d680dd3917c7d" }, "downloads": -1, "filename": "ldappr-0.1.1.tar.gz", "has_sig": false, "md5_digest": "3eaa9c9c0f6642ef824d25f8629648c7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5542, "upload_time": "2014-09-16T10:43:39", "url": "https://files.pythonhosted.org/packages/1b/02/c381e56f192bc9e2be4c2447233618466096e1611e3057026e14d67cb352/ldappr-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "a06de306233a94afb3ead2e93fa3a473", "sha256": "5bef1e12227cf4c9b182979d9509edde984af134b392f643ce548dfcf70d32da" }, "downloads": -1, "filename": "ldappr-0.1.2.tar.gz", "has_sig": false, "md5_digest": "a06de306233a94afb3ead2e93fa3a473", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5379, "upload_time": "2014-09-16T10:58:52", "url": "https://files.pythonhosted.org/packages/f2/99/2bcb2823abeca6542e835697daca80297a7c2b205a961468f2e5031d089c/ldappr-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "39f529c7c5cc42e85440aaa01f9ca3e6", "sha256": "e30485b0428ddc0d0ec13ee07b641a82367859e10e2670208a9a10e6a354375e" }, "downloads": -1, "filename": "ldappr-0.1.3.tar.gz", "has_sig": false, "md5_digest": "39f529c7c5cc42e85440aaa01f9ca3e6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5571, "upload_time": "2014-09-16T11:15:34", "url": "https://files.pythonhosted.org/packages/78/8f/e9f1348600b451a5a4df2a5192a534dbe197a6f00a6fd25fff6cd2f134a2/ldappr-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "eafbc8e53f87d0303db310ec84e7a707", "sha256": "2098b3fa87f8276d35afa7a45999e4e670f4bd752fde0555b0e4860452357f84" }, "downloads": -1, "filename": "ldappr-0.1.4.tar.gz", "has_sig": false, "md5_digest": "eafbc8e53f87d0303db310ec84e7a707", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5585, "upload_time": "2014-09-16T11:45:13", "url": "https://files.pythonhosted.org/packages/89/54/7b42d624f2206d59f1f97d40592ec22f165c5b2a30c7f010041c1099bfcb/ldappr-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "a6650d8681f85747d045d286b1357af0", "sha256": "935d0c9158ebb7bce8ae31081cd387e389756d5cd160245d7bf7ca0edc7a2e63" }, "downloads": -1, "filename": "ldappr-0.1.5.tar.gz", "has_sig": false, "md5_digest": "a6650d8681f85747d045d286b1357af0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6410, "upload_time": "2018-04-28T13:39:00", "url": "https://files.pythonhosted.org/packages/95/7d/4be0932ca8d83c8806afe03af9a69fae738b480201bd106dd0e5f9ae7b4c/ldappr-0.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a6650d8681f85747d045d286b1357af0", "sha256": "935d0c9158ebb7bce8ae31081cd387e389756d5cd160245d7bf7ca0edc7a2e63" }, "downloads": -1, "filename": "ldappr-0.1.5.tar.gz", "has_sig": false, "md5_digest": "a6650d8681f85747d045d286b1357af0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6410, "upload_time": "2018-04-28T13:39:00", "url": "https://files.pythonhosted.org/packages/95/7d/4be0932ca8d83c8806afe03af9a69fae738b480201bd106dd0e5f9ae7b4c/ldappr-0.1.5.tar.gz" } ] }