Atlassian REST API Python Wrapper.
Project description
Atlassian REST API Python Wrapper
This library is a wrapper of Atlassian Rest APIs written by Python, currently only supports JIRA and Bitbucket.
Purpose
Create an easy to use API package that I can use for all the projects when I need CI/CD with JIRA, Bitubket.
QuickStart
>>> from atlassian import Jira
>>> jira = Jira(url='https://shenxianpeng.atlassian.net',
... username="myusername", password="mypassword")
>>> status = jira.get_issue_status('AAP-1')
>>> print(status)
Backlog
Put your username and password in a configuration file config.ini
, for example:
[jira]
url = https://shenxianpeng.atlassian.net
username = myusername
password = mypassword
Then get the credential information though the configuration file config.ini
>>> 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 = Jira(url=jira_url, username=jira_usr, password=jira_psw)
>>> issue = self.jira.issue('MVQA-900')
>>> print(issue.fields.description)
this is a demo jira ticket
>>> print(issue.fields.status.name)
Backlog
>>> print(issue.fields.issuetype.name)
Bug
Install from PyPI
# install
$ pip install atlassian-api-py
# upgrade
$ pip install atlassian-api-py --upgrade
Unittest and Coverage
Run unittest
cd tests
python -m unittest
Run coverage
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file atlassian_api_py-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: atlassian_api_py-0.2.0-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | adf1970a5342b787fa0ce1a2c199e54e5e6c9eabe6608d9f66a0f7b4428c715f |
|
MD5 | 1af3dd3555e81b2073cb1bd7b18c4247 |
|
BLAKE2b-256 | 14ff92e14f3c0c7f116f4f16dc615a111597027122928c2fca5854d1a28d21f3 |