atlassian-api-py-0.5.0
توضیحات
Python Wrapper for Atlassian REST API
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | atlassian-api-py-0.5.0 |
| نام | atlassian-api-py |
| نسخه کتابخانه | 0.5.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Peter Shen |
| ایمیل نویسنده | xianpeng.shen@gmail.com |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/atlassian-api-py/ |
| مجوز | MIT License |
# Python Wrapper for Atlassian REST API
[](https://pypi.org/project/atlassian-api-py/)
[](https://www.codefactor.io/repository/github/shenxianpeng/atlassian-api-py/overview/main)

## What is this?
This is a package wrapper of Atlassian REST API written in Python, currently, it only 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
```
## Changelog
See [CHANGELOG](CHANGELOG.md)
## 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.
نیازمندی
| مقدار | نام |
|---|---|
| - | requests |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.8 | Python |
نحوه نصب
نصب پکیج whl atlassian-api-py-0.5.0:
pip install atlassian-api-py-0.5.0.whl
نصب پکیج tar.gz atlassian-api-py-0.5.0:
pip install atlassian-api-py-0.5.0.tar.gz