{ "info": { "author": "Ilya Otyutskiy", "author_email": "ilya.otyutskiy@icloud.com", "bugtrack_url": null, "classifiers": [], "description": "# htpasswd [![Build Status](https://secure.travis-ci.org/thesharp/htpasswd.png)](http://travis-ci.org/thesharp/htpasswd)\n\n## Description\n**htpasswd** is a library for working with htpasswd user (only basic authorization) and group files. It supports CRYPT and MD5 encryption methods. To actually use MD5 encryption method you *MUST* have an ``openssl`` binary installed into system ``$PATH``.\n\n## Dependencies\n- Python 2.7 or 3.3 or 3.4\n- [orderedmultidict](http://pypi.python.org/pypi/orderedmultidict/0.7) >= 0.7\n- [future](https://pypi.python.org/pypi/future)\n- [nose](http://pypi.python.org/pypi/nose/) >= 1.1.2 (for tests)\n\n## Sample usage\n import htpasswd\n\n with htpasswd.Basic(\"/path/to/user.db\") as userdb:\n try:\n userdb.add(\"bob\", \"password\")\n except htpasswd.basic.UserExists, e:\n print e\n try:\n userdb.change_password(\"alice\", \"newpassword\")\n except htpasswd.basic.UserNotExists, e:\n print e\n\n with htpasswd.Group(\"/path/to/group.db\") as groupdb:\n try:\n groupdb.add_user(\"bob\", \"admins\")\n except htpasswd.group.UserAlreadyInAGroup, e:\n print e\n try:\n groupdb.delete_user(\"alice\", \"managers\")\n except htpasswd.group.UserNotInAGroup, e:\n print e\n\nTo use MD5 encryotion, add ``mode=\"md5\"`` to the constructor:\n\n with htpasswd.Basic(\"/path/to/user.db\", mode=\"md5\") as userdb\n\n## Provided methods\n\n### Basic\n- ``__contains__(user)``\n- ``users``\n- ``add(user, password)``\n- ``pop(user)``\n- ``change_password(user, password)``\n- ``_encrypt_password(password)``\n\n### Group\n- ``__contains__(group)``\n- ``groups``\n- ``is_user_in(user, group)``\n- ``add_user(user, group)``\n- ``delete_user(user, group)``\n\n## Exceptions\n\n### UserExists\nRaised by ``Basic.add`` if user already exists.\n\n### UserNotExists\nRaised by ``Basic.delete`` and ``Basic.change_password`` if there is no such user.\n\n### GroupNotExists\nRaised by ``Group.delete_user`` if there is no such group.\n\n### UserAlreadyInAGroup\nRaised by ``Group.add_user`` if user is already in a group.\n\n### UserNotInAGroup\nRaised by ``Group.delete_user`` if user isn't in a group.\n\n### UnknownEncryptionMode\nRaised by _encrypt_password if mode is not 'crypt' or 'md5'.\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/thesharp/htpasswd", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "htpasswd", "package_url": "https://pypi.org/project/htpasswd/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/htpasswd/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/thesharp/htpasswd" }, "release_url": "https://pypi.org/project/htpasswd/2.3/", "requires_dist": null, "requires_python": null, "summary": "Library to work with htpasswd user (basic authorization) and group files.", "version": "2.3" }, "last_serial": 1530996, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "a4a133a97f979a07e24d06e2e929c136", "sha256": "ac123b50fcc5e854d3e38d2125e9fcc89b383a8dfea3c90079486ea298e65e45" }, "downloads": -1, "filename": "htpasswd-1.0.tar.gz", "has_sig": false, "md5_digest": "a4a133a97f979a07e24d06e2e929c136", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2733, "upload_time": "2012-08-05T00:22:16", "url": "https://files.pythonhosted.org/packages/53/6c/5d0cffbb83155397773c79c555b8e9987d472674eb823a44e4a5bfe48040/htpasswd-1.0.tar.gz" } ], "2.0": [ { "comment_text": "", "digests": { "md5": "1c6be2b7fb5c219be00d4b2fb6e4f0ed", "sha256": "21647d04919f6f5a7f59b4948a20f6de0bcc96fc7480ac0213faae4661ec216d" }, "downloads": -1, "filename": "htpasswd-2.0.tar.gz", "has_sig": false, "md5_digest": "1c6be2b7fb5c219be00d4b2fb6e4f0ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3531, "upload_time": "2012-08-06T00:24:12", "url": "https://files.pythonhosted.org/packages/3b/f1/9e32d3344c83599da4c17137b7d0a03efac492d95b06dfafc774666d5ac9/htpasswd-2.0.tar.gz" } ], "2.1": [ { "comment_text": "", "digests": { "md5": "77259f85ca92615e1035cd29358244b1", "sha256": "c40d481ea9c6025317af15fe4de03b39400c50df797ad39bb3331ad7535a4fe8" }, "downloads": -1, "filename": "htpasswd-2.1.tar.gz", "has_sig": false, "md5_digest": "77259f85ca92615e1035cd29358244b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3494, "upload_time": "2015-05-02T20:13:33", "url": "https://files.pythonhosted.org/packages/3a/4a/f158df1ea97d77321b526bf6dbd9f011015bae8ba082016885ab2fa58dad/htpasswd-2.1.tar.gz" } ], "2.3": [ { "comment_text": "", "digests": { "md5": "73607c4b3443786dbc591616578c63ea", "sha256": "565f0b647a32549c663ccfddd1f501891daaf29242bbc6174bdd448120383e3d" }, "downloads": -1, "filename": "htpasswd-2.3.tar.gz", "has_sig": false, "md5_digest": "73607c4b3443786dbc591616578c63ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3837, "upload_time": "2015-05-03T00:04:43", "url": "https://files.pythonhosted.org/packages/b9/2f/8b76f8b77125b75c3532966f3291f9e8787268be65fc4c9694887cba9375/htpasswd-2.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "73607c4b3443786dbc591616578c63ea", "sha256": "565f0b647a32549c663ccfddd1f501891daaf29242bbc6174bdd448120383e3d" }, "downloads": -1, "filename": "htpasswd-2.3.tar.gz", "has_sig": false, "md5_digest": "73607c4b3443786dbc591616578c63ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3837, "upload_time": "2015-05-03T00:04:43", "url": "https://files.pythonhosted.org/packages/b9/2f/8b76f8b77125b75c3532966f3291f9e8787268be65fc4c9694887cba9375/htpasswd-2.3.tar.gz" } ] }