DEV.co
Open-Source DevOps · pycontribs

jenkinsapi

jenkinsapi is a Python library that wraps Jenkins' REST API into simple Python objects, making it easy to automate Jenkins job management, build execution, and artifact handling. It supports both Hudson and Jenkins servers and includes features for credential management, node configuration, and pipeline control.

Source: GitHub — github.com/pycontribs/jenkinsapi
885
GitHub stars
492
Forks
Python
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorypycontribs/jenkinsapi
Ownerpycontribs
Primary languagePython
LicenseMIT — OSI-approved
Stars885
Forks492
Open issues18
Latest release0.3.23 (2026-04-21)
Last updated2026-06-29
Sourcehttps://github.com/pycontribs/jenkinsapi

What jenkinsapi is

A Python 3.10+ library that provides object-oriented bindings to Jenkins REST API, enabling programmatic job creation/deletion, build querying, artifact retrieval, and slave/credential management. It uses standard HTTP requests with optional logging and supports both username/password and SSH key authentication.

Quickstart

Get the jenkinsapi source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/pycontribs/jenkinsapi.gitcd jenkinsapi# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Jenkins Job Automation & CI/CD Pipeline Scripting

Automate repetitive Jenkins tasks such as enabling/disabling jobs, triggering builds, querying job status, and managing job configuration without manual UI interaction. Ideal for teams building custom CI/CD orchestration layers.

Artifact Management & Build Artifact Retrieval

Programmatically search for and download build artifacts by criteria, install artifacts to custom directory structures, and integrate artifact handling into deployment pipelines or post-build workflows.

Multi-Jenkins Instance Administration

Manage multiple Jenkins servers at scale through Python scripts—create/destroy build nodes, manage views and folders, configure credentials, and monitor plugin installations across distributed Jenkins infrastructure.

Implementation considerations

  • Java runtime required for local development and testing; the project auto-downloads and starts Jenkins during test runs.
  • Authentication model limited to username/password and SSH keys; no OAuth2, SAML, or federated identity support documented.
  • Latest release is 0.3.23 (April 2026); verify compatibility with your target Jenkins version (project states testing on both LTS and latest).
  • Synchronous API design; blocking calls for build completion may require threading/async wrappers for high-concurrency use cases.
  • Requires explicit environment variable or function call to enable debug logging; default is silent, which may hinder troubleshooting.

When to avoid it — and what to weigh

  • Declarative Infrastructure-as-Code Required — If your team requires declarative, version-controlled infrastructure definitions, consider Jenkins Configuration-as-Code (JCasC) or Terraform Jenkins provider instead of imperative Python scripts.
  • Cross-Site Request Forgery (CSRF) Protection Enabled — Documented known issue: job deletion operations fail unless CSRF protection is disabled on the Jenkins server. This may conflict with security policies in regulated environments.
  • Non-Python Development Teams — If your engineering team does not use Python or prefers Java/Groovy, Jenkins Groovy scripts or Java plugins may be more maintainable. This library requires Python runtime and familiarity.
  • Real-Time Event-Driven Automation — jenkinsapi is polling-based and synchronous. For real-time, event-driven responses to Jenkins state changes, Jenkins webhooks or event streaming solutions are more appropriate.

License & commercial use

Released under MIT License, a permissive open-source license allowing use, modification, and distribution with minimal restrictions.

MIT License permits commercial use without explicit permission requirements. However, verify your Jenkins deployment licensing separately. No warranty is provided; test thoroughly in your environment before production deployment.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceHigh
Security considerations

Credentials (username/password, SSH keys) passed in plaintext over network to Jenkins API; ensure TLS/HTTPS is enforced on Jenkins endpoint. The library itself does not validate certificate chains or offer certificate pinning. No audit logging of API calls built-in. CSRF protection incompatibility noted for job deletion; disabling CSRF increases attack surface.

Alternatives to consider

jenkins-python-client / python-jenkins

Similar REST API wrapper; compare feature coverage, API surface, and maintenance status if considering alternatives in the Python ecosystem.

Jenkins Groovy Scripting / Jenkins CLI

Native to Jenkins; avoids external Python dependency and may integrate more seamlessly with Jenkins plugins and security models.

Terraform Jenkins Provider / Jenkins Configuration-as-Code (JCasC)

Declarative, version-controlled, and portable; better suited for infrastructure-as-code and multi-environment management than imperative Python scripts.

Software development agency

Build on jenkinsapi with DEV.co software developers

Evaluate jenkinsapi for your Jenkins automation needs. Start with a small pilot to validate REST API access, credential handling, and CSRF protection settings in your environment.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

jenkinsapi FAQ

Does jenkinsapi work with Jenkins behind a proxy or with HTTPS?
Unknown. The README does not document proxy configuration or certificate handling. Review source code or test in your environment.
Can I use jenkinsapi with Jenkins security realms (LDAP, Active Directory, OAuth)?
jenkinsapi authenticates via username/password or SSH keys. Higher-level security realms (LDAP, OAuth) are delegated to Jenkins; the library passes credentials to Jenkins' existing auth backend. Detailed compatibility not documented.
Is there async/await support for non-blocking build monitoring?
No. The API is synchronous and blocking. Async support would require threading or external async wrapper libraries.
What Python versions are supported?
Tested against Python 3.10–3.14 (per CI testing noted in README). Older Python 2.x versions not supported.

Software development & web development with DEV.co

Need help beyond evaluating jenkinsapi? DEV.co is a software development agency offering software development services and web development for teams of every size. Our software developers and web developers build custom software, web applications, APIs, and open-source devops integrations — and maintain them long-term.

Ready to Automate Jenkins?

Evaluate jenkinsapi for your Jenkins automation needs. Start with a small pilot to validate REST API access, credential handling, and CSRF protection settings in your environment.