atlassian-python-api

atlassian-python-api

Python封装库实现Atlassian产品交互简化

atlassian-python-api是一个基于官方REST API的Python库,支持Jira、Confluence、Bitbucket等多种Atlassian产品。适用于云端和服务器版本,可用于自动化任务、系统集成和应用开发。该库文档完善,持续更新,为Python开发者提供了便捷的Atlassian产品操作方式。

atlassian-python-apiAtlassian产品REST APIPython开发自动化任务Github开源项目

============================ Atlassian Python API wrapper

|Build Status| |PyPI version| |PyPI - Downloads| |License| |Codacy Badge| |Docs| |Discord|

What is it?


The atlassian-python-api library provides a simple and convenient way to interact with Atlassian products (such as Jira Service management, Jira Software, Confluence, Bitbucket and apps Insight, X-Ray) using Python. It is based on the official REST APIs of these products, as well as additional private methods and protocols (such as xml+rpc and raw HTTP requests). This library can be used to automate tasks, integrate with other tools and systems, and build custom applications that interact with Atlassian products. It supports a wide range of Atlassian products, including Jira, Confluence, Bitbucket, StatusPage and others, and is compatible with both Atlassian Server and Cloud instances.

Overall, the atlassian-python-api is a useful tool for Python developers who want to work with Atlassian products. It is well-documented and actively maintained, and provides a convenient way to access the full range of functionality offered by the Atlassian REST APIs.

Documentation


Documentation_

.. _Documentation: https://atlassian-python-api.readthedocs.io

How to Install?


From PyPI

.. code-block:: console

$ pip install atlassian-python-api

From Source

  • Git clone repository
  • Use :code:pip install -r requirements.txt to install the required packages
  • or :code:pipenv install && pipenv install --dev

Examples


More examples in :code:examples/ directory.

Here's a short example of how to create a Confluence page:

.. code-block:: python

from atlassian import Confluence

confluence = Confluence(
    url='http://localhost:8090',
    username='admin',
    password='admin')

status = confluence.create_page(
    space='DEMO',
    title='This is the title',
    body='This is the body. You can use <strong>HTML tags</strong>!')

print(status)

Please, note Confluence Cloud need to be used via token parameter. And here's another example of how to get issues from Jira using JQL Query:

.. code-block:: python

from atlassian import Jira

jira = Jira(
    url='http://localhost:8080',
    username='admin',
    password='admin')
JQL = 'project = DEMO AND status IN ("To Do", "In Progress") ORDER BY issuekey'
data = jira.jql(JQL)
print(data)

Also, you can use the Bitbucket module e.g. for getting project list

.. code-block:: python

from atlassian import Bitbucket

bitbucket = Bitbucket(
        url='http://localhost:7990',
        username='admin',
        password='admin')

data = bitbucket.project_list()
print(data)

Now you can use the Jira Service Desk module. See docs. Example to get your requests:

.. code-block:: python

from atlassian import ServiceDesk

sd = ServiceDesk(
        url='http://localhost:7990',
        username='admin',
        password='admin')

data = sd.get_my_customer_requests()
print(data)

Using Insight (CMDB Tool for Jira):

.. code-block:: python

from atlassian import Insight

insight = Insight(
        url='http://localhost:7990',
        username='admin',
        password='admin')

data = insight.get_object(88)
print(data)

Using Xray (Test Management tool for Jira):

.. code-block:: python

from atlassian import Xray

xr = Xray(
       url='http://localhost:7990',
        username='admin',
        password='admin')

data = xr.get_tests('TEST-001')
print(data)

Using Bamboo:

.. code-block:: python

from atlassian import Bamboo

bamboo = Bamboo(
        url='http://localhost:6990/bamboo/',
        token="<TOKEN>")

data = bamboo.get_elastic_configurations()
print(data)

If you want to see the response in pretty print format JSON. Feel free for use construction like:

.. code-block:: python

from pprint import pprint
# you code here
# and then print using pprint(result) instead of print(result)
pprint(response)

How to contribute?


First of all, I am happy for any PR requests. Let's fork and provide your changes :) See the Contribution Guidelines for this project_ for details on how to make changes to this library.

