{ "info": { "author": "Ian Buchanan", "author_email": "ibuchanan@atlassian.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: DFSG approved", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Version Control" ], "description": "=============\n PyBitbucket\n=============\n\nA Python wrapper for the Bitbucket Cloud REST API.\nThis is not known to work with Bitbucket Server,\npreviously known as Stash.\nTo start working with this library, just do: :code:`pip install pybitbucket_fork`\n\n.. image:: https://img.shields.io/pypi/v/pybitbucket_fork.svg\n :target: https://pypi.python.org/pypi/pybitbucket_fork/0.12.0\n\n.. image:: https://img.shields.io/pypi/status/pybitbucket_fork.svg\n :target: https://pypi.python.org/pypi/pybitbucket_fork\n\n.. image:: https://img.shields.io/pypi/pyversions/pybitbucket_fork.svg\n :target: https://pypi.python.org/pypi/pybitbucket_fork\n\n.. image:: https://img.shields.io/pypi/l/pybitbucket_fork.svg\n :target: https://github.com/guyzmo/pybitbucket_fork/src/master/LICENSE.txt\n\n.. image:: https://img.shields.io/pypi/dm/pybitbucket_fork.svg\n :target: https://pypi.python.org/pypi/pybitbucket_fork\n\nThis is a fork of `pybitbucket `.\n\n---------------------\nAdopting this library\n---------------------\n\nAuthenticate\n============\n\nThe :code:`Authenticator` subclasses prepare API requests with credentials.\nThe simplest case is :code:`Anonymous` which connects with no credentials.\n:code:`Anonymous` can be used with an publicly available resources.\nFor private resources,\n:code:`BasicAuthenticator` uses email, username, and password as credentials.\nIf your client application has it's own mechanisms for working with these values,\nyou can subclass the :code:`BasicAuthenticator` to provide custom behavior.\n\nTo \"plug in\" your implementation or a standard one, just do:\n\n::\n\n bitbucket = Client(\n BasicAuthenticator(\n 'your_username_here',\n 'your_secret_password_here',\n 'pybitbucket@mailinator.com'))\n\nIf you have enabled `two-step verification `_,\nthen you will need to use an `app password `_ with the :code:`BasicAuthenticator`,\nnot your regular user password.\nThe :code:`OAuth2Authenticator` is intended as an example and superclass.\nIt may work for some command-line clients.\nOther clients like web applications\nwill need an appropriate implementation of :code:`obtain_authorization()`\nand perhaps may need to use a different grant types.\n\nFind Things\n===========\n\nFor example, to find all your snippets:\n\n::\n\n for snip in Snippet.find_snippets_for_role(client=bitbucket):\n print(snip)\n\nThe method says \"for role\" but, if not provided, it will use the default of owner.\nHence, all your snippets.\n\nIn general, finding things is done with a static find method on each type of resource.\nIf the resource is plural, like \"snippets\" above, then the find method is a generator.\nYou can use it with iterators or comprehensions.\nThe resources you can find are:\n\n* user and team\n* repository and snippet\n* pull request and comment\n* commit and build status\n* hook and branch restriction\n\nCreate Things\n=============\n\nFor example, to create a new snippet:\n\n::\n\n snip = Snippet.create(\n files=open_files([\"README.rst\"]),\n payload=SnippetPayload().add_title(\"My New Snippet\"),\n client=bitbucket)\n\nThe resources you can create are:\n\n* repository and snippet\n* pull request and comment\n* build status\n* hook and branch restriction\n\nExamine Things\n==============\n\nFor example, to examine attributes on a snippet:\n\n::\n\n snip = Snippet.find_snippet_by_id(\"Xqoz8\", bitbucket)\n s = '\\n'.join([\n \"id : {}\".format(snip.id),\n \"is_private : {}\".format(snip.is_private),\n \"title : {}\".format(snip.title),\n \"files : {}\".format(snip.filenames),\n \"created_on : {}\".format(snip.created_on),\n \"updated_on : {}\".format(snip.updated_on),\n \"scm : {}\".format(snip.scm),\n ]) if snip else 'Snippet not found.'\n print(s)\n\nWhat attributes are available?\nYou will not find them hardcoded in Python.\nThey are populated dynamically from the JSON response.\nYou can query the list via a convenience method:\n\n::\n\n snip = Snippet.find_snippet_by_id(\"Xqoz8\", bitbucket)\n print(snip.attributes())\n\nBeware. The attributes for the same resource may change depending on how you got to it.\n\nNavigate Relationships\n======================\n\nFor example, to list the commits for a snippet:\n\n::\n\n snip = Snippet.find_snippet_by_id(\"Xqoz8\", bitbucket)\n for commit in snip.commits():\n print(commit)\n\nWhat relationships are available?\nYou will not find them hardcoded in Python.\nThey are populated dynamically from the JSON response.\nYou can query the list via a convenience method:\n\n::\n\n snip = Snippet.find_snippet_by_id(\"Xqoz8\", bitbucket)\n print(snip.relationships())\n\nJust like attributes, the relationships for the same resource may change depending on how you got to it.\nIf you need the canonical resource with all attributes, use the :code:`self()` relationship:\n\n::\n\n snips = Snippet.find_snippets_for_role(client=bitbucket)\n one_snip = next(snips) # one_snip has no files relationship in this context.\n real_snip = next(one_snip.self())\n print(real_snip.files)\n\n----------\nDeveloping\n----------\n\nPython Virtual Environment Setup (for OS X)\n===========================================\n\nIt's not virtual like a virtual machine. More like a specialized container for a Python version and libraries.\n\n1. :code:`brew install python` This installs the latest version of Python 2.7 with a version of setuptools and pip. Unfortunately, those versions of setuptools and pip seem to be broken.\n2. :code:`pip install --upgrade --no-use-wheel setuptools`\n3. :code:`pip install --upgrade --no-use-wheel pip`\n4. :code:`pip install virtualenvwrapper`\n\nProject Setup\n=============\n\n1. Clone the repository and set it as the current working directory.\n2. *(Optional, but good practice)* Create a `virtual environment `_: :code:`mkvirtualenv python-bitbucket` Once created, use :code:`workon python-bitbucket` to restore the virtual environment.\n3. :code:`pip install -r requirements-dev.txt` Loads required libraries into the virtual environment.\n4. :code:`paver test_all` Run all the unit tests and analyze the source code.\n\n----\nTODO\n----\n\n* :code:`PUT` and :code:`DELETE` for :code:`snippet.watch` from `snippets Endpoint `_.\n* Wrap the `version 1 endpoints `_ for:\n - groups\n - group-privileges\n - invitations\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/guyzmo/pybitbucket", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "pybitbucket_fork", "package_url": "https://pypi.org/project/pybitbucket_fork/", "platform": "", "project_url": "https://pypi.org/project/pybitbucket_fork/", "project_urls": { "Homepage": "https://github.com/guyzmo/pybitbucket" }, "release_url": "https://pypi.org/project/pybitbucket_fork/0.12.2/", "requires_dist": null, "requires_python": "", "summary": "Fork of a Python wrapper for the Bitbucket API", "version": "0.12.2" }, "last_serial": 2839743, "releases": { "0.12.1": [ { "comment_text": "", "digests": { "md5": "671641736370b836d3069bdbc9b765a7", "sha256": "21bf4d1b360eafd447901eb89b71905c52982de614e8fc0b682e384b55eb8f67" }, "downloads": -1, "filename": "pybitbucket_fork-0.12.1-py3.6.egg", "has_sig": false, "md5_digest": "671641736370b836d3069bdbc9b765a7", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 76708, "upload_time": "2017-04-28T18:50:25", "url": "https://files.pythonhosted.org/packages/d0/f7/500c8132488a9072703ec5e25a4f0b6af3564d6a0f7812af08a2d9d22fb7/pybitbucket_fork-0.12.1-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "a98712de94ecde419afc9806af67864e", "sha256": "6a4049540ffaaa2d7ebc4f82af9fe96b7e703ea183f2a69cbbd4dc360d3cdf95" }, "downloads": -1, "filename": "pybitbucket_fork-0.12.1.tar.gz", "has_sig": false, "md5_digest": "a98712de94ecde419afc9806af67864e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 85858, "upload_time": "2017-04-28T18:50:27", "url": "https://files.pythonhosted.org/packages/28/bd/092a262f5d99c71b91274bf2fab15961d2540c186c105df841af50c015cc/pybitbucket_fork-0.12.1.tar.gz" } ], "0.12.2": [ { "comment_text": "", "digests": { "md5": "cf4d6d410b7c8f28c6a1e0f69d841b22", "sha256": "08d0fcf86955f630f9b4ea310d317138cac7a191e65135f7c3ab56cd1025a6c0" }, "downloads": -1, "filename": "pybitbucket_fork-0.12.2-py3.6.egg", "has_sig": false, "md5_digest": "cf4d6d410b7c8f28c6a1e0f69d841b22", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 76642, "upload_time": "2017-04-29T22:48:45", "url": "https://files.pythonhosted.org/packages/42/30/bbb0b00e7c84d793e34fdb79c4ac246c9758cdcf6ec56aba3cec07963608/pybitbucket_fork-0.12.2-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "902a9d41ae86ec1dde0f21f082991edf", "sha256": "6b1571b8386791039f38849fa96880ec6ff91ad5d47133cb93b36ee092e49431" }, "downloads": -1, "filename": "pybitbucket_fork-0.12.2.tar.gz", "has_sig": false, "md5_digest": "902a9d41ae86ec1dde0f21f082991edf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 85807, "upload_time": "2017-04-29T22:48:43", "url": "https://files.pythonhosted.org/packages/79/6b/013c6b59a84d4b49628d0e869151c60d9f68edfd722cf03639aaf62bbfe3/pybitbucket_fork-0.12.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cf4d6d410b7c8f28c6a1e0f69d841b22", "sha256": "08d0fcf86955f630f9b4ea310d317138cac7a191e65135f7c3ab56cd1025a6c0" }, "downloads": -1, "filename": "pybitbucket_fork-0.12.2-py3.6.egg", "has_sig": false, "md5_digest": "cf4d6d410b7c8f28c6a1e0f69d841b22", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 76642, "upload_time": "2017-04-29T22:48:45", "url": "https://files.pythonhosted.org/packages/42/30/bbb0b00e7c84d793e34fdb79c4ac246c9758cdcf6ec56aba3cec07963608/pybitbucket_fork-0.12.2-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "902a9d41ae86ec1dde0f21f082991edf", "sha256": "6b1571b8386791039f38849fa96880ec6ff91ad5d47133cb93b36ee092e49431" }, "downloads": -1, "filename": "pybitbucket_fork-0.12.2.tar.gz", "has_sig": false, "md5_digest": "902a9d41ae86ec1dde0f21f082991edf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 85807, "upload_time": "2017-04-29T22:48:43", "url": "https://files.pythonhosted.org/packages/79/6b/013c6b59a84d4b49628d0e869151c60d9f68edfd722cf03639aaf62bbfe3/pybitbucket_fork-0.12.2.tar.gz" } ] }