pyred.py is a small python class that uses Redmine RESTAPI for talking and manipulating data on Redmine server.
Just grab the redmine.py file and import it in your code.
Example:
cd /tmp mkdir pyred cd pyred git clone show origin touch init.py
#!/usr/bin/python from pyred.pyred import Redmine
url = 'https://redmine.example.org' pass_file = 'pass_file'
project_id = 20
issue_id = 251
time_entry_id = 17
r = Redmine(url=url,pass_file=pass_file)
#p = r.getProject(name=project_id)
''' criteria = { 'project_id':project_id } is = r.getIssues(criteria=criteria) print is '''
''' data = {'issue':{ 'subject':'Modified through Redmine API', }, } response = r.updateIssue(issue_id,data) print response '''
''' data = {'issue':{ 'project_id':project_id, 'subject':'Issue created via Redmine API', 'priority_id': 4, }, } print r.createIssue(data)
'''
''' te = r.getTimeEntry(time_entry_id) print te '''
''' data = { 'issue_id':issue_id } tes = r.getTimeEntries(data) print tes '''
''' data = {'time_entry':{ 'issue_id':issue_id, 'hours':'30m', 'comments':'Time entry added via Redmine API', 'activity_id':9, }, } response = r.createTimeEntry(data) print response
'''
- uses an awesome requests python library [2] by Kenneth Reitz
- Alex Lourie
- Sandro Bonazolla
- Javier Legido