clickdump
Serialize Click commands and groups.
Installation
pip install clickdump
Usage
import click
import clickdump
@click.command()
@click.option("-v", "--verbose", count=True, help="Verbosity")
@click.option("--name", default="world", help="Who to greet")
@click.argument("files", nargs=-1)
def cli(name, verbose, files):
"""A simple CLI tool."""
# Serialize to dict
data = clickdump.dump(cli)
# Serialize to JSON string
json_str = clickdump.dumps(cli, indent=2)
Groups and subcommands
@click.group()
@click.option("--debug/--no-debug", default=False)
def cli(debug):
"""A CLI with subcommands."""
@cli.command()
@click.option("--output", "-o", default="out.txt")
@click.argument("src")
def build(output, src):
"""Build the project."""
# Subcommand with parent for full program name
data = clickdump.dump(build, parent=cli)
# -> prog="cli build"
JSON Schema
Output follows the same schema as argdump
($schema: https://niwrap.dev/argdump/schema-v1.json).
Features
- All Click parameter types: options, arguments, flags, counts, choices, paths, files
- Nested groups with subparsers (click.Group)
- Type introspection: builtins, Path, Choice, File, IntRange, FloatRange, DateTime, UUID, Tuple, and callable converters
- Click-specific extensions:
hidden,envvar,prompt,show_default,is_flag,count,multiple,flag_value - Program name resolution via parent tree traversal for nested subcommands
- Mutual exclusion and argument group serialization
- Environment metadata (
$env) for reproducibility
Options
# Exclude environment metadata
clickdump.dump(cmd, include_env=False)
# Exclude hidden options
clickdump.dump(cmd, include_hidden=False)
# Compute full program name from parent group
clickdump.dump(subcmd, parent=root_group)
# Override the root program name
clickdump.dump(subcmd, parent=root_group, prog="mycli")
Limitations
- This is a serialize-only library (no
load/loadsequivalent). - Lambda and closure type converters cannot be fully serialized and will have
serializable: false. - Custom
click.ParamTypesubclasses that are not standard built-in types may be marked as unknown.
License
MIT
Metadata
Release files for clickdump 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| clickdump-0.1.1.tar.gz | 8.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| clickdump-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.6 kB
Release files / clickdump-0.1.1.tar.gz
| Download URL | clickdump-0.1.1.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9f81be17317278c30f3efed6b13c17b10a05a1f4394ef2aaa6c7bed1565d693e
|
|
BLAKE2b-256 checksum How to use checksums |
1da6ad0ac78b326d6a736f069f9d74d653e9eb98aabd6b2cd76830c977848c68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 17, 2026.
Transparency logRelease files / clickdump-0.1.1-py3-none-any.whl
| Download URL | clickdump-0.1.1-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e829532251ae343ec883729c6651f8a9ab6c13355e50029e3a1858f8360c6d23
|
|
BLAKE2b-256 checksum How to use checksums |
cef245c11da357c65f617e66b43bda378c6f94504faf96dd9d7fbe4eb0067df5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 17, 2026.
Transparency log