all2md.cli.input_items

CLI input abstractions for handling local, remote, and stdin sources.

class all2md.cli.input_items.CLIInputItem

Bases: object

Represents a single CLI input entry with context for processing.

raw_input: str | Path | bytes
kind: Literal['local_file', 'remote_uri', 'stdin_bytes']
display_name: str
path_hint: Path | None
original_argument: str | None
metadata: dict[str, str]
is_local_file() bool

Check if this input represents a local file.

Returns:

True if the input is a local file, False otherwise

Return type:

bool

is_remote() bool

Check if this input represents a remote URI.

Returns:

True if the input is a remote URI, False otherwise

Return type:

bool

is_stdin() bool

Check if this input represents stdin bytes.

Returns:

True if the input is from stdin, False otherwise

Return type:

bool

best_path() Path | None

Return the most useful Path representation for this input, when available.

property name: str

Return a human-friendly display name.

property stem: str

Return the best-effort stem for this input.

property suffix: str

Return the suffix (including leading dot) when available.

derive_output_stem(index: int) str

Return a deterministic stem suitable for output naming.

__init__(raw_input: str | ~pathlib.Path | bytes, kind: ~typing.Literal['local_file', 'remote_uri', 'stdin_bytes'], display_name: str, path_hint: ~pathlib.Path | None = None, original_argument: str | None = None, metadata: dict[str, str] = <factory>) None