Atlassian REST API Python Wrapper.
Project description
Atlassian REST API Python Wrapper
What is this?
This package is a wrapper of Atlassian Rest APIs written in Python, currently it supports Atlassian products: JIRA and Bitbucket.
This API package was created to bring ease of implementation for integration with JIRA and Bitbucket.
QuickStart
>>> from atlassian import Jira
>>> jira = Jira(url='https://jira.company.com', username="username", password="password")
>>> 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
Save your username and password in a configuration file config.ini
, for example:
[jira]
url = https://jira.company.com
username = username
password = password
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 = 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
>>> 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
>>> ...
Install from PyPI
# install
$ pip install atlassian-api-py
# upgrade to latest
$ 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
Changelog
To track some minor
and micro
changes.
Click to expand changelog
-
0.3.0 - May 9, 2021 - Fixed bitbucket and test_bitbucket issues.
-
0.2.7 - Apr 20, 2021 - Support create task with components.
-
0.2.5 - Apr 20, 2021 - Support update_issue_component.
-
0.2.4 - Mar 28, 2021 - Added create_task into Jira and refactor code.
-
0.2.0 - Mar 9, 2021 - Convert API return from JSON data into Python object.
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.
Q2: Are there any major changes?
From 0.2.0 - Mar 9, 2021, convert get JIra API data from dict to object, no longer compatible with past old versions.
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
Built Distribution
Hashes for atlassian_api_py-0.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ce0f96dee90f6c38622192b7ad518890bf171468ab32dc07d8ef2ae804ea6ee |
|
MD5 | dc3bf0ab65ebddfa44f969bb68fa39c4 |
|
BLAKE2b-256 | 7b6508571b77be7b8052f2633b01ec60af30196473d4e6555e5938891a8229af |