shrub.py
Library for creating evergreen configurations
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-pyuv
uv add shrub-pypoetry
poetry add shrub-pyInstalling 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
Tags
More Build Tools packages
Provides reusable utilities for Python…
permissive · top 100 on PyPI
tqdmWraps any iterable to display a real-time…
copyleft · top 100 on PyPI
pippip is the standard installer for Python…
permissive · top 100 on PyPI
hatchlingHatchling is a standards-compliant Python build…
permissive · top 100 on PyPI
grpcio-toolsGenerates Python gRPC service stubs and message…
permissive · top 1,000 on PyPI
pre-commitpre-commit is a framework for installing and…
permissive · top 1,000 on PyPI
evergreen.pyA Python client library for the Evergreen API…
permissive · top 5,000 on PyPI
taskcluster-urlsGenerates standardized URLs for Taskcluster…
copyleft · top 5,000 on PyPI
taskipyTaskipy is a task runner that lets you define…
permissive · top 5,000 on PyPI
jsonschema-gentypesGenerates Python TypedDict types from JSON…
permissive · top 15,000 on PyPI
taskcluster-taskgraphTaskgraph generates and submits task graphs to…
copyleft · top 5,000 on PyPI
curatorbinPackages the MongoDB Curator tool as a Python…
unclear · top 5,000 on PyPI
azure-appconfiguration-providerLoads application configurations from Azure App…
permissive · top 5,000 on PyPI
sample-helper-aws-appconfigFetches and caches configuration from AWS…
permissive · top 15,000 on PyPI
jupyter-packagingProvides build tools and utilities for…
permissive · top 5,000 on PyPI
PaverPaver is a Python-based task automation and…
permissive · top 15,000 on PyPI