Giter Club home page Giter Club logo

redmine_tool's Introduction

Redmine Tool

A collection of python scripts to do stuff with the Redmine API.

Requirements

  • Python 3
  • Environment variables:
    • REDMINE_URL
    • REDMINE_API_KEY

Installation

Create a virtual environment:

% python -m venv redmine_tool_venv

Activate virtual environment:

% . redmine_tool_venv/bin/activate
(redmine_tool_venv) %

Install dependencies:

(redmine_tool_venv) % pip install -r requirements.txt

Tools

Issue Tree

You can run issue_tree.py to retrieve a tree of issues starting from a root issue. The output is a JSON object that follows the structure outlined in https://www.redmine.org/projects/redmine/wiki/Rest_Issues, extended with an children attribute which contains an array of objects for each child.

usage: issue_tree.py [-h] -r ROOT

Retrieve a tree of issues given a root issue id.

optional arguments:
  -h, --help            show this help message and exit
  -r ROOT, --root ROOT  The id of the root issue.

For example:

(redmine_tool_venv) % python issue_tree.py -r 37446
INFO:root: Retrieving issue #37446 ...
INFO:root: Retrieving children for issue #37446 ...
INFO:root: Retrieving children for issue #46989 ...
INFO:root: Retrieving children for issue #46647 ...
...
INFO:root: Retrieving children for issue #36015 ...
INFO:root: Retrieving children for issue #36018 ...
INFO:root: Retrieving children for issue #36016 ...
{
  "id": 37446,
  ...
  "children": [
    {
      "id": 46989,
      ...
      "children": [
        {
          "id": 46647,
          ...
        }
      ]
    }
  ]
}

Tree-to-Dot

You can turn the output of issue_tree.py into SVG (via Graphviz's .dot) by running tree2svg.py.

usage: tree2svg.py [-h] -i INPUT [-s START] [-m MAX_TITLE_LENGTH] [-d {TB,LR}] [-p PRUNE]

Convert a Redmine issues JSON tree to SVG. Either read through an input file, or pipe through STDIN. Output is to STDOUT.

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        The path of a JSON file containing a Redmine issues tree, or '-' for STDIN.
  -s START, --start START
                        The issue id to use as the root of the output, if we only want to render a subtree. Default is the root of the input file.
  -m MAX_TITLE_LENGTH, --max_title_length MAX_TITLE_LENGTH
                        Truncate title length to this. Default is -1, meaning do not truncate.
  -d {TB,LR}, --direction {TB,LR}
                        Layout direction of the graph.
  -p PRUNE, --prune PRUNE
                        Comma-separated list of status ids. Issues with these status ids will be pruned.

License

This material is copyright © BerlinOnline Stadtportal GmbH & Co. KG.

All software in this repository is published under the MIT License.

redmine_tool's People

Contributors

knudmoeller avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.