Skip to content

Commit 591d674

Browse files
author
Gonchik Tsymzhitov
committed
Marketplace: Add app reviews and app versions methods
1 parent 55cf0fb commit 591d674

File tree

3 files changed

+58
-7
lines changed

3 files changed

+58
-7
lines changed

README.rst

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,40 @@ Atlassian Python API wrapper
33
============================
44
|Build Status| |PyPI version| |PyPI - Downloads| |License| |Codacy Badge| |Docs|
55

6+
What is it?
7+
___________
8+
This package is used to provide a **simple** python interface for interacting with Atlassian products (Server, Data Center and Cloud).
9+
It is based on the official public Rest API documentation and private methods (+ xml+rpc, raw http request).
10+
611
Documentation
7-
-------------
12+
_____________
813

914
`Documentation`_
1015

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

13-
Install
14-
-------
18+
How to Install?
19+
_______________
20+
21+
From PyPI
22+
1523
.. code-block:: console
1624
1725
$ pip install atlassian-python-api
1826
27+
From Source
28+
29+
- Git clone repository
30+
- Use `pip install -r requirements.txt` to install the required packages
31+
- or `pipenv install && pipenv install --dev`
32+
33+
How to contribute?
34+
__________________
35+
Please, click here `Contribution Guidelines for this project`_
36+
37+
1938
Examples
20-
--------
39+
________
2140
**More examples in ``examples/`` directory.**
2241

2342
Here's a short example of how to create a Confluence page:
@@ -105,7 +124,7 @@ If you want to see the response in pretty print format JSON. Feel free for use c
105124
pprint(response)
106125
107126
Development and Deployment (For contributors)
108-
---------------------------------------------
127+
_____________________________________________
109128
First of all, I am happy for any PR requests.
110129
Let's fork and provide your changes :)
111130
See the `Contribution Guidelines for this project`_ for details on how to make changes to this library.
@@ -131,14 +150,17 @@ See the `Contribution Guidelines for this project`_ for details on how to make c
131150

132151

133152
Credits
134-
-------
153+
_______
135154
In addition to all the contributors we would like to thank these vendors:
136155

137156
* Atlassian_ for developing such a powerful ecosystem.
138157
* JetBrains_ for providing us with free licenses of PyCharm_
158+
* Microsoft_ for providing us with free licenses of VSCode_
139159
* Travis_ for hosting our continuous integration
140160

141161
.. _Atlassian: https://www.atlassian.com/
142162
.. _JetBrains: http://www.jetbrains.com
143163
.. _PyCharm: http://www.jetbrains.com/pycharm/
144164
.. _Travis: https://travis-ci.org/
165+
.. _Microsoft: https://github.com/Microsoft/vscode/
166+
.. _VSCode: https://code.visualstudio.com/

atlassian/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.17.3
1+
1.17.4

atlassian/marketplace.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,32 @@ def get_application_info(self, limit=10, offset=10):
5454
params['limit'] = limit
5555
url = 'rest/2/applications'
5656
return self.get(url, params=params)
57+
58+
def get_app_versions(self, add_on_key, application=None):
59+
"""
60+
Get a list of versions for the specified app.
61+
:param add_on_key: The unique identifier for this app,
62+
for example "com.atlassian.confluence.plugins.confluence-questions"
63+
:param application: Only returns apps compatible with this application
64+
:return:
65+
"""
66+
params = {}
67+
if application:
68+
params['application'] = application
69+
url = 'rest/2/addons/{addonKey}/versions'.format(addonKey=add_on_key)
70+
return self.get(url, params=params)
71+
72+
def get_app_reviews(self, add_on_key, sort=None):
73+
"""
74+
Get a list of reviews for the specified app.
75+
:param add_on_key: The unique identifier for this app,
76+
for example "com.atlassian.confluence.plugins.confluence-questions"
77+
:param sort: Specifies the review sort order
78+
Valid values: helpful, recent
79+
:return:
80+
"""
81+
url = 'rest/2/addons/{addonKey}/reviews'.format(addonKey=add_on_key)
82+
params = {}
83+
if sort:
84+
params['sort'] = sort
85+
return self.get(url, params=params)

0 commit comments

Comments
 (0)