skillfed

evergreen.py

Python client for the Evergreen API

evergreen-py v3.19.1 3.3M downloads/30d#2,659 on PyPI2
Permissive license Apache-2.0 Active released

What it is and what it does

Evergreen.py is a Python client library for interacting with MongoDB's Evergreen continuous integration platform via its V2 REST API. It provides both a programmatic interface for Python applications and a command-line tool (evg-api) for quick queries. The library wraps HTTP requests to Evergreen using standard dependencies like requests, pydantic for data validation, and PyJWT for authentication, allowing developers to fetch and manipulate build, test, host, and project data without writing raw API calls.

The package is designed for two main workflows: embedding Evergreen queries into Python automation scripts and ad-hoc command-line inspection of infrastructure state. It handles authentication via username and API key, parses JSON responses into typed Python objects, and exposes a fluent query interface. Most operations are straightforward HTTP calls, though some advanced features (like patch_from_diff) require external tooling.

Use it for:

  • Query build and test status for a project to integrate Evergreen data into dashboards or alerts.
  • Automate task scheduling or host provisioning by scripting Evergreen API calls from Python.
  • Inspect host inventory, distro configuration, and task history via the command-line tool.
  • Embed Evergreen queries into CI/CD pipelines to make decisions based on build state.
  • Generate reports on test failures, task durations, or infrastructure utilization.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A Python client library for the Evergreen API (V2) that enables programmatic and command-line access to Evergreen build and test infrastructure objects.

Yes, if you work with Evergreen infrastructure. The package is actively maintained, has low install friction, carries a permissive license, and provides a well-structured interface to a specialized API. Install it if you need to automate or query Evergreen from Python; skip it if you don't use Evergreen.

Install

evergreen-py on PyPI

pip

pip install evergreen-py

uv

uv add evergreen-py

poetry

poetry add evergreen-py

Installing evergreen.py

Before you install

Low install friction with a pure-wheel distribution and eight well-established runtime dependencies. Actively maintained with a recent release (46 days old) and ongoing repository activity.

License in practice

Licensed under Apache-2.0 (permissive), allowing free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.

Quickstart

pip install evergreen.py

from evergreen.api import EvgAuth, EvergreenApi
api = EvergreenApi.get_api(EvgAuth('username', 'api_key'))
project = api.project_by_id('mongodb-mongo-master')
print(project.display_name)

Requires Python 3.9–3.13; the patch_from_diff API requires the Evergreen CLI to be installed separately on the host.

Verify before relying

  • Actual API coverage and completeness relative to the full Evergreen V2 specification.
  • Performance characteristics and rate-limiting behavior when querying large datasets.
  • Whether all Evergreen object types are supported or only a subset.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (<3.14,>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 8 — Click, python-dateutil, PyYAML, requests, structlog, pydantic, packaging, PyJWT
Maintenance actively maintained — 46 days since the last release
Last repo commit
First released
Downloads 3,324,580/month — #2,659 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: evergreen_py-3.19.1-py3-none-any.whl

License :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9

Tags

evergreen api client pythonevergreen ci integrationbuild infrastructure apimongodb evergreen clientci/cd api wrapperevergreen cli tooltest infrastructure automation
ci-cdapi-clientmongodb

More Build Tools packages