{"id":28569645,"url":"https://github.com/abilian/ldif","last_synced_at":"2025-06-10T17:15:52.938Z","repository":{"id":52653281,"uuid":"222476704","full_name":"abilian/ldif","owner":"abilian","description":"Pure-Python LDIF parser and writer","archived":false,"fork":false,"pushed_at":"2024-05-16T09:17:36.000Z","size":416,"stargazers_count":5,"open_issues_count":3,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-17T09:51:16.775Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abilian.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-18T15:06:14.000Z","updated_at":"2025-05-07T13:14:16.000Z","dependencies_parsed_at":"2024-05-16T09:52:05.900Z","dependency_job_id":"333ce8e4-2afa-469d-b19a-fc792c49abbd","html_url":"https://github.com/abilian/ldif","commit_stats":{"total_commits":169,"total_committers":9,"mean_commits":18.77777777777778,"dds":0.5562130177514792,"last_synced_commit":"a94bfa310f1c7fef3c338d6dda75ad580fd77916"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abilian%2Fldif","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abilian%2Fldif/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abilian%2Fldif/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abilian%2Fldif/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abilian","download_url":"https://codeload.github.com/abilian/ldif/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abilian%2Fldif/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259114708,"owners_count":22807255,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-10T17:15:19.937Z","updated_at":"2025-06-10T17:15:52.919Z","avatar_url":"https://github.com/abilian.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ldif - parse and generate LDIF data (see [RFC 2849](https://tools.ietf.org/html/rfc2849)).\n\n![Commit activity](https://img.shields.io/github/commit-activity/m/abilian/ldif)\n![Code size in bytes](https://img.shields.io/github/languages/code-size/abilian/ldif)\n![License](https://img.shields.io/github/license/abilian/ldif)\n![Latest version](https://img.shields.io/pypi/v/ldif)\n![PyPI Downloads](https://img.shields.io/pypi/dm/ldif)\n\nThis is a fork of the `ldif` module from\n[python-ldap](http://www.python-ldap.org/) with python3/unicode support.\n\nOne of its benefits is that it's a pure-python package (you don't\ndepend on the `libldap2-dev` (or similar) package that needs to be\ninstalled on your laptop / test machine / production server).\n\nSee the last entry in [changelog](https://github.com/abilian/ldif/blob/main/CHANGES.rst) for a more complete list of\ndifferences.\n\nThis package only support Python 3 (\\\u003e= 3.7, actually).\n\n\n## Usage\n\nParse LDIF from a file (or `BytesIO`):\n\n```python\nfrom ldif import LDIFParser\nfrom pprint import pprint\n\nparser = LDIFParser(open(\"data.ldif\", \"rb\"))\nfor dn, record in parser.parse():\n    print('got entry record: %s' % dn)\n    pprint(record)\n```\n\nWrite LDIF to a file (or `BytesIO`):\n\n```python\nfrom ldif import LDIFWriter\n\nwriter = LDIFWriter(open(\"data.ldif\", \"wb\"))\nwriter.unparse(\"mail=alice@example.com\", {\n    \"cn\": [\"Alice Alison\"],\n    \"mail\": [\"alice@example.com\"],\n    \"objectclass\": [\"top\", \"person\"],\n})\n```\n\n\n## Unicode support\n\nThe stream object that is passed to parser or writer must be an ascii\nbyte stream.\n\nThe spec allows to include arbitrary data in base64 encoding or via URL.\nThere is no way of knowing the encoding of this data. To handle this,\nthere are two modes:\n\nBy default, the `LDIFParser` will try to interpret all values as UTF-8\nand leave only the ones that fail to decode as bytes. But you can also\npass an `encoding` of `None` to the constructor, in which case the\nparser will not try to do any conversion and return bytes directly.\n\n\n## Changelog\n\nSee [here](./CHANGES.rst)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabilian%2Fldif","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabilian%2Fldif","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabilian%2Fldif/lists"}