Rest api ẅith python » History » Version 6
Javier Hernandez, 2010-11-09 10:15
1 | 4 | Javier Hernandez | h1. Using the REST API with Python |
---|---|---|---|
2 | |||
3 | 6 | Javier Hernandez | Here is the two well-known options for using REST API with python. |
4 | 4 | Javier Hernandez | |
5 | 5 | Javier Hernandez | # "PyActiveResource":http://code.google.com/p/pyactiveresource/ |
6 | 1 | Javier Hernandez | # "Python library":http://code.google.com/p/pyredminews/ |
7 | 6 | Javier Hernandez | |
8 | |||
9 | h2. *PyActiveResource* example: |
||
10 | |||
11 | <pre code="python"> |
||
12 | # Importing pyactiveresource |
||
13 | from pyactiveresource.activeresource import ActiveResource |
||
14 | |||
15 | class Issue(ActiveResource): |
||
16 | _site = 'http://redmine.foo.org' |
||
17 | _user = 'username' |
||
18 | _password = 'password' |
||
19 | |||
20 | # Get issues |
||
21 | issues = Issue.find() |
||
22 | |||
23 | # Get a specific issue, from its id |
||
24 | issue = Issue.find(1345) |
||
25 | |||
26 | # Issue attributes |
||
27 | |||
28 | # Updating an attribute |
||
29 | |||
30 | </pre> |