skip to navigation
skip to content

Not Logged In

pyjen 0.0.4dev

Python wrapper for the Jenkins CI REST API

Latest Version: 0.0.9dev

Overview

Extensible, user and developer friendly Python interface to the Jenkins CI tool, wrapping the features exposed by the standard REST API using Pythonic objects and functions. Tested against the latest 2.x and 3.x versions of Python, and the latest trunk and LTS editions of Jenkins.

With an intuitive and well thought out interface, PyJen offers anyone familiar with the Python programming language an easy way to manage Jenkins dashboards from a simple command prompt. All core primitives of Jenkins, including views, jobs and builds are easily accessible and can be loaded, analyzed and even modified or created via simple Python commands.

Comments, suggestions and bugs may be reported to the project maintainer

Full API documentation can be found at TheFriendlyCoder.com.

Quick start guide

  1. First, we recommend that you install the pip package manager as described here
  2. Install PyJen directly from PyPI using PIP:
# pip install pyjen
  1. import the pyjen module and start scripting! See below for some common examples.

Examples

Display a list of all jobs on the default view

from pyjen import *
jk = jenkins.easy_connect("http://localhost:8080")
vw = jk.get_default_view()
jobs = vw.get_jobs()

for j in jobs:
    print j.get_name()

Disable all jobs in a view named “My View”

from pyjen import *
jk = jenkins.easy_connect("http://localhost:8080")
vw = jk.find_view("My View")
vw.disable_all_jobs()

Get all upstream dependencies of a job named “JobA”

from pyjen import *
j = job.easy_connect("http://localhost:8080/job/JobA")
upstream = j.get_upstream_jobs(True)

for u in upstream:
    print u.get_name()

Clone all jobs in a view who are named with a ‘trunk’ identifier for a new branch configuration

from pyjen import *
v = view.easy_connect("http://localhost:8080/views/trunk_builds")
v.clone_all_jobs(".*trunk.*", "branch")
 
File Type Py Version Uploaded on Size
pyjen-0.0.4dev.tar.gz (md5) Source 2014-06-30 19KB
  • Downloads (All Versions):
  • 10 downloads in the last day
  • 128 downloads in the last week
  • 187 downloads in the last month