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.
- 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:
- 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)
Let’s assume that you have a registered user with an API key.
Here is the Django-esque settings file (named
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
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
The code is licensed under the Apache License 2.0; see the
The documentation is licensed under the Creative Commons
Attribution-ShareAlike 4.0 International License; see the
file for details.
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
- Mark Lee