Installation
pip install jenkinsapi
Logging
JenkinsAPI emits request/response debug logs when enabled. You can opt in with the environment variable or by calling the helper:
export JENKINSAPI_LOG_LEVEL=DEBUG
from jenkinsapi.utils.logging import configure_logging
configure_logging("INFO")
Important Links
About this library
Jenkins is the market leading continuous integration system.
Jenkins (and its predecessor Hudson) are useful projects for automating common development tasks (e.g. unit-testing, production batches) - but they are somewhat Java-centric.
Jenkinsapi makes scripting Jenkins tasks a breeze by wrapping the REST api into familiar python objects.
Here is a list of some of the most commonly used functionality
Add, remove, and query Jenkins jobs
- Control pipeline execution
Query the results of a completed build
Block until jobs are complete or run jobs asyncronously
Get objects representing the latest builds of a job
- Artifact management
Search for artifacts by simple criteria
Install artifacts to custom-specified directory structures
Search for builds by source code revision
- Create, destroy, and monitor
Build nodes (Webstart and SSH slaves)
Views (including nested views using NestedViews Jenkins plugin)
Credentials (username/password and ssh key)
Authentication support for username and password
Manage jenkins and plugin installation
Full library capabilities are outlined in the Documentation
Get details of jobs running on Jenkins server
"""Get job details of each job that is running on the Jenkins instance"""
def get_job_details():
# Refer Example #1 for definition of function 'get_server_instance'
server = get_server_instance()
for job_name, job_instance in server.get_jobs():
print('Job Name:%s' % (job_instance.name))
print('Job Description:%s' % (job_instance.get_description()))
print('Is Job running:%s' % (job_instance.is_running()))
print('Is Job enabled:%s' % (job_instance.is_enabled()))
Disable/Enable a Jenkins Job
def disable_job():
"""Disable a Jenkins job"""
# Refer Example #1 for definition of function 'get_server_instance'
server = get_server_instance()
job_name = 'nightly-build-job'
if (server.has_job(job_name)):
job_instance = server.get_job(job_name)
job_instance.disable()
print('Name:%s,Is Job Enabled ?:%s' % (job_name, job_instance.is_enabled()))
Use the call job_instance.enable() to enable a Jenkins Job.
Creating jobs in folders
When using the Folders plugin, you can pass folder paths directly:
jenkins.create_job("folder1/folder2/job-name", config_xml)
jenkins.create_job("/job/folder1/job/folder2/job-name", config_xml)
Known issues
Job deletion operations fail unless Cross-Site scripting protection is disabled.
For other issues, please refer to the support URL
Development
Make sure that you have Java installed. Jenkins will be automatically downloaded and started during tests.
Create virtual environment for development
Install package in development mode
uv sync
Make your changes, write tests and check your code
uv run pytest -sv
Python versions
The project has been tested against Python versions:
<<<<<<< HEAD * 3.10 - 3.14 ======= * 3.10 - 3.14 (tested via CI) >>>>>>> e554089 (docs: comprehensive documentation and examples updates)
Jenkins versions
Project tested on both stable (LTS) and latest Jenkins versions.
Project Contributors
Aleksey Maksimov (ctpeko3a@gmail.com)
Salim Fadhley (sal@stodge.org)
Ramon van Alteren (ramon@vanalteren.nl)
Ruslan Lutsenko (ruslan.lutcenko@gmail.com)
Cleber J Santos (cleber@simplesconsultoria.com.br)
William Zhang (jollychang@douban.com)
Victor Garcia (bravejolie@gmail.com)
Bradley Harris (bradley@ninelb.com)
Kyle Rockman (kyle.rockman@mac.com)
Sascha Peilicke (saschpe@gmx.de)
David Johansen (david@makewhat.is)
Misha Behersky (bmwant@gmail.com)
Clinton Steiner (clintonsteiner@gmail.com)
Please do not contact these contributors directly for support questions! Use the GitHub tracker instead.
Metadata
Release files for jenkinsapi 0.3.23
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jenkinsapi-0.3.23.tar.gz | 205.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jenkinsapi-0.3.23-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 381.4 kB
Release files / jenkinsapi-0.3.23.tar.gz
| Download URL | jenkinsapi-0.3.23.tar.gz |
|---|---|
| Size | 205.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c3d9fc3293f0d0248cd018f5b3317d751449f0c0d4cc23cb3d1d60a830acb61f
|
|
BLAKE2b-256 checksum How to use checksums |
0c0df56f44099efa10eab6b3c47b5d0e6a894ab1d1ae8a7bd95597fd9f687e53
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.
Transparency logRelease files / jenkinsapi-0.3.23-py3-none-any.whl
| Download URL | jenkinsapi-0.3.23-py3-none-any.whl |
|---|---|
| Size | 175.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7740c3b705028a7cf5bcaaf43d8dbf15782750ed1ffdf271056dd6660e079b04
|
|
BLAKE2b-256 checksum How to use checksums |
e45aa3c72b3a45901f570a197885cbe8fc0dc4a62d1b853d8efc2d19bdc3dc92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.
Transparency log