Telemetry

A simple pre-configured --telemetry/--no-telemetry option flag, that is respecting the proposed DO_NOT_TRACK environment variable as a unified standard to opt-out of telemetry for TUI/console apps.

It does nothing else.

click_extra.telemetry API

        classDiagram
  ExtraOption <|-- TelemetryOption
    

Telemetry utilities.

class click_extra.telemetry.TelemetryOption(param_decls=None, default=False, expose_value=False, envvar=None, show_envvar=True, help='Collect telemetry and usage data.', **kwargs)[source]

Bases: ExtraOption

A pre-configured --telemetry/--no-telemetry option flag.

Respects the proposed DO_NOT_TRACK environment variable as a unified standard to opt-out of telemetry for TUI/console apps.

The DO_NOT_TRACK convention takes precedence over the user-defined environment variables and the auto-generated values.

The resolved value is stored in ctx.meta[click_extra.context.TELEMETRY], aligning with every other Click Extra option’s per-invocation context-meta storage pattern.

set_telemetry(ctx, param, value)[source]

Store the resolved telemetry opt-in flag on the context’s meta dict.

Reads via click_extra.context.get(ctx, click_extra.context.TELEMETRY). Renamed from save_telemetry to align with the set_<key> convention used by every other ctx.meta-writing callback.

Return type:

None