Commits

Jason Moiron committed 144c634

initial checkin of a working api with no tests or anything

  • Participants

Comments (0)

Files changed (16)

+syntax: glob
+
+tags
+*.pyc
+*.swp
+*.swo
+*.egg-info*
+docs/_build*
+build
+dist
+Copyright (c) 2010 Jason Moiron and Contributors
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+include README.rst
+include LICENSE
+python-bitbucket
+-----------
+
+

File bitbucket/__init__.py

+
+VERSION = "0.1"

File bitbucket/api.py

+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+"""Bitbucket API wrapper.  Written to be somewhat like py-github:
+
+https://github.com/dustin/py-github
+
+"""
+
+from urllib2 import Request, urlopen
+from urllib import urlencode
+from functools import wraps
+
+try:
+    import json
+except ImportError:
+    import simplejson as json
+
+api_base = 'https://api.bitbucket.org/1.0/'
+api_toplevel = 'https://api.bitbucket.org/'
+
+class AuthenticationRequired(Exception):
+    pass
+
+def requires_authentication(method):
+    @wraps(method)
+    def wrapper(self, *args, **kwargs):
+        username = self.bb.username if hasattr(self, 'bb') else self.username
+        password = self.bb.password if hasattr(self, 'bb') else self.password
+        if not all((username, password)):
+            raise AuthenticationRequired("%s requires authentication" % method.__name__)
+        return method(self, *args, **kwargs)
+    return wrapper
+
+def smart_encode(**kwargs):
+    """Urlencode's provided keyword arguments.  If any kwargs are None, it does
+    not include those."""
+    args = dict(kwargs)
+    for k,v in args.items():
+        if v is None:
+            del args[k]
+    if not args:
+        return ''
+    return urlencode(args)
+
+
+class BitBucket(object):
+    """Main bitbucket class.  Use an instantiated version of this class
+    to make calls against the REST API."""
+    def __init__(self, username='', password=''):
+        self.username = username
+        self.password = password
+        # extended API support
+
+    def build_request(self, url):
+        if not all((self.username, self.password)):
+            return Request(url)
+        auth = '%s:%s' % (self.username, self.password)
+        auth = {'Authorization': 'Basic %s' % (auth.encode('base64').strip())}
+        return Request(url, None, auth)
+
+    def load_url(self, url, quiet=False):
+        request = self.build_request(url)
+        try:
+            result = urlopen(request).read()
+        except:
+            if not quiet:
+                import traceback
+                traceback.print_exc()
+                print "url was: %s" % url
+            result = "[]"
+        return result
+
+    def user(self, username):
+        return User(self, username)
+
+    def repository(self, username, slug):
+        return Repository(self, username, slug)
+
+    @requires_authentication
+    def emails(self):
+        """Returns a list of configured email addresses for the authenticated user."""
+        url = api_base + 'emails/'
+        return json.loads(self.load_url(url))
+
+class User(object):
+    """API encapsulation for user related bitbucket queries."""
+    def __init__(self, bb, username):
+        self.bb = bb
+        self.username = username
+
+    def repository(self, slug):
+        return Repository(self.bb, self.username, slug)
+
+    def repositories(self):
+        user_data = self.get()
+        return user_data['repositories']
+
+    def events(self):
+        url = api_base + 'users/%s/events/' % self.username
+        return json.loads(self.bb.load_url(url))
+
+    def get(self):
+        url = api_base + 'users/%s/' % self.username
+        return json.loads(self.bb.load_url(url))
+
+    def __repr__(self):
+        return '<User: %s>' % self.username
+
+class Repository(object):
+    def __init__(self, bb, username, slug):
+        self.bb = bb
+        self.username = username
+        self.slug = slug
+        self.base_url = api_base + 'repositories/%s/%s/' % (self.username, self.slug)
+
+    def get(self):
+        return json.loads(self.bb.load_url(self.base_url))
+
+    def changeset(self, revision):
+        """Get one changeset from a repos."""
+        url = self.base_url + 'changesets/%s/' % (revision)
+        return json.loads(self.bb.load_url(url))
+
+    def changesets(self, limit=None):
+        """Get information about changesets on a repository."""
+        url = self.base_url + 'changesets/'
+        query = smart_encode(limit=limit)
+        if query: url += '?%s' % query
+        return json.loads(self.bb.load_url(url, quiet=True))
+
+    def tags(self):
+        """Get a list of tags for a repository."""
+        url = self.base_url + 'tags/'
+        return json.loads(self.bb.load_url(url))
+
+    def branches(self):
+        """Get a list of branches for a repository."""
+        url = self.base_url + 'branches/'
+        return json.loads(self.bb.load_url(url))
+
+    def issue(self, number):
+        return Issue(self.bb, self.username, self.slug, number)
+
+    def issues(self, start=None, limit=None):
+        url = self.base_url + 'issues/'
+        query = smart_encode(start=start, limit=limit)
+        if query: url += '?%s' % query
+        return json.loads(self.bb.load_url(url))
+
+    def events(self):
+        url = self.base_url + 'events/'
+        return json.loads(self.bb.load_url(url))
+
+    def followers(self):
+        url = self.base_url + 'followers/'
+        return json.loads(self.bb.load_url(url))
+
+    def __repr__(self):
+        return '<Repository: %s\'s %s>' % (self.username, self.slug)
+
+class Issue(object):
+    def __init__(self, bb, username, slug, number):
+        self.bb = bb
+        self.username = username
+        self.slug = slug
+        self.number = number
+        self.base_url = api_base + 'repositories/%s/%s/issues/%s/' % (username, slug, number)
+
+    def get(self):
+        return json.loads(self.bb.load_url(self.base_url))
+
+    def followers(self):
+        url = self.base_url + 'followers/'
+        return json.loads(self.bb.load_url(url))
+
+    def __repr__(self):
+        return '<Issue #%s on %s\'s %s>' % (self.number, self.username, self.slug)
+

