{"id":10171,"library":"python3-ldap","title":"python3-ldap (Renamed to ldap3)","description":"The `python3-ldap` project has been renamed to `ldap3`. This entry documents `python3-ldap` as a deprecated library and strongly advises users to migrate to `ldap3`, which is the actively maintained and current library for interacting with LDAP servers in Python. `ldap3` provides a comprehensive, modern, and high-performance feature set for LDAP client operations, including secure connections (LDAPS/StartTLS), asynchronous operations, and various authentication methods. The current version of `ldap3` is 2.9.1, and it maintains a steady release cadence.","status":"renamed","version":"0.9.8.4","language":"python","source_language":"en","source_url":"https://github.com/cannatag/ldap3","tags":["ldap","authentication","directory","enterprise"],"install":[{"cmd":"pip install python3-ldap","lang":"bash","label":"Deprecated: Do not use for new projects"},{"cmd":"pip install ldap3","lang":"bash","label":"Recommended: Install ldap3 instead"}],"dependencies":[{"reason":"Required by ldap3 for ASN.1 encoding/decoding.","package":"pyasn1","optional":false},{"reason":"Required by ldap3 for additional ASN.1 modules.","package":"pyasn1-modules","optional":false}],"imports":[{"wrong":"from ldap3 import Server","symbol":"Server","correct":"from ldap3 import Server"}],"quickstart":{"code":"import os\nfrom ldap3 import Server, Connection, AUTH_SIMPLE, STRATEGY_SYNC, GET_DSE_INFO\n\n# Configure LDAP connection details\nLDAP_SERVER_IP = os.environ.get('LDAP_SERVER_IP', 'your_ldap_server.example.com')\nLDAP_USER_DN = os.environ.get('LDAP_USER_DN', 'cn=admin,dc=example,dc=com') # e.g., 'uid=user,ou=users,dc=example,dc=com'\nLDAP_PASSWORD = os.environ.get('LDAP_PASSWORD', 'admin_password')\nLDAP_BASE_DN = os.environ.get('LDAP_BASE_DN', 'dc=example,dc=com')\n\ntry:\n    # Define the LDAP server\n    server = Server(LDAP_SERVER_IP, get_info=GET_DSE_INFO)\n\n    # Establish a connection\n    conn = Connection(server, user=LDAP_USER_DN, password=LDAP_PASSWORD, authentication=AUTH_SIMPLE)\n\n    # Bind to the server\n    if not conn.bind():\n        print(f\"Error binding to LDAP: {conn.result}\")\n    else:\n        print(\"Successfully bound to LDAP server.\")\n\n        # Perform a search\n        search_filter = '(objectClass=person)' # Example filter\n        conn.search(LDAP_BASE_DN, search_filter, attributes=['cn', 'mail'])\n\n        print(\"\\nSearch Results:\")\n        for entry in conn.entries:\n            print(f\"  CN: {entry.cn}, Mail: {entry.mail}\")\n\n    # Unbind from the server\n    conn.unbind()\n    print(\"Unbound from LDAP server.\")\n\nexcept Exception as e:\n    print(f\"An error occurred during LDAP operation: {e}\")\n","lang":"python","description":"This quickstart demonstrates how to establish a connection to an LDAP server using `ldap3`, bind with simple authentication, and perform a basic search. It's crucial to replace placeholder values with your actual LDAP server details and user credentials. Environment variables are used for sensitive information."},"warnings":[{"fix":"Immediately migrate to `ldap3`. Install with `pip install ldap3` and refactor your code according to `ldap3`'s API documentation.","message":"The `python3-ldap` project is completely abandoned and has been renamed to `ldap3`. It receives no further updates, bug fixes, or security patches. Using `python3-ldap` is not recommended.","severity":"breaking","affected_versions":"All versions of `python3-ldap` (0.9.8.4 and earlier)."},{"fix":"There is no direct migration path. You must rewrite your LDAP interaction logic using `ldap3`'s `Server` and `Connection` classes and its new query syntax.","message":"The API of `python3-ldap` is entirely incompatible with `ldap3`. Code written for `python3-ldap` will not work with `ldap3` without significant modification, as core classes, functions, and paradigms have changed.","severity":"breaking","affected_versions":"All versions when migrating from `python3-ldap` to `ldap3`."},{"fix":"Avoid `python3-ldap`. If you encounter installation issues, it's a strong signal to switch to `ldap3`, which has broad compatibility with current Python versions.","message":"Installing `python3-ldap` might fail on modern Python versions or specific operating systems due to outdated dependencies or lack of wheel support.","severity":"gotcha","affected_versions":"Python 3.9+ and potentially certain OS environments."}],"env_vars":null,"search_vec":"'2.9.1':81 'activ':38 'advis':29 'asynchron':69 'authent':73,90 'cadenc':88 'client':63 'comprehens':53 'connect':67 'current':41,76 'deprec':25 'directori':91 'document':19 'enterpris':92 'entri':18 'featur':59 'high':57 'high-perform':56 'includ':65 'interact':44 'ldap':3,10,22,46,62,89 'ldap3':6,16,34,50,79 'ldaps/starttls':68 'librari':26,42 'maintain':39,84 'method':74 'migrat':32 'modern':54 'oper':64,70 'perform':58 'project':11 'provid':51 'python':49 'python3':2,9,21 'python3-ldap':1,8,20 'releas':87 'renam':4,14 'secur':66 'server':47 'set':60 'steadi':86 'strong':28 'user':30 'various':72 'version':77","created_at":"2026-04-17T01:22:45.026582+00:00","updated_at":"2026-04-17T01:22:45.026582+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n  File \"/tmp/tmp785xe1fe/venv/lib/python3.12/site-packages/ldap3/__init__.py\", line 254, in <module>\n    from .core.server import Server\n  File \"/tmp/tmp785xe1fe/venv/lib/python3.12/site-packages/ldap3/core/server.py\", line 35"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.9.8.4","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/cannatag/ldap3","docs":null,"changelog":null,"pypi":"https://pypi.org/project/python3-ldap/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["auth-security","http-networking","database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}