click-compose
Composable Click callback utilities for building flexible CLI applications.
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- 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 · maintenance · safety
MIT (permissive) — MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.
last release 2025-10-27 (291 days) · last repo commit 2026-08-14 · 1 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 170,828 downloads/mo, #10,386 on PyPI
Alternatives
Verify before relying
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}")- 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.
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 on this page. Verify before relying on it.
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
click-compose on PyPI
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.
Requires Python 3.10 or later.
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}")
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 the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesbeartypeclick |
| Maintenance | Actively maintained 291 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 170,828 / month, #10,386 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Software Development :: Libraries :: Python Modules |
Evidence: click_compose-2025.10.27.3-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “click callback composition”
- click-composeProvides composable callback utilities for Click CLI applications,…
- opentelemetry-instrumentation-asyncclickAdds OpenTelemetry tracing to asyncclick CLI applications, capturing…
- container-inspectorAnalyzes Docker images, containers, and virtual machine images to…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also click · click-config-file · cligj · asyncclick · click-help-colors · click-datetime · rich-click · auto-click-auto · lib-cli-exit-tools · click-configfile