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 servers 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 on ReadTheDocs.org.
Quick start guide
First, we recommend that you install the pip package manager if it is not already installed. See here for details.
Install PyJen directly from PyPI using PIP:
# pip install pyjen
import the pyjen module and start scripting! See below for some common examples.
For a more in-depth guide to contributing to the project, see our contributors guide.
Examples
Display a list of all jobs on the default view
from pyjen.jenkins import Jenkins
jk = Jenkins("http://localhost:8080")
vw = jk.default_view
jobs = vw.jobs
for j in jobs:
print(j.name)
Disable all jobs in a view named “My View”
from pyjen.jenkins import Jenkins
jk = Jenkins("http://localhost:8080")
vw = jk.find_view("My View")
vw.disable_all_jobs()
Get all upstream dependencies of a job named “JobA”
from pyjen.jenkins import Jenkins
jen = Jenkins("http://localhost:8080")
jb = jen.find_job("JobA")
upstream = jb.all_upstream_jobs
for u in upstream:
print(u.name)
Clone all jobs in a view named with a ‘trunk’ identifier for a new branch
from pyjen.jenkins import Jenkins
j = Jenkins("http://localhost:8080")
v = j.find_view("trunk_builds")
v.clone_all_jobs("trunk", "branch")
Metadata
Release files for pyjen 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyjen-1.1.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for pyjen-1.1.0-py2.py3-none-any.whl |
Release files / pyjen-1.1.0-py2.py3-none-any.whl
| Download URL | pyjen-1.1.0-py2.py3-none-any.whl |
|---|---|
| Size | 77.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
4a7269f3dac7a442fd175c7354f81b04ccf21e221e185951dfa0352571471926
|
|
BLAKE2b-256 checksum How to use checksums |
7d61d53794d00ae00c020ec59b93060b57dc10385bcc33803aa49b404ddbdfd6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.6.7
|
Security for pyjen 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.