Universal Python client for Jenkins
Python client for jenkins which supports both sync and async syntax with same API interfaces.
Comparison to other packages | |||
---|---|---|---|
Name | Sync | Async | Python version |
ujenkins | YES | YES | 3.6+ |
aiojenkins | NO | YES | 3.5+ |
python-jenkins | YES | NO | 3.4+ |
jenkinsapi | YES | NO | 3.4+ |
Latest release from PyPI
pip3 install ujenkins
Or latest developing version
pip3 install git+https://github.com/pbelskiy/ujenkins
Main advantage of this package is that same API interfaces used for sync and async syntax.
Get Jenkins version using sync client:
from ujenkins import JenkinsClient
def example():
client = JenkinsClient('http://server', 'user', 'password')
version = client.system.get_version()
print(version)
example()
With async client:
import asyncio
from ujenkins import AsyncJenkinsClient
async def example():
client = AsyncJenkinsClient('http://server', 'user', 'password')
version = await client.system.get_version()
print(version)
asyncio.run(example())
Please look at tests directory for more examples.
Prerequisites: tox
Then just run tox, all dependencies and checks will run automatically
tox
Any contributions are welcome!