--- id: click-compose version: "2025.10.27.3" license: MIT license_treatment: permissive maintenance: active --- # click-compose — Composable Click callback utilities for building flexible CLI applications. License: permissive · Maintenance: active · Downloads: 170.8K/mo ## What it is and what it does click-compose is a small utility library that adds composition patterns to Click's callback system. It provides two main functions: multi_callback chains multiple validators or transformations into a single callback that applies them in sequence, and sequence_validator applies a validator to each element in a multi-value parameter. The library sits on top of Click and beartype, requiring Python 3.10 or later. The package addresses a common pattern in CLI development where you want to reuse validation logic across multiple parameters or combine independent validators without nesting them manually. Instead of writing wrapper callbacks or repeating validation code, you compose validators declaratively at the parameter level. Use it for: - Chain multiple validation rules on a single CLI option without writing nested callback wrappers. - Apply the same validator to each element in a multi-value parameter using sequence_validator. - Build reusable validator functions that can be composed into different CLI commands. - Validate numeric ranges or string patterns by combining independent validator callbacks. - Reduce boilerplate in Click command definitions by composing validators declaratively. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides composable callback utilities for Click CLI applications, enabling you to chain multiple validators or transformations together and apply them to command parameters. Yes, if you build Click CLIs and want to reduce callback boilerplate. The library is lightweight, has low install friction, carries no security vulnerabilities, and uses a permissive license. However, it is very new (first release in October 2025) with minimal real-world adoption, so treat it as a convenience tool rather than a critical dependency—the same patterns can be implemented manually if needed. ## Install pip install click-compose uv add click-compose poetry add click-compose ## Installing click-compose Before you install: Low friction install with only two runtime dependencies (beartype and click). Active maintenance with a recent commit history, though the project is young and has minimal adoption signals. License in practice: MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects. Quickstart: pip install click-compose import click from click_compose import multi_callback def validate_positive(_ctx, _param, value): if value <= 0: raise click.BadParameter("Must be positive") return value @click.command() @click.option("--count", type=int, callback=multi_callback(callbacks=[validate_positive])) def cmd(count): click.echo(f"Count: {count}") Requires Python 3.10 or later. Verify before relying: - Whether beartype is used for runtime type checking or only as a development dependency. - Performance characteristics when chaining many validators in sequence. - Compatibility with Click extensions or custom parameter types beyond built-in types. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 170.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags click callback composition, cli parameter validation, click multi-validator, composable click callbacks, cli argument chaining, click sequence validation, reusable cli validators, click-extension, cli-validation, callback-composition [View on SkillFed](https://skillfed.io/packages/click-compose) · [View on PyPI](https://pypi.org/project/click-compose/)