Skip to content
Back to top
View this page

# `cloup.types`

Parameter types and “shortcuts” for creating commonly used types.

## Functions

`path`(*[, path_type, exists, file_okay, ...]) | Shortcut for `click.Path` with `path_type=pathlib.Path`.
`dir_path`(*[, path_type, exists, readable, ...]) | Shortcut for `click.Path` with `file_okay=False, path_type=pathlib.Path`.
`file_path`(*[, path_type, exists, readable, ...]) | Shortcut for `click.Path` with `dir_okay=False, path_type=pathlib.Path`.

## Contents

cloup.types.path(*, path_type=pathlib.Path, exists=False, file_okay=True, dir_okay=True, readable=True, writable=False, executable=False, resolve_path=False, allow_dash=False)

  Shortcut for `click.Path` with `path_type=pathlib.Path`.

  Parameters:

    - path_type (Type[Any])

    - exists (bool)

    - file_okay (bool)

    - dir_okay (bool)

    - readable (bool)

    - writable (bool)

    - executable (bool)

    - resolve_path (bool)

    - allow_dash (bool)

  Return type:

    Path

cloup.types.dir_path(*, path_type=pathlib.Path, exists=False, readable=True, writable=False, executable=False, resolve_path=False, allow_dash=False)

  Shortcut for `click.Path` with `file_okay=False, path_type=pathlib.Path`.

  Parameters:

    - path_type (Type[Any])

    - exists (bool)

    - readable (bool)

    - writable (bool)

    - executable (bool)

    - resolve_path (bool)

    - allow_dash (bool)

  Return type:

    Path

cloup.types.file_path(*, path_type=pathlib.Path, exists=False, readable=True, writable=False, executable=False, resolve_path=False, allow_dash=False)

  Shortcut for `click.Path` with `dir_okay=False, path_type=pathlib.Path`.

  Parameters:

    - path_type (Type[Any])

    - exists (bool)

    - readable (bool)

    - writable (bool)

    - executable (bool)

    - resolve_path (bool)

    - allow_dash (bool)

  Return type:

    Path