This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

# htpasswd [![Build Status](https://secure.travis-ci.org/thesharp/htpasswd.png)](http://travis-ci.org/thesharp/htpasswd)

## Description 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.

## Dependencies - Python 2.7 or 3.3 or 3.4 - [orderedmultidict](http://pypi.python.org/pypi/orderedmultidict/0.7) >= 0.7 - [future](https://pypi.python.org/pypi/future) - [nose](http://pypi.python.org/pypi/nose/) >= 1.1.2 (for tests)

## Sample usage

import htpasswd

with htpasswd.Basic(“/path/to/user.db”) as userdb:
try:
userdb.add(“bob”, “password”)
except htpasswd.basic.UserExists, e:
print e
try:
userdb.change_password(“alice”, “newpassword”)
except htpasswd.basic.UserNotExists, e:
print e
with htpasswd.Group(“/path/to/group.db”) as groupdb:
try:
groupdb.add_user(“bob”, “admins”)
except htpasswd.group.UserAlreadyInAGroup, e:
print e
try:
groupdb.delete_user(“alice”, “managers”)
except htpasswd.group.UserNotInAGroup, e:
print e

To use MD5 encryotion, add mode="md5" to the constructor:

with htpasswd.Basic(“/path/to/user.db”, mode=”md5”) as userdb

## Provided methods

### Basic - __contains__(user) - users - add(user, password) - pop(user) - change_password(user, password) - _encrypt_password(password)

### Group - __contains__(group) - groups - is_user_in(user, group) - add_user(user, group) - delete_user(user,  group)

## Exceptions

### UserExists Raised by Basic.add if user already exists.

### UserNotExists Raised by Basic.delete and Basic.change_password if there is no such user.

### GroupNotExists Raised by Group.delete_user if there is no such group.

### UserAlreadyInAGroup Raised by Group.add_user if user is already in a group.

### UserNotInAGroup Raised by Group.delete_user if user isn’t in a group.

### UnknownEncryptionMode Raised by _encrypt_password if mode is not ‘crypt’ or ‘md5’.

Release History

Release History

2.3

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

2.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

2.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
htpasswd-2.3.tar.gz (3.8 kB) Copy SHA256 Checksum SHA256 Source May 3, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting