I think many of you know what is Redmine. Target of this article is to show how to use python-redmine library for managing Redmine web instance via REST api. Sure you can use parsing with BeautifulSoup or like that but better to use official methods. Also you can use other alternative pyredminews etc.
So as usual first of all you need to install library:
# pip install python-redmine
Using of this library is pretty easy:
requests={'verify': False} is for bad ssl certificate installed on https://redmine.example.com
Now we can get some interesting info about users, projects and so on:
Some objects are iterable like tickets, logged time, comments. For example:
This script will show all tickets assigned to you and not in "Resolved" state (line 19).
Key for this script you can find in Redmine user`s page:
print_line() func I am using for usable output.
Result of script's work:
-------------------------------------------------------------------
Opened task in Redmine
-------------------------------------------------------------------
ipeacocks - New - My Project - [ADMIN] Task 1 - 12146
ipeacocks - New - My Project - [ADMIN] Task 2 via API - 12142
ipeacocks - Assigned - My Project - [ADMIN] Task 3 - 84154
ipeacocks - Assigned - My Project - [ADMIN] Buy Iphone 6 - 12152
ipeacocks - Assigned - My Project - [ADMIN] Lolo - 8414
Hope that this article was useful for you. For details check links:


Немає коментарів:
Дописати коментар