cdrouter is a simple Python wrapper for the CDRouter Web API.

For more information on CDRouter, please visit

Download & Install

cdrouter is available on PyPI.

$ pip install -U cdrouter


First create a CDRouter object, passing it the URL of your CDRouter system. The token parameter should be set to a valid API token on your CDRouter system. If token is not specified, it will default to the value of the CDROUTER_API_TOKEN environment variable. The token argument can be omitted for CDRouter systems where Automatic Login is enabled.

import time
from cdrouter import CDRouter
from cdrouter.cdrouter import CDRouterError
from cdrouter.filters import Field as field
from import Job

c = CDRouter('http://localhost:8015', token='deadbeef')

for p in c.packages.iter_list(filter=field('tags').contains('noretry')):
    print('Launching package ' +

        j =, extra_cli_args='-testvar myvar=example'))
    except CDRouterError as ce:
        print('Error launching job: {}'.format(ce))

    while j.result_id == None:
        j =

    print('    Result-ID: ' + j.result_id)


More examples of using cdrouter can be found here. Please see the Reference page for more information on available fields and methods for each class.