Snakemine: A Pythonic interface to Redmine’s REST API¶
This library is a REST API wrapper for the Redmine project management web application. Its API is directly inspired by Django’s settings module and ORM.
Installation¶
Install-time requirements:
- CPython 2.6 / 2.7 / 3.3 or PyPy (although PyPy is not currently tested on Travis CI due to a strange bug, it is tested regularly via tox)
- If you’re using Python 2.6:
- lxml
- python-dateutil
- requests
Run-time requirements:
- A Redmine installation somewhere (this has only been tested with 1.0, I make no guarantees at this point that it works with any newer version)
Example¶
Let’s assume that you have a registered user with an API key.
Here is the Django-esque settings file (named redmine_settings.py
):
BASE_URI = 'https://redmine.example.com'
USERNAME = 'jschmidt'
API_KEY = '1234abcd'
Here is a way to retrieve a given issue and change its subject (creatively
named script.py
):
from snakemine.issue import Issue
issue = Issue.objects.get(12)
issue.subject = 'Modified subject'
issue.save()
You would run the script like so:
PYTHONPATH=. SNAKEMINE_SETTINGS_MODULE=redmine_settings python script.py
License¶
The code is licensed under the Apache License 2.0; see the LICENSE
file
for details.
The documentation is licensed under the Creative Commons
Attribution-ShareAlike 4.0 International License; see the LICENSE.docs
file for details.
Contributing¶
This project is hosted at GitHub. I gladly accept pull requests. If
you contribute code, please also create tests for your modifications,
otherwise your request will not be accepted as quickly (I will most likely ask
you to add tests). It would probably also be in your best interests to add
yourself to the AUTHORS.rst
file if you have not done so already.
A Vagrant environment is available for developing snakemine. Simply run the following command (once Vagrant is installed):
$ vagrant up
...and it will install all of the Python dependencies in a virtualenv, plus set up a compatible Ruby environment for Redmine. You can then log into the virtual machine:
$ vagrant ssh
vagrant@vagrant $ source .virtualenv/bin/activate
vagrant@vagrant $ git clone /vagrant ~/snakemine
The last line exists so that it is possible to run python setup.py sdist
-
VirtualBox’s remote filesystem module does not support hardlinks, so it fails
if you try to run that command or tox
from the /vagrant
directory.
Contributors¶
- Mark Lee