# Python Wrapper for Atlassian REST API
[![PyPI](https://img.shields.io/pypi/v/atlassian-api-py)](https://pypi.org/project/atlassian-api-py/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/atlassian-api-py?style=flat-square)](https://pypi.org/project/atlassian-api-py)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=shenxianpeng_atlassian-api-py&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=shenxianpeng_atlassian-api-py)
![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)
## Overview
This package is a Python wrapper for the Atlassian REST API, currently supporting JIRA and Bitbucket. It simplifies the implementation of integration with these tools.
## Installation
To install the package, run the following command:
```bash
$ pip install atlassian-api-py
```
To upgrade to the latest version, use:
```bash
$ pip install atlassian-api-py --upgrade
```
**Establish connection**
You can connect to JIRA using a username and password or a token.
Using Username and Password
```python
>>> from atlassian import Jira
>>> jira = Jira(url='https://jira.company.com', username="username", password="password")
```
Using a Token
```python
>>> from atlassian import Jira
>>> jira = Jira(url='https://jira.company.com', token="yourToken")
```
Using a Configuration File
Alternatively, you can store your credentials in a `config.ini` file:
```markdown
[jira]
url = https://jira.company.com
username = username
password = password
# Or
token = yourToken
```
Then, you can use the configuration file to establish a connection:
```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']
```
### Getting issue 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
```
### Getting issue 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
>>> ...
```
## License
This project is released under the [MIT License](LICENSE).
Raw data
{
"_id": null,
"home_page": null,
"name": "atlassian-api-py",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "atlassian, jira, bitbucket, confluence, rest, api",
"author": "Xianpeng Shen",
"author_email": "xianpeng.shen@gmail.com",
"download_url": null,
"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[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/atlassian-api-py?style=flat-square)](https://pypi.org/project/atlassian-api-py)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=shenxianpeng_atlassian-api-py&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=shenxianpeng_atlassian-api-py)\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## Overview\n\nThis package is a Python wrapper for the Atlassian REST API, currently supporting JIRA and Bitbucket. It simplifies the implementation of integration with these tools.\n\n## Installation\n\nTo install the package, run the following command:\n\n```bash\n$ pip install atlassian-api-py\n```\n\nTo upgrade to the latest version, use:\n\n```bash\n$ pip install atlassian-api-py --upgrade\n```\n\n**Establish connection**\n\nYou can connect to JIRA using a username and password or a token.\n\nUsing 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\nUsing a Token\n\n```python\n>>> from atlassian import Jira\n>>> jira = Jira(url='https://jira.company.com', token=\"yourToken\")\n```\n\nUsing a Configuration File\n\nAlternatively, you can store your credentials in a `config.ini` file:\n\n```markdown\n[jira]\nurl = https://jira.company.com\nusername = username\npassword = password\n# Or\ntoken = yourToken\n```\n\nThen, you can use the configuration file to establish a connection:\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### Getting issue 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### Getting issue 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## License\n\nThis project is released under the [MIT License](LICENSE).\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "Python Wrapper for Atlassian REST API",
"version": "0.5.5",
"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": "d426a7aa14f0bf5170c52f77f66771d9a844de862d28f87f30a6904483e239ff",
"md5": "6806234e43336968ec1952b90859bd3e",
"sha256": "6604ab3eeb75345c9e43e6da77d11149309b25f6e1bc6599e1181d6a90b1867c"
},
"downloads": -1,
"filename": "atlassian_api_py-0.5.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6806234e43336968ec1952b90859bd3e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 12430,
"upload_time": "2024-12-08T21:43:46",
"upload_time_iso_8601": "2024-12-08T21:43:46.108971Z",
"url": "https://files.pythonhosted.org/packages/d4/26/a7aa14f0bf5170c52f77f66771d9a844de862d28f87f30a6904483e239ff/atlassian_api_py-0.5.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-08 21:43:46",
"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"
}