.. _Contribution Guidelines for this project: CONTRIBUTING.rst .. |Build Status| image:: https://github.com/atlassian-api/atlassian-python-api/workflows/Test/badge.svg?branch=master :target: https://github.com/atlassian-api/atlassian-python-api/actions?query=workflow%3ATest+branch%3Amaster :alt: Build status .. |PyPI version| image:: https://badge.fury.io/py/atlassian-python-api.svg :target: https://badge.fury.io/py/atlassian-python-api :alt: PyPI version .. |License| image:: https://img.shields.io/pypi/l/atlassian-python-api.svg :target: https://pypi.python.org/pypi/atlassian-python-api :alt: License .. |Codacy Badge| image:: https://app.codacy.com/project/badge/Grade/2cca43995cf041b8b181e2b2ff04cee6 :target: https://app.codacy.com/gh/atlassian-api/atlassian-python-api/dashboard :alt: Codacy Badge .. |PyPI - Downloads| image:: https://static.pepy.tech/badge/atlassian-python-api/month :alt: PyPI - Downloads .. |Docs| image:: https://readthedocs.org/projects/atlassian-python-api/badge/?version=latest :target: https://atlassian-python-api.readthedocs.io/?badge=latest :alt: Documentation Status .. |Discord| image:: https://img.shields.io/discord/756142204761669743.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2 :alt: Discord Chat :target: https://discord.gg/FCJsvqh

Credits


In addition to all the contributors we would like to thank these vendors:

  • Atlassian_ for developing such a powerful ecosystem.
  • JetBrains_ for providing us with free licenses of PyCharm_
  • Microsoft_ for providing us with free licenses of VSCode_
  • GitHub_ for hosting our repository and continuous integration

.. _Atlassian: https://www.atlassian.com/ .. _JetBrains: http://www.jetbrains.com .. _PyCharm: http://www.jetbrains.com/pycharm/ .. _GitHub: https://github.com/ .. _Microsoft: https://github.com/Microsoft/vscode/ .. _VSCode: https://code.visualstudio.com/

编辑推荐精选

TRAE编程

TRAE编程

AI辅助编程,代码自动修复

Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。

热门AI工具生产力协作转型TraeAI IDE
博思AIPPT

博思AIPPT

AI一键生成PPT,就用博思AIPPT!

博思AIPPT,新一代的AI生成PPT平台,支持智能生成PPT、AI美化PPT、文本&链接生成PPT、导入Word/PDF/Markdown文档生成PPT等,内置海量精美PPT模板,涵盖商务、教育、科技等不同风格,同时针对每个页面提供多种版式,一键自适应切换,完美适配各种办公场景。

热门AI工具AI办公办公工具智能排版AI生成PPT博思AIPPT海量精品模板AI创作
潮际好麦

潮际好麦

AI赋能电商视觉革命,一站式智能商拍平台

潮际好麦深耕服装行业,是国内AI试衣效果最好的软件。使用先进AIGC能力为电商卖家批量提供优质的、低成本的商拍图。合作品牌有Shein、Lazada、安踏、百丽等65个国内外头部品牌,以及国内10万+淘宝、天猫、京东等主流平台的品牌商家,为卖家节省将近85%的出图成本,提升约3倍出图效率,让品牌能够快速上架。

iTerms

iTerms

企业专属的AI法律顾问

iTerms是法大大集团旗下法律子品牌,基于最先进的大语言模型(LLM)、专业的法律知识库和强大的智能体架构,帮助企业扫清合规障碍,筑牢风控防线,成为您企业专属的AI法律顾问。

SimilarWeb流量提升

SimilarWeb流量提升

稳定高效的流量提升解决方案,助力品牌曝光

稳定高效的流量提升解决方案,助力品牌曝光

Sora2视频免费生成

Sora2视频免费生成

最新版Sora2模型免费使用,一键生成无水印视频

最新版Sora2模型免费使用,一键生成无水印视频

Transly

Transly

实时语音翻译/同声传译工具

Transly是一个多场景的AI大语言模型驱动的同声传译、专业翻译助手,它拥有超精准的音频识别翻译能力,几乎零延迟的使用体验和支持多国语言可以让你带它走遍全球,无论你是留学生、商务人士、韩剧美剧爱好者,还是出国游玩、多国会议、跨国追星等等,都可以满足你所有需要同传的场景需求,线上线下通用,扫除语言障碍,让全世界的语言交流不再有国界。

讯飞绘文

讯飞绘文

选题、配图、成文,一站式创作,让内容运营更高效

讯飞绘文,一个AI集成平台,支持写作、选题、配图、排版和发布。高效生成适用于各类媒体的定制内容,加速品牌传播,提升内容营销效果。

AI助手热门AI工具AI创作AI辅助写作讯飞绘文内容运营个性化文章多平台分发
商汤小浣熊

商汤小浣熊

最强AI数据分析助手

小浣熊家族Raccoon,您的AI智能助手,致力于通过先进的人工智能技术,为用户提供高效、便捷的智能服务。无论是日常咨询还是专业问题解答,小浣熊都能以快速、准确的响应满足您的需求,让您的生活更加智能便捷。

imini AI

imini AI

像人一样思考的AI智能体

imini 是一款超级AI智能体,能根据人类指令,自主思考、自主完成、并且交付结果的AI智能体。

下拉加载更多