{ "info": { "author": "Larry Ogrodnek", "author_email": "larry@ogrodnek.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7" ], "description": "Username Validation\n========\n\n\nUsername validation methods extracted from [django-registration](https://github.com/ubernostrum/django-registration) for use outside of django apps (no dependency on django).\n\n[James Bennett](https://github.com/ubernostrum)'s post [Let\u2019s talk about usernames](https://www.b-list.org/weblog/2018/feb/11/usernames/) is a great write-up of both why and how to perform username validation.\n\nThis library performs both reserved name checking as well as [confusable homohomoglyph](https://confusable-homoglyphs.readthedocs.io/en/latest/readme.html) checking.\n\n# Usage\n\nAn `Exception` will be thrown if the name is confusable or reserved.\n\n## All checks\n\n```\nfrom username_validator import UsernameValidator\n\n# checks both reserved names and confusable\nUsernameValidator().validate_all(\"myname\")\n```\n\n## Confusable checks only\n\n```\nfrom username_validator import UsernameValidator\n\nUsernameValidator().validate_confusables_email(\"myname@something.com\")\nUsernameValidator().validate_confusables('j\\u0430ne_doe') # will throw exception\n\n```\n\n\n## Reserved name checks only\n\n\n```\nfrom username_validator import UsernameValidator\n\nUsernameValidator().validate_reserved(\"myname\")\n```\n\n## Custom reserved list\n\nYou can add to the reserved list with domain specific names or replace it completely. The default list is broken into categories and exposed, so you can pick and choose if you like.\n\n### Extend reserved list with our custom names\n\n```\nUsernameValidator(additional_names=[\"myspecialname\", \"myothername\"]).validate_reserved(\"myname\")\n```\n\n### Replace default list with subset\n\n```\nfrom username_validator import UsernameValidator, PROTOCOL_HOSTNAMES, SENSITIVE_FILENAMES\n\nUsernameValidator(reserved_names=(PROTOCOL_HOSTNAMES + SENSITIVE_FILENAMES)).validate_all(\"my_name\")\n```\n\n\n## Credit\n\nThis code is pretty much a straight copy-paste of [django-registration](https://github.com/ubernostrum/django-registration), removing django utility methods. Thank to [James Bennett](https://github.com/ubernostrum) for the excellent work.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ogrodnek/username_validator", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "username-validator", "package_url": "https://pypi.org/project/username-validator/", "platform": "", "project_url": "https://pypi.org/project/username-validator/", "project_urls": { "Homepage": "https://github.com/ogrodnek/username_validator" }, "release_url": "https://pypi.org/project/username-validator/0.0.1/", "requires_dist": null, "requires_python": "", "summary": "Username validation", "version": "0.0.1" }, "last_serial": 4364928, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "b5bc59c1b4bdc7c6b60d4e0d1df67362", "sha256": "2983ff1d17fcb222bf0d455e51251d9c42c70997ac82fe6d12aed8eed6369378" }, "downloads": -1, "filename": "username_validator-0.0.1.tar.gz", "has_sig": false, "md5_digest": "b5bc59c1b4bdc7c6b60d4e0d1df67362", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5023, "upload_time": "2018-10-11T15:40:10", "url": "https://files.pythonhosted.org/packages/48/7a/716c7c6b8c386a2d5de7774b01506b8fb10e56742826d9dd73ba77f48d54/username_validator-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b5bc59c1b4bdc7c6b60d4e0d1df67362", "sha256": "2983ff1d17fcb222bf0d455e51251d9c42c70997ac82fe6d12aed8eed6369378" }, "downloads": -1, "filename": "username_validator-0.0.1.tar.gz", "has_sig": false, "md5_digest": "b5bc59c1b4bdc7c6b60d4e0d1df67362", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5023, "upload_time": "2018-10-11T15:40:10", "url": "https://files.pythonhosted.org/packages/48/7a/716c7c6b8c386a2d5de7774b01506b8fb10e56742826d9dd73ba77f48d54/username_validator-0.0.1.tar.gz" } ] }