<commit_before>Using Python-Jenkins
====================

The python-jenkins library allows management of a Jenkins server through
the Jenkins REST endpoints. Below are examples to get you started using
the library.  If you need further help take a look at the :doc:`api`
docs for more details.


Example 1: Get version of Jenkins
---------------------------------

This is an example showing how to connect to a Jenkins instance and
retrieve the Jenkins server version.

::

    import jenkins

    server = jenkins.Jenkins('http://localhost:8080', username='myuser', password='<PASSWORD>')
    user = server.get_whoami()
    version = server.get_version()
    print('Hello %s from Jenkins %s' % (user['fullName'], jenkins_version))

The above code prints the the fullName attribute of the user and the version of
the Jenkins master running on 'localhost:8080'. For example, it may print<commit_msg>Fixed a minor typo in example of Python-jenkins<commit_after>Using Python-Jenkins
====================

The python-jenkins library allows management of a Jenkins server through
the Jenkins REST endpoints. Below are examples to get you started using
the library.  If you need further help take a look at the :doc:`api`
docs for more details.


Example 1: Get version of Jenkins
---------------------------------

This is an example showing how to connect to a Jenkins instance and
retrieve the Jenkins server version.

::

    import jenkins

    server = jenkins.Jenkins('http://localhost:8080', username='myuser', password='<PASSWORD>')
    user = server.get_whoami()
    version = server.get_version()
    print('Hello %s from Jenkins %s' % (user['fullName'], version))

The above code prints the the fullName attribute of the user and the version of
the Jenkins master running on 'localhost:8080'. For example, it may print
{'fraction_non_alphanumeric': 0.1276013143483023, 'fraction_numerical': 0.009857612267250822, 'mean_word_length': 3.7454545454545456, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1423976', 'n_tokens_mistral': 498, 'n_tokens_neox': 453, 'n_words': 222}