distinguishedname


Namedistinguishedname JSON
Version 1.0.2 PyPI version JSON
download
home_page
SummaryI parse and create RFC2253 compliant distinguished names (DNs)
upload_time2024-01-30 12:11:59
maintainer
docs_urlNone
author
requires_python>=3.8
license
keywords distinguishedname dn rdn rfc2253 pki
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # distinguishedname
Parse RFC 2253 Distinguished Names from strings and create strings from DNs (which
are implemented here as lists of RDNs - which are lists of strings in "TAG=VALUE" 
format).

# Examples
```python
>>> string_to_dn(r'CN=   James \"Bond\" +UID= 007, OU = 00 Division\, Special Services, O=MI5,C=UK')
[['CN=James "Bond"', 'UID=007'], ['OU=00 Division, Special Services'], ['O=MI5'], ['C=UK']]

>>> dn_to_string([['CN="Pinkie" Stevens', 'UID=1'], ['O= Name With Spaces ']])
'CN=\\"Pinkie\\" Stevens+UID=1,O=\\20Name With Spaces\\20'
```

# Rationale
I couldn't find any existing libraries for this.  In theory, [python-ldap][1] has a DN class that 
should be able to do this, but I've never been able to `pip install` it successfully.

This is essentially a single file, so you could also just drop this file into your project, ansible
module, CLI script or whatever.


[1]: https://www.python-ldap.org/en/python-ldap-3.4.3/ "python-ldap"



            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "distinguishedname",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "distinguishedname,dn,rdn,rfc2253,pki",
    "author": "",
    "author_email": "Mark Wright <markscottwright@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/57/d8/b8dc8266cd3a08a153c0ee5cfc8e475de0d4e63cac5ed409fce1807ac555/distinguishedname-1.0.2.tar.gz",
    "platform": null,
    "description": "# distinguishedname\nParse RFC 2253 Distinguished Names from strings and create strings from DNs (which\nare implemented here as lists of RDNs - which are lists of strings in \"TAG=VALUE\" \nformat).\n\n# Examples\n```python\n>>> string_to_dn(r'CN=   James \\\"Bond\\\" +UID= 007, OU = 00 Division\\, Special Services, O=MI5,C=UK')\n[['CN=James \"Bond\"', 'UID=007'], ['OU=00 Division, Special Services'], ['O=MI5'], ['C=UK']]\n\n>>> dn_to_string([['CN=\"Pinkie\" Stevens', 'UID=1'], ['O= Name With Spaces ']])\n'CN=\\\\\"Pinkie\\\\\" Stevens+UID=1,O=\\\\20Name With Spaces\\\\20'\n```\n\n# Rationale\nI couldn't find any existing libraries for this.  In theory, [python-ldap][1] has a DN class that \nshould be able to do this, but I've never been able to `pip install` it successfully.\n\nThis is essentially a single file, so you could also just drop this file into your project, ansible\nmodule, CLI script or whatever.\n\n\n[1]: https://www.python-ldap.org/en/python-ldap-3.4.3/ \"python-ldap\"\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "I parse and create RFC2253 compliant distinguished names (DNs)",
    "version": "1.0.2",
    "project_urls": {
        "Homepage": "https://github.com/markscottwright/distinguishedname",
        "Issues": "https://github.com/markscottwright/distinguishedname/issues"
    },
    "split_keywords": [
        "distinguishedname",
        "dn",
        "rdn",
        "rfc2253",
        "pki"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5451c4c0865c4152b8ba1f4e40b631786f06bb9a9c610454884e3dae5194fd6e",
                "md5": "027437343956c764cc7a6149750f95da",
                "sha256": "494010874e95d803b391c93222a949ff80ba66009648ff1d2c5f85a9c0de27f8"
            },
            "downloads": -1,
            "filename": "distinguishedname-1.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "027437343956c764cc7a6149750f95da",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 3562,
            "upload_time": "2024-01-30T12:11:57",
            "upload_time_iso_8601": "2024-01-30T12:11:57.944592Z",
            "url": "https://files.pythonhosted.org/packages/54/51/c4c0865c4152b8ba1f4e40b631786f06bb9a9c610454884e3dae5194fd6e/distinguishedname-1.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "57d8b8dc8266cd3a08a153c0ee5cfc8e475de0d4e63cac5ed409fce1807ac555",
                "md5": "474de2f2f74cff82dab7d654e33acef5",
                "sha256": "63ec0204ad7067f937ae70b7617ef0aa9cb42ac6c3decefd178e02ada6d1dec3"
            },
            "downloads": -1,
            "filename": "distinguishedname-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "474de2f2f74cff82dab7d654e33acef5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 3191,
            "upload_time": "2024-01-30T12:11:59",
            "upload_time_iso_8601": "2024-01-30T12:11:59.232983Z",
            "url": "https://files.pythonhosted.org/packages/57/d8/b8dc8266cd3a08a153c0ee5cfc8e475de0d4e63cac5ed409fce1807ac555/distinguishedname-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-30 12:11:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "markscottwright",
    "github_project": "distinguishedname",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "distinguishedname"
}
        
Elapsed time: 3.62739s