File docs/Makefile

+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS    =
+SPHINXBUILD   = sphinx-build
+PAPER         =
+BUILDDIR      = _build
+
+# Internal variables.
+PAPEROPT_a4     = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest distro zip
+
+help:
+	@echo "Please use \`make <target>' where <target> is one of"
+	@echo "  html      to make standalone HTML files"
+	@echo "  dirhtml   to make HTML files named index.html in directories"
+	@echo "  pickle    to make pickle files"
+	@echo "  json      to make JSON files"
+	@echo "  htmlhelp  to make HTML files and a HTML help project"
+	@echo "  qthelp    to make HTML files and a qthelp project"
+	@echo "  latex     to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+	@echo "  changes   to make an overview of all changed/added/deprecated items"
+	@echo "  linkcheck to check all external links for integrity"
+	@echo "  doctest   to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+	-rm -rf $(BUILDDIR)/*
+
+html:
+	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+pickle:
+	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+	@echo
+	@echo "Build finished; now you can process the pickle files."
+
+json:
+	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+	@echo
+	@echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+	@echo
+	@echo "Build finished; now you can run HTML Help Workshop with the" \
+	      ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+	@echo
+	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
+	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/django-selector.qhcp"
+	@echo "To view the help file:"
+	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/django-selector.qhc"
+
+latex:
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo
+	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+	@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
+	      "run these through (pdf)latex."
+
+changes:
+	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+	@echo
+	@echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+	@echo
+	@echo "Link check complete; look for any errors in the above output " \
+	      "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+	@echo "Testing of doctests in the sources finished, look at the " \
+	      "results in $(BUILDDIR)/doctest/output.txt."
+
+distro: html
+	@echo
+	@echo "Pushing documents to http://dev.jmoiron.net/python-bitbucket/"
+	scp -r $(BUILDDIR)/html/* jmoiron@jmoiron.net:dev.jmoiron.net/python-bitbucket/
+
+zip: html
+	@echo
+	@echo "Making zip file 'python-bitbucket.zip'"
+	cd $(BUILDDIR)/html/; zip -r 'python-bitbucket.zip' *
+	mv $(BUILDDIR)/html/'python-bitbucket.zip' .

File docs/_theme/nature/static/nature.css_t

+/**
+ * Sphinx stylesheet -- default theme
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ */
+ 
+@import url("basic.css");
+ 
+/* -- page layout ----------------------------------------------------------- */
+ 
+body {
+    font-family: Arial, sans-serif;
+    font-size: 100%;
+    background-color: #111111;
+    color: #555555;
+    margin: 0;
+    padding: 0;
+}
+
+div.documentwrapper {
+    float: left;
+    width: 100%;
+}
+
+div.bodywrapper {
+    margin: 0 0 0 300px;
+}
+
+hr{
+    border: 1px solid #B1B4B6;
+}
+ 
+div.document {
+    background-color: #fafafa;
+}
+ 
+div.body {
+    background-color: #ffffff;
+    color: #3E4349;
+    padding: 1em 30px 30px 30px;
+    font-size: 0.9em;
+}
+ 
+div.footer {
+    color: #555;
+    width: 100%;
+    padding: 13px 0;
+    text-align: center;
+    font-size: 75%;
+}
+ 
+div.footer a {
+    color: #444444;
+}
+ 
+div.related {
+    background-color: #6BA81E;
+    line-height: 36px;
+    color: #ffffff;
+    text-shadow: 0px 1px 0 #444444;
+    font-size: 1.1em;
+}
+ 
+div.related a {
+    color: #E2F3CC;
+}
+
+div.related .right {
+    font-size: 0.9em;
+}
+
+div.sphinxsidebar {
+    font-size: 0.9em;
+    line-height: 1.5em;
+    width: 300px
+}
+
+div.sphinxsidebarwrapper{
+    padding: 20px 0;
+}
+ 
+div.sphinxsidebar h3,
+div.sphinxsidebar h4 {
+    font-family: Arial, sans-serif;
+    color: #222222;
+    font-size: 1.2em;
+    font-weight: bold;
+    margin: 0;
+    padding: 5px 10px;
+    text-shadow: 1px 1px 0 white
+}
+
+div.sphinxsidebar h3 a {
+    color: #444444;
+}
+
+div.sphinxsidebar p {
+    color: #888888;
+    padding: 5px 20px;
+    margin: 0.5em 0px;
+}
+ 
+div.sphinxsidebar p.topless {
+}
+ 
+div.sphinxsidebar ul {
+    margin: 10px 10px 10px 20px;
+    padding: 0;
+    color: #000000;
+}
+ 
+div.sphinxsidebar a {
+    color: #444444;
+}
+
+div.sphinxsidebar a:hover {
+    color: #E32E00;
+}
+
+div.sphinxsidebar input {
+    border: 1px solid #cccccc;
+    font-family: sans-serif;
+    font-size: 1.1em;
+    padding: 0.15em 0.3em;
+}
+
+div.sphinxsidebar input[type=text]{
+    margin-left: 20px;
+}
+ 
+/* -- body styles ----------------------------------------------------------- */
+ 
+a {
+    color: #005B81;
+    text-decoration: none;
+}
+ 
+a:hover {
+    color: #E32E00;
+}
+ 
+div.body h1,
+div.body h2,
+div.body h3,
+div.body h4,
+div.body h5,
+div.body h6 {
+    font-family: Arial, sans-serif;
+    font-weight: normal;
+    color: #212224;
+    margin: 30px 0px 10px 0px;
+    padding: 5px 0 5px 0px;
+    text-shadow: 0px 1px 0 white;
+    border-bottom: 1px solid #C8D5E3;
+}
+ 
+div.body h1 { margin-top: 0; font-size: 200%; }
+div.body h2 { font-size: 150%; }
+div.body h3 { font-size: 120%; }
+div.body h4 { font-size: 110%; }
+div.body h5 { font-size: 100%; }
+div.body h6 { font-size: 100%; }
+ 
+a.headerlink {
+    color: #c60f0f;
+    font-size: 0.8em;
+    padding: 0 4px 0 4px;
+    text-decoration: none;
+}
+ 
+a.headerlink:hover {
+    background-color: #c60f0f;
+    color: white;
+}
+ 
+div.body p, div.body dd, div.body li {
+    line-height: 1.8em;
+}
+ 
+div.admonition p.admonition-title + p {
+    display: inline;
+}
+
+div.highlight{
+    background-color: white;
+}
+
+div.note {
+    background-color: #eeeeee;
+    border: 1px solid #cccccc;
+}
+ 
+div.seealso {
+    background-color: #ffffcc;
+    border: 1px solid #ffff66;
+}
+ 
+div.topic {
+    background-color: #fafafa;
+    border-width: 0;
+}
+ 
+div.warning {
+    background-color: #ffe4e4;
+    border: 1px solid #ff6666;
+}
+ 
+p.admonition-title {
+    display: inline;
+}
+ 
+p.admonition-title:after {
+    content: ":";
+}
+ 
+pre {
+    padding: 10px;
+    background-color: #fafafa;
+    color: #222222;
+    line-height: 1.5em;
+    font-size: 1.1em;
+    margin: 1.5em 0 1.5em 0;
+    -webkit-box-shadow: 0px 0px 4px #d8d8d8;
+    -moz-box-shadow: 0px 0px 4px #d8d8d8;
+    box-shadow: 0px 0px 4px #d8d8d8;
+}
+ 
+tt {
+    color: #222222;
+    padding: 1px 2px;
+    font-size: 1.2em;
+    font-family: monospace;
+}
+
+#table-of-contents ul {
+    padding-left: 2em;
+}
+

