jenkinsapi


Namejenkinsapi JSON
Version 0.3.15 PyPI version JSON
download
home_pageNone
SummaryA Python API for accessing resources on a Jenkins continuous-integration server.
upload_time2025-08-20 20:44:15
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Jenkinsapi
==========

.. image:: https://badge.fury.io/py/jenkinsapi.png
    :target: http://badge.fury.io/py/jenkinsapi

.. image:: https://codecov.io/gh/pycontribs/jenkinsapi/branch/master/graph/badge.svg
        :target: https://codecov.io/gh/pycontribs/jenkinsapi

Installation
------------

.. code-block:: bash

    pip install jenkinsapi

Important Links
---------------
* `Documentation <http://pycontribs.github.io/jenkinsapi/>`__
* `Source Code <https://github.com/pycontribs/jenkinsapi>`_
* `Support and bug-reports <https://github.com/pycontribs/jenkinsapi/issues?direction=desc&sort=comments&state=open>`_
* `Releases <https://pypi.org/project/jenkinsapi/#history>`_


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 <http://pycontribs.github.io/jenkinsapi/>`__

Get details of jobs running on Jenkins server
---------------------------------------------

.. code-block:: python

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

.. code-block:: python

    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.


Known issues
------------
* Job deletion operations fail unless Cross-Site scripting protection is disabled.

For other issues, please refer to the `support URL <https://github.com/pycontribs/jenkinsapi/issues?direction=desc&sort=comments&state=open>`_

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

.. code-block:: bash

    uv sync

* Make your changes, write tests and check your code

.. code-block:: bash

    uv run pytest -sv

Python versions
---------------

The project has been tested against Python versions:

* 3.9 - 3.13

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.

