skillfed

shrub.py

Library for creating evergreen configurations

shrub-py v3.11.0 3.0M downloads/30d#2,793 on PyPI1
Permissive license Apache-2.0 Active released

What it is and what it does

shrub.py is a Python library for building Evergreen CI project configurations programmatically. Instead of writing YAML or JSON by hand, you define tasks, build variants, and display tasks as Python objects, then generate the final configuration JSON. It wraps the Evergreen project file format with a type-safe, composable API.

The library depends on PyYaml, pydantic, croniter, dataclasses, and typing-extensions to provide validation and scheduling support. It supports Python 3.9 through 3.14 and requires Python 3.8.1 or later. The main use case is automating CI/CD configuration generation for projects using MongoDB's Evergreen CI system, particularly when you need to generate many similar tasks or variants programmatically.

Use it for:

  • Generate parallel test tasks with shared dependencies and display them under a single display task
  • Programmatically create build variants for multiple platforms or configurations from a template
  • Build task definitions with function calls and parameterized variables without manual JSON editing
  • Automate CI configuration for projects that need dynamic task generation based on input data

Worth the install?

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

Programmatically generate Evergreen project configurations in JSON format by building task, variant, and project objects in Python.

Yes, if you are using Evergreen CI and need to generate configurations programmatically. The package is actively maintained, has low install friction, carries a permissive license, and has no known vulnerabilities. The low star count and niche use case (Evergreen-specific) mean it is not a general-purpose tool, but it is well-suited for its intended audience.

Install

shrub-py on PyPI

pip

pip install shrub-py

uv

uv add shrub-py

poetry

poetry add shrub-py

Installing shrub.py

Before you install

Low install friction with a pure-Python wheel and five runtime dependencies. Active maintenance with a recent release (71 days old) and current commit history.

License in practice

Apache-2.0 permissive license allows commercial and private use with minimal restrictions.

Quickstart

pip install shrub.py

from shrub.v3.evg_project import EvgProject
from shrub.v3.evg_build_variant import BuildVariant
from shrub.v3.evg_task import EvgTask
from shrub.v3.shrub_service import ShrubService

task = EvgTask(name="test", commands=[])
variant = BuildVariant(name="linux", tasks=[])
project = EvgProject(buildvariants=[variant], tasks=[task])
print(ShrubService.generate_json(project))

Verify before relying

  • Whether the package is actively maintained beyond the single recent commit shown, or if development is sporadic
  • What the low star count (1) indicates about adoption or community engagement

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.8.1)
Install friction low — pure-Python wheel
Runtime dependencies 5 — PyYaml, dataclasses, pydantic, typing-extensions, croniter
Maintenance actively maintained — 71 days since the last release
Last repo commit
First released
Downloads 2,997,023/month — #2,793 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: shrub_py-3.11.0-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.14Programming Language :: Python :: 3.9

Tags

evergreen project config generationbuild task definitions programmaticallyci configuration as codeevergreen json buildertask dependency managementdisplay task orchestrationbuild variant configuration
ci-cdevergreenconfig-generation

More Build Tools packages