File docs/_theme/nature/static/pygments.css

+.c { color: #999988; font-style: italic } /* Comment */
+.k { font-weight: bold } /* Keyword */
+.o { font-weight: bold } /* Operator */
+.cm { color: #999988; font-style: italic } /* Comment.Multiline */
+.cp { color: #999999; font-weight: bold } /* Comment.preproc */
+.c1 { color: #999988; font-style: italic } /* Comment.Single */
+.gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
+.ge { font-style: italic } /* Generic.Emph */
+.gr { color: #aa0000 } /* Generic.Error */
+.gh { color: #999999 } /* Generic.Heading */
+.gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
+.go { color: #111 } /* Generic.Output */
+.gp { color: #555555 } /* Generic.Prompt */
+.gs { font-weight: bold } /* Generic.Strong */
+.gu { color: #aaaaaa } /* Generic.Subheading */
+.gt { color: #aa0000 } /* Generic.Traceback */
+.kc { font-weight: bold } /* Keyword.Constant */
+.kd { font-weight: bold } /* Keyword.Declaration */
+.kp { font-weight: bold } /* Keyword.Pseudo */
+.kr { font-weight: bold } /* Keyword.Reserved */
+.kt { color: #445588; font-weight: bold } /* Keyword.Type */
+.m { color: #009999 } /* Literal.Number */
+.s { color: #bb8844 } /* Literal.String */
+.na { color: #008080 } /* Name.Attribute */
+.nb { color: #999999 } /* Name.Builtin */
+.nc { color: #445588; font-weight: bold } /* Name.Class */
+.no { color: #ff99ff } /* Name.Constant */
+.ni { color: #800080 } /* Name.Entity */
+.ne { color: #990000; font-weight: bold } /* Name.Exception */
+.nf { color: #990000; font-weight: bold } /* Name.Function */
+.nn { color: #555555 } /* Name.Namespace */
+.nt { color: #000080 } /* Name.Tag */
+.nv { color: purple } /* Name.Variable */
+.ow { font-weight: bold } /* Operator.Word */
+.mf { color: #009999 } /* Literal.Number.Float */
+.mh { color: #009999 } /* Literal.Number.Hex */
+.mi { color: #009999 } /* Literal.Number.Integer */
+.mo { color: #009999 } /* Literal.Number.Oct */
+.sb { color: #bb8844 } /* Literal.String.Backtick */
+.sc { color: #bb8844 } /* Literal.String.Char */
+.sd { color: #bb8844 } /* Literal.String.Doc */
+.s2 { color: #bb8844 } /* Literal.String.Double */
+.se { color: #bb8844 } /* Literal.String.Escape */
+.sh { color: #bb8844 } /* Literal.String.Heredoc */
+.si { color: #bb8844 } /* Literal.String.Interpol */
+.sx { color: #bb8844 } /* Literal.String.Other */
+.sr { color: #808000 } /* Literal.String.Regex */
+.s1 { color: #bb8844 } /* Literal.String.Single */
+.ss { color: #bb8844 } /* Literal.String.Symbol */
+.bp { color: #999999 } /* Name.Builtin.Pseudo */
+.vc { color: #ff99ff } /* Name.Variable.Class */
+.vg { color: #ff99ff } /* Name.Variable.Global */
+.vi { color: #ff99ff } /* Name.Variable.Instance */
+.il { color: #009999 } /* Literal.Number.Integer.Long */

File docs/_theme/nature/theme.conf

+[theme]
+inherit = basic
+stylesheet = nature.css
+pygments_style = tango

File docs/conf.py

+# -*- coding: utf-8 -*-
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+from datetime import datetime
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+projpath = os.path.abspath('..')
+sys.path.append(projpath)
+
+# -- General configuration -----------------------------------------------------
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.autodoc']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = 'python-bitbucket'
+copyright = u'2010 Jason Moiron'
+
+# The short X.Y version.
+version = '0.1'
+# The full version, including alpha/beta/rc tags.
+version = None
+for line in open(os.path.join(projpath, 'setup.py'), 'r'):
+    if line.startswith('version'):
+        exec line
+if version is None:
+    version = '0.1'
+# The full version, including alpha/beta/rc tags.
+release = version
+
+print ("Building release: %s, version: %s" % (release, version))
+
+# List of documents that shouldn't be included in the build.
+#unused_docs = []
+
+# List of directories, relative to source directory, that shouldn't be searched
+# for source files.
+exclude_trees = ['_build']
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages.  Major themes that come with
+# Sphinx are currently 'default' and 'sphinxdoc'.
+#html_theme = 'default'
+html_theme = 'nature'
+html_theme_path = ['_theme']
+#html_theme_options = {}
+
+# The name for this set of Sphinx documents.  If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar.  Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_use_modindex = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it.  The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = ''
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'python-bitbucketdoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+# The paper size ('letter' or 'a4').
+#latex_paper_size = 'letter'
+
+# The font size ('10pt', '11pt' or '12pt').
+#latex_font_size = '10pt'
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+  ('index', 'python-bitbucket.tex', u'python-bitbucket Documentation',
+   u'Jason Moiron', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# Additional stuff for the LaTeX preamble.
+#latex_preamble = ''
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_use_modindex = True
+

File docs/index.rst

+.. python-bitbucket documentation master file, created by sphinx-quickstart.
+   You can adapt this file completely to your liking, but it should at least
+   contain the root `toctree` directive.
+
+python-bitbucket
+-----------
+
+.. automodule:: python-bitbucket
+
+.. highlight:: sh
+
+You can install python-bitbucket with pip::
+
+    pip install python-bitbucket
+
+You can fork python-bitbucket `from its hg repository
+<http://bitbucket.org/jmoiron/python-bitbucket/>`_::
+
+    hg clone http://bitbucket.org/jmoiron/python-bitbucket/
+
+.. highlight:: python
+[egg_info]
+tag_build = dev
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+"""Setup script for python-bitbucket."""
+
+from setuptools import setup, find_packages
+import sys, os
+
+version = '0.1'
+
+# some trove classifiers:
+
+# License :: OSI Approved :: MIT License
+# Intended Audience :: Developers
+# Operating System :: POSIX
+
+setup(
+    name='python-bitbucket',
+    version=version,
+    description="python library for bitbucket API access",
+    long_description=open('README.rst').read(),
+    # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
+    classifiers=[
+        'Development Status :: 1 - Planning',
+        'License :: OSI Approved :: MIT License',
+        'Intended Audience :: Developers',
+        'Operating System :: POSIX',
+    ],
+    keywords='bitbucket REST API',
+    author='Jason Moiron',
+    author_email='jmoiron@jmoiron.net',
+    url='http://bitbucket.org/jmoiron/python-bitbucket',
+    license='MIT',
+    packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
+    include_package_data=True,
+    zip_safe=False,
+    test_suite="tests",
+    install_requires=[
+      # -*- Extra requirements: -*-
+    ],
+    entry_points="""
+    # -*- Entry points: -*-
+    """,
+)

File tests/__init__.py

Empty file added.

File tests/pythonbitbucket.py

+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+"""pythonbitbucket tests."""
+
+from unittest import TestCase
+
+class pythonbitbucketTest(TestCase):
+    def setUp(self):
+        pass
+
+    def tearDown(self):
+        pass
+