atlassian-api-py


Nameatlassian-api-py JSON
Version 0.5.2 PyPI version JSON
download
home_page
SummaryPython Wrapper for Atlassian REST API
upload_time2024-01-23 12:33:39
maintainer
docs_urlNone
authorPeter Shen
requires_python>=3.8
licenseMIT License
keywords atlassian jira bitbucket confluence rest api
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Python Wrapper for Atlassian REST API

[![PyPI](https://img.shields.io/pypi/v/atlassian-api-py)](https://pypi.org/project/atlassian-api-py/)
[![CodeFactor](https://www.codefactor.io/repository/github/shenxianpeng/atlassian-api-py/badge/main?s=3f5b565625069f5c5ab303a02b120197cd3abdde)](https://www.codefactor.io/repository/github/shenxianpeng/atlassian-api-py/overview/main)
![PyPI - Downloads](https://img.shields.io/pypi/dw/atlassian-api-py)
[![commit-check](https://img.shields.io/badge/commit--check-enabled-brightgreen?logo=Git&logoColor=white)](https://github.com/commit-check/commit-check)

## What is this?

This is a package wrapper of Atlassian REST API written in Python, currently, it supports JIRA and Bitbucket.

This package was created to simplify the implementation of integration with JIRA and Bitbucket.

## QuickStart

## Install from PyPI

```bash
# install
$ pip install atlassian-api-py

# upgrade to latest
$ pip install atlassian-api-py --upgrade
```

### Establish connection

Connect with username and password

```python
>>> from atlassian import Jira
>>> jira = Jira(url='https://jira.company.com', username="username", password="password")
```

Or connect with token

```python
>>> from atlassian import Jira
>>> jira = Jira(url='https://jira.company.com', token="yourToken")
```

Or write your credentials in a configuration file `config.ini`, and get the credential though the configuration file.

```markdown
[jira]
url = https://jira.company.com
username = username
password = password
# Or
token = yourToken
```

```python
>>> import configparser
>>> config = configparser.ConfigParser()
>>> config.read('config.ini')

>>> jira_url = config['jira']['url']
>>> jira_usr = config['jira']['username']
>>> jira_psw = config['jira']['password']
>>> jira_token = config['jira']['token']
```

### Get fields

Next, you can get the issue's fields as follow:

```python
>>> issue = jira.issue('TEST-1')
>>> print(issue.fields.status.name)
Triage
>>> print(issue.fields.description)
this is a demo jira ticket
>>> print(issue.fields.status.name)
Triage
>>> print(issue.fields.issuetype.name)
Bug
```

### More fields

```python
>>> print(issue.id)
1684517
>>> print(issue.key)
TEST-1
>>> print(issue.fields.assignee.key)
xpshen
>>> print(issue.fields.summary)
Jira REST API Unit Test Example
>>> ...
```

## Unittest and Coverage

Run unittest

```bash
cd tests
python -m unittest
```

Run coverage

```bash
cd tests
coverage run -m unittest
coverage report -m              # to report on the results
coverage html                   # to get annotated HTML
```

## FAQ

### Q1: Which Jira/BitBucket version I used to develop?

> For Jira I used Jira v8.5.9 and Jira Cloud.
>
> For BitBucket I used Bitbucket v5.13.1. not support Bitbucket cloud for now.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "atlassian-api-py",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "atlassian,jira,bitbucket,confluence,rest,api",
    "author": "Peter Shen",
    "author_email": "xianpeng.shen@gmail.com",
    "download_url": "",
    "platform": null,
    "description": "# Python Wrapper for Atlassian REST API\n\n[![PyPI](https://img.shields.io/pypi/v/atlassian-api-py)](https://pypi.org/project/atlassian-api-py/)\n[![CodeFactor](https://www.codefactor.io/repository/github/shenxianpeng/atlassian-api-py/badge/main?s=3f5b565625069f5c5ab303a02b120197cd3abdde)](https://www.codefactor.io/repository/github/shenxianpeng/atlassian-api-py/overview/main)\n![PyPI - Downloads](https://img.shields.io/pypi/dw/atlassian-api-py)\n[![commit-check](https://img.shields.io/badge/commit--check-enabled-brightgreen?logo=Git&logoColor=white)](https://github.com/commit-check/commit-check)\n\n## What is this?\n\nThis is a package wrapper of Atlassian REST API written in Python, currently, it supports JIRA and Bitbucket.\n\nThis package was created to simplify the implementation of integration with JIRA and Bitbucket.\n\n## QuickStart\n\n## Install from PyPI\n\n```bash\n# install\n$ pip install atlassian-api-py\n\n# upgrade to latest\n$ pip install atlassian-api-py --upgrade\n```\n\n### Establish connection\n\nConnect with username and password\n\n```python\n>>> from atlassian import Jira\n>>> jira = Jira(url='https://jira.company.com', username=\"username\", password=\"password\")\n```\n\nOr connect with token\n\n```python\n>>> from atlassian import Jira\n>>> jira = Jira(url='https://jira.company.com', token=\"yourToken\")\n```\n\nOr write your credentials in a configuration file `config.ini`, and get the credential though the configuration file.\n\n```markdown\n[jira]\nurl = https://jira.company.com\nusername = username\npassword = password\n# Or\ntoken = yourToken\n```\n\n```python\n>>> import configparser\n>>> config = configparser.ConfigParser()\n>>> config.read('config.ini')\n\n>>> jira_url = config['jira']['url']\n>>> jira_usr = config['jira']['username']\n>>> jira_psw = config['jira']['password']\n>>> jira_token = config['jira']['token']\n```\n\n### Get fields\n\nNext, you can get the issue's fields as follow:\n\n```python\n>>> issue = jira.issue('TEST-1')\n>>> print(issue.fields.status.name)\nTriage\n>>> print(issue.fields.description)\nthis is a demo jira ticket\n>>> print(issue.fields.status.name)\nTriage\n>>> print(issue.fields.issuetype.name)\nBug\n```\n\n### More fields\n\n```python\n>>> print(issue.id)\n1684517\n>>> print(issue.key)\nTEST-1\n>>> print(issue.fields.assignee.key)\nxpshen\n>>> print(issue.fields.summary)\nJira REST API Unit Test Example\n>>> ...\n```\n\n## Unittest and Coverage\n\nRun unittest\n\n```bash\ncd tests\npython -m unittest\n```\n\nRun coverage\n\n```bash\ncd tests\ncoverage run -m unittest\ncoverage report -m              # to report on the results\ncoverage html                   # to get annotated HTML\n```\n\n## FAQ\n\n### Q1: Which Jira/BitBucket version I used to develop?\n\n> For Jira I used Jira v8.5.9 and Jira Cloud.\n>\n> For BitBucket I used Bitbucket v5.13.1. not support Bitbucket cloud for now.\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Python Wrapper for Atlassian REST API",
    "version": "0.5.2",
    "project_urls": {
        "download": "https://pypi.org/project/atlassian-api-py/#files",
        "source": "https://github.com/shenxianpeng/atlassian-api-py",
        "tracker": "https://github.com/shenxianpeng/atlassian-api-py/issues"
    },
    "split_keywords": [
        "atlassian",
        "jira",
        "bitbucket",
        "confluence",
        "rest",
        "api"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8560e310412389e6f15086ec7ade256d2bde7533e9bd15c2e4d79f0e7e1dff48",
                "md5": "83a0a0ff96e027498f1a5b642e2c1bd2",
                "sha256": "425630cd74efb654b9da613a891c15b7970fa3e610600d2b4565fecfc3ebbf7f"
            },
            "downloads": -1,
            "filename": "atlassian_api_py-0.5.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "83a0a0ff96e027498f1a5b642e2c1bd2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 12355,
            "upload_time": "2024-01-23T12:33:39",
            "upload_time_iso_8601": "2024-01-23T12:33:39.725556Z",
            "url": "https://files.pythonhosted.org/packages/85/60/e310412389e6f15086ec7ade256d2bde7533e9bd15c2e4d79f0e7e1dff48/atlassian_api_py-0.5.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-23 12:33:39",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "shenxianpeng",
    "github_project": "atlassian-api-py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "atlassian-api-py"
}
        
Elapsed time: 0.18034s