Skip to main content
https://badge.fury.io/py/jenkinsapi.png

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")

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

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)

Source distribution for jenkinsapi 0.3.23
File Size Uploaded
jenkinsapi-0.3.23.tar.gz 205.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jenkinsapi 0.3.23
File Interpreter ABI Platform
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 log

Release 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

Release history Release notifications | RSS feed

This release

0.3.23 This release

2 release files

0.3.22

2 release files

0.3.21

2 release files

0.3.19

2 release files

0.3.15

2 release files

0.3.14

2 release files

0.3.13

2 release files

0.3.11

2 release files

0.3.10

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

1 release file

0.2.31

0.2.30

2 release files

0.2.27

2 release files

0.2.26

2 release files

0.2.25

2 release files

0.2.24

2 release files

0.2.23

2 release files

0.2.22

2 release files

0.2.21

2 release files

0.2.20

2 release files

0.2.19

1 release file

0.2.18

1 release file

0.2.17

1 release file

0.2.16

1 release file

0.2.15

1 release file

0.2.14

1 release file

0.2.13

1 release file

0.2.12

1 release file

0.2.11

1 release file

0.2.10

1 release file

0.2.9

1 release file

0.2.8

1 release file

0.2.7

1 release file

0.2.6

1 release file

0.2.5

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.16

1 release file

0.1.15

1 release file

0.1.13

1 release file

0.1.12

1 release file

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page