.. _Java: https://www.oracle.com/java/technologies/downloads/#java21


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "jenkinsapi",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "Aleksey Maksimov <ctpeko3a@gmail.com>, Clinton Steiner <clintonsteiner@gmail.com>",
    "keywords": null,
    "author": null,
    "author_email": "Salim Fadhley <salimfadhley@gmail.com>, Aleksey Maksimov <ctpeko3a@gmail.com>, Clinton Steiner <clintonsteiner@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/d4/6b/498191b0ba2d547f621bd0a7ef07d1dd5fc136a8680591ebd5c672793741/jenkinsapi-0.3.15.tar.gz",
    "platform": null,
    "description": "Jenkinsapi\n==========\n\n.. image:: https://badge.fury.io/py/jenkinsapi.png\n    :target: http://badge.fury.io/py/jenkinsapi\n\n.. image:: https://codecov.io/gh/pycontribs/jenkinsapi/branch/master/graph/badge.svg\n        :target: https://codecov.io/gh/pycontribs/jenkinsapi\n\nInstallation\n------------\n\n.. code-block:: bash\n\n    pip install jenkinsapi\n\nImportant Links\n---------------\n* `Documentation <http://pycontribs.github.io/jenkinsapi/>`__\n* `Source Code <https://github.com/pycontribs/jenkinsapi>`_\n* `Support and bug-reports <https://github.com/pycontribs/jenkinsapi/issues?direction=desc&sort=comments&state=open>`_\n* `Releases <https://pypi.org/project/jenkinsapi/#history>`_\n\n\nAbout this library\n-------------------\n\nJenkins is the market leading continuous integration system.\n\nJenkins (and its predecessor Hudson) are useful projects for automating common development tasks (e.g. unit-testing, production batches) - but they are somewhat Java-centric.\n\nJenkinsapi makes scripting Jenkins tasks a breeze by wrapping the REST api into familiar python objects.\n\nHere is a list of some of the most commonly used functionality\n\n* Add, remove, and query Jenkins jobs\n* Control pipeline execution\n    * Query the results of a completed build\n    * Block until jobs are complete or run jobs asyncronously\n    * Get objects representing the latest builds of a job\n* Artifact management\n    * Search for artifacts by simple criteria\n    * Install artifacts to custom-specified directory structures\n* Search for builds by source code revision\n* Create, destroy, and monitor\n    * Build nodes (Webstart and SSH slaves)\n    * Views (including nested views using NestedViews Jenkins plugin)\n    * Credentials (username/password and ssh key)\n* Authentication support for username and password\n* Manage jenkins and plugin installation\n\nFull library capabilities are outlined in the `Documentation <http://pycontribs.github.io/jenkinsapi/>`__\n\nGet details of jobs running on Jenkins server\n---------------------------------------------\n\n.. code-block:: python\n\n    \"\"\"Get job details of each job that is running on the Jenkins instance\"\"\"\n    def get_job_details():\n        # Refer Example #1 for definition of function 'get_server_instance'\n        server = get_server_instance()\n        for job_name, job_instance in server.get_jobs():\n            print 'Job Name:%s' % (job_instance.name)\n            print 'Job Description:%s' % (job_instance.get_description())\n            print 'Is Job running:%s' % (job_instance.is_running())\n            print 'Is Job enabled:%s' % (job_instance.is_enabled())\n\nDisable/Enable a Jenkins Job\n----------------------------\n\n.. code-block:: python\n\n    def disable_job():\n        \"\"\"Disable a Jenkins job\"\"\"\n        # Refer Example #1 for definition of function 'get_server_instance'\n        server = get_server_instance()\n        job_name = 'nightly-build-job'\n        if (server.has_job(job_name)):\n            job_instance = server.get_job(job_name)\n            job_instance.disable()\n            print 'Name:%s,Is Job Enabled ?:%s' % (job_name,job_instance.is_enabled())\n\nUse the call ``job_instance.enable()`` to enable a Jenkins Job.\n\n\nKnown issues\n------------\n* Job deletion operations fail unless Cross-Site scripting protection is disabled.\n\nFor other issues, please refer to the `support URL <https://github.com/pycontribs/jenkinsapi/issues?direction=desc&sort=comments&state=open>`_\n\nDevelopment\n-----------\n\n* Make sure that you have Java_ installed. Jenkins will be automatically\n  downloaded and started during tests.\n* Create virtual environment for development\n* Install package in development mode\n\n.. code-block:: bash\n\n    uv sync\n\n* Make your changes, write tests and check your code\n\n.. code-block:: bash\n\n    uv run pytest -sv\n\nPython versions\n---------------\n\nThe project has been tested against Python versions:\n\n* 3.9 - 3.13\n\nJenkins versions\n----------------\n\nProject tested on both stable (LTS) and latest Jenkins versions.\n\nProject Contributors\n--------------------\n\n* Aleksey Maksimov (ctpeko3a@gmail.com)\n* Salim Fadhley (sal@stodge.org)\n* Ramon van Alteren (ramon@vanalteren.nl)\n* Ruslan Lutsenko (ruslan.lutcenko@gmail.com)\n* Cleber J Santos (cleber@simplesconsultoria.com.br)\n* William Zhang (jollychang@douban.com)\n* Victor Garcia (bravejolie@gmail.com)\n* Bradley Harris (bradley@ninelb.com)\n* Kyle Rockman (kyle.rockman@mac.com)\n* Sascha Peilicke (saschpe@gmx.de)\n* David Johansen (david@makewhat.is)\n* Misha Behersky (bmwant@gmail.com)\n* Clinton Steiner (clintonsteiner@gmail.com)\n\nPlease do not contact these contributors directly for support questions! Use the GitHub tracker instead.\n\n.. _Java: https://www.oracle.com/java/technologies/downloads/#java21\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Python API for accessing resources on a Jenkins continuous-integration server.",
    "version": "0.3.15",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8ab93dd460343ebbe834d90735a512983631232d30023d6cfc05961cd1e9f96d",
                "md5": "5e4d82518707ddf109a3c3aef4e0c1c7",
                "sha256": "20c63145c4fc03c6a658e0ae873bb95be152fe794acd89ebdafe2d2aa1d97171"
            },
            "downloads": -1,
            "filename": "jenkinsapi-0.3.15-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5e4d82518707ddf109a3c3aef4e0c1c7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 70923,
            "upload_time": "2025-08-20T20:44:14",
            "upload_time_iso_8601": "2025-08-20T20:44:14.247322Z",
            "url": "https://files.pythonhosted.org/packages/8a/b9/3dd460343ebbe834d90735a512983631232d30023d6cfc05961cd1e9f96d/jenkinsapi-0.3.15-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d46b498191b0ba2d547f621bd0a7ef07d1dd5fc136a8680591ebd5c672793741",
                "md5": "17b4a1f653f25d03946755b8efe8cb7c",
                "sha256": "04f62478b2ff81729e166141d4cb741f6b0b426f68265754ea8d13582cdd5482"
            },
            "downloads": -1,
            "filename": "jenkinsapi-0.3.15.tar.gz",
            "has_sig": false,
            "md5_digest": "17b4a1f653f25d03946755b8efe8cb7c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 57480,
            "upload_time": "2025-08-20T20:44:15",
            "upload_time_iso_8601": "2025-08-20T20:44:15.513404Z",
            "url": "https://files.pythonhosted.org/packages/d4/6b/498191b0ba2d547f621bd0a7ef07d1dd5fc136a8680591ebd5c672793741/jenkinsapi-0.3.15.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-20 20:44:15",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "jenkinsapi"
}
        
Elapsed time: 1.19379s