Sheeprider/BitBucket-api — pull request #4 by daredevildave (2013-03-18 17:40:03+00:00)
Title: Add support for OAuth authentication

Instead of using a password to authenticate you can now supply OAuth credentials.

```python```
from bitbucket import Bitbucket
import webbrowser

bb = Bitbucket(username)

# Start authorization
(success, msg) = bb.authorize(consumer_key, consumer_secret, u'http://localhost/')
if not success:
sys.exit(msg)

# Redirect user to web browser
webbrowser.open(bb.url('AUTHENTICATE', token=bb.access_token))

# Copy the verifier field from the URL in the browser into the console
oauth_verifier = raw_input('Enter verifier from url [oauth_verifier]')

# Finalize authorization
(success, msg) = bb.verify(oauth_verifier)
``````