{ "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`\n\n.. image:: https://img.shields.io/pypi/v/pybitbucket.svg\n :target: https://pypi.python.org/pypi/pybitbucket/0.12.0\n\n.. image:: https://img.shields.io/pypi/status/pybitbucket.svg\n :target: https://pypi.python.org/pypi/pybitbucket\n\n.. image:: https://img.shields.io/pypi/pyversions/pybitbucket.svg\n :target: https://pypi.python.org/pypi/pybitbucket\n\n.. image:: https://img.shields.io/pypi/l/pybitbucket.svg\n :target: https://bitbucket.org/atlassian/python-bitbucket/src/master/LICENSE.txt\n\n.. image:: https://img.shields.io/pypi/dm/pybitbucket.svg\n :target: https://pypi.python.org/pypi/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", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/atlassian/python-bitbucket", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "pybitbucket", "package_url": "https://pypi.org/project/pybitbucket/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pybitbucket/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://bitbucket.org/atlassian/python-bitbucket" }, "release_url": "https://pypi.org/project/pybitbucket/0.12.0/", "requires_dist": null, "requires_python": null, "summary": "A Python wrapper for the Bitbucket API", "version": "0.12.0" }, "last_serial": 2496709, "releases": { "0.10.0": [ { "comment_text": "", "digests": { "md5": "e304e337e8005dee219e344f8466fcdb", "sha256": "d6c95ed5be54c1102f8f25429f90cea141bd6a95a51bbf443589732f55544952" }, "downloads": -1, "filename": "pybitbucket-0.10.0.tar.gz", "has_sig": false, "md5_digest": "e304e337e8005dee219e344f8466fcdb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 63165, "upload_time": "2016-03-01T03:26:22", "url": "https://files.pythonhosted.org/packages/0a/52/1ef636aa79eced5b988c2dc6cd1641f6384d58a12e05775f6ffdb0b8e45b/pybitbucket-0.10.0.tar.gz" } ], "0.11.0": [ { "comment_text": "", "digests": { "md5": "88cc17605e19a922b3f9776ca2379606", "sha256": "f980da95e2ba5d5e7943e178fdf9394b608095ce8ef2be8e774c24676621b3f4" }, "downloads": -1, "filename": "pybitbucket-0.11.0.tar.gz", "has_sig": false, "md5_digest": "88cc17605e19a922b3f9776ca2379606", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 69505, "upload_time": "2016-03-08T15:51:27", "url": "https://files.pythonhosted.org/packages/06/7f/884895723d57087d41727a08886f0a2698da396b1d90e0da069a12e4846f/pybitbucket-0.11.0.tar.gz" } ], "0.11.1": [ { "comment_text": "", "digests": { "md5": "6f8273611fc1633b02969308d71ffb45", "sha256": "1002f67b6e87e481db7c5eec5a9fed91c8f456e959e9702ade2f039a5e2c3889" }, "downloads": -1, "filename": "pybitbucket-0.11.1.tar.gz", "has_sig": false, "md5_digest": "6f8273611fc1633b02969308d71ffb45", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 69484, "upload_time": "2016-04-19T12:26:59", "url": "https://files.pythonhosted.org/packages/27/08/000be0afe234300f33eaa617eaf5ebae0f2041a9d79129b455d948ea3947/pybitbucket-0.11.1.tar.gz" } ], "0.12.0": [ { "comment_text": "", "digests": { "md5": "448fe44db9bfa73e90fe4c41c9351997", "sha256": "478ec45d6262971b15e78540aa62684af92acdfe2688536126140250c6ec9000" }, "downloads": -1, "filename": "pybitbucket-0.12.0.tar.gz", "has_sig": false, "md5_digest": "448fe44db9bfa73e90fe4c41c9351997", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 84451, "upload_time": "2016-12-02T23:20:20", "url": "https://files.pythonhosted.org/packages/10/83/d9b2ffabd1dd38510b32bdfeccaa6865cfd1b66ea79eb33c87dae6a9d9e1/pybitbucket-0.12.0.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "0aabd4dec6f66936bdf80a3788f15662", "sha256": "da76782bccbb08a31a428177b9157b76aead472475fdc77b828824db2e80f09e" }, "downloads": -1, "filename": "pybitbucket-0.5.0.tar.gz", "has_sig": false, "md5_digest": "0aabd4dec6f66936bdf80a3788f15662", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39792, "upload_time": "2015-10-30T20:57:55", "url": "https://files.pythonhosted.org/packages/79/2a/3bc6d3548f05b65c3c4de920ea528622d0e98f0211925c1be6a5181b357c/pybitbucket-0.5.0.tar.gz" } ], "0.6.0": [ { "comment_text": "", "digests": { "md5": "9b06dbf30dde72d9442976ad0a923110", "sha256": "65c927c3c65184039924e37335bae7eb71ebfad23b943546c03725f6c10630dc" }, "downloads": -1, "filename": "pybitbucket-0.6.0.tar.gz", "has_sig": false, "md5_digest": "9b06dbf30dde72d9442976ad0a923110", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 40754, "upload_time": "2015-11-26T18:40:26", "url": "https://files.pythonhosted.org/packages/b6/f8/ea2c6ee5ff7720c59eff6e39a0f3101b742eed9ad1b3973c77d9babbd14e/pybitbucket-0.6.0.tar.gz" } ], "0.6.1": [ { "comment_text": "", "digests": { "md5": "87af2c092d66ef831c8a6eb1177248d0", "sha256": "db675c830e0eaa541e8c91f105012d2d40ef2040e41f0d66b5c9529fc088c69b" }, "downloads": -1, "filename": "pybitbucket-0.6.1.tar.gz", "has_sig": false, "md5_digest": "87af2c092d66ef831c8a6eb1177248d0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 41027, "upload_time": "2015-12-01T20:41:21", "url": "https://files.pythonhosted.org/packages/47/60/553dc32bf19c0d46f3f291f198663b10d01e90fef8981143bbc2e34f8783/pybitbucket-0.6.1.tar.gz" } ], "0.7.0": [ { "comment_text": "", "digests": { "md5": "1ec667520fe2ce980f1d41b5d8cfe9d3", "sha256": "9c1cdd38c8fdb4322ebbd80a0da01dbb56c52f318817798f22662f075e887fe0" }, "downloads": -1, "filename": "pybitbucket-0.7.0.tar.gz", "has_sig": false, "md5_digest": "1ec667520fe2ce980f1d41b5d8cfe9d3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 43025, "upload_time": "2015-12-03T20:51:47", "url": "https://files.pythonhosted.org/packages/17/fd/064559c1e30c22dafa3507093a45d962f0f28fc37cff288caaf0f16500dc/pybitbucket-0.7.0.tar.gz" } ], "0.8.0": [ { "comment_text": "", "digests": { "md5": "0aa4c1057ebd8afb91ef168a06adc573", "sha256": "0102e2e9fbc689368904ff9177e4833b2facc19530586b1d13432df32034de0c" }, "downloads": -1, "filename": "pybitbucket-0.8.0.tar.gz", "has_sig": false, "md5_digest": "0aa4c1057ebd8afb91ef168a06adc573", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 50376, "upload_time": "2015-12-17T03:26:54", "url": "https://files.pythonhosted.org/packages/a2/96/738ecb492680ab2f04d90a646e8f680b2cbd8d15761c8f56413d6a019206/pybitbucket-0.8.0.tar.gz" } ], "0.8.1": [ { "comment_text": "", "digests": { "md5": "eece5ea9efda5ecdc967e440ac18584f", "sha256": "fbcfc9647642a5c8c47157f71892f58d526384161203c4d3991dcc935c827115" }, "downloads": -1, "filename": "pybitbucket-0.8.1.tar.gz", "has_sig": false, "md5_digest": "eece5ea9efda5ecdc967e440ac18584f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 50558, "upload_time": "2015-12-21T00:48:51", "url": "https://files.pythonhosted.org/packages/e5/d6/70f6c8a482c20ea3e85b5f6fa7c47541336c183e2188a9f57193a81b65b2/pybitbucket-0.8.1.tar.gz" } ], "0.9.0": [ { "comment_text": "", "digests": { "md5": "b61aba34989c0fcc52767850d705bf8e", "sha256": "07b9d4487a518cf64a36ec7b0f9518effd8e0b5ecc6b2743518612fe4b6f2719" }, "downloads": -1, "filename": "pybitbucket-0.9.0.tar.gz", "has_sig": false, "md5_digest": "b61aba34989c0fcc52767850d705bf8e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 53721, "upload_time": "2015-12-23T20:51:25", "url": "https://files.pythonhosted.org/packages/d7/e3/40963c1e5c47717b483023d2109ce6cca630bedbf2bf302e16c6c4c49faa/pybitbucket-0.9.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "448fe44db9bfa73e90fe4c41c9351997", "sha256": "478ec45d6262971b15e78540aa62684af92acdfe2688536126140250c6ec9000" }, "downloads": -1, "filename": "pybitbucket-0.12.0.tar.gz", "has_sig": false, "md5_digest": "448fe44db9bfa73e90fe4c41c9351997", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 84451, "upload_time": "2016-12-02T23:20:20", "url": "https://files.pythonhosted.org/packages/10/83/d9b2ffabd1dd38510b32bdfeccaa6865cfd1b66ea79eb33c87dae6a9d9e1/pybitbucket-0.12.0.tar.gz" } ] }