cmipcite.cli#
Command-line interface
Functions:
| Name | Description |
|---|---|
cli |
Entrypoint for the command-line interface |
get |
Generate citations from CMIP files or tracking IDs or PIDs |
version_callback |
If requested, print the version string and exit |
cli #
cli(
version: Annotated[
Optional[bool],
Option(
--version,
help="Print the version number and exit",
callback=version_callback,
is_eager=True,
),
] = None,
) -> None
Entrypoint for the command-line interface
Source code in src/cmipcite/cli/__init__.py
get #
get(
in_values: Annotated[
list[str],
Argument(
help="Tracking IDs, PIDs or file paths for which to generate citations."
),
],
out_path: Annotated[
Union[Path, None],
Option(
help="Path in which to write the output. If not provided, it is printed."
),
] = None,
format: Annotated[
FormatOption,
Option(
help="Format in which to retrieve the citations."
),
] = TEXT,
author_list_style: Annotated[
AuthorListStyle,
Option(
help="Whether the author list should be long (all names) or short (et al.)."
),
] = LONG,
doi_granularity: Annotated[
DOIGranularity,
Option(
help="Desired granularity of the retrieved DOIs."
),
] = MODEL,
multi_dataset_handling: Annotated[
Optional[MultiDatasetHandlingStrategy],
Option(
help="Strategy to use when a given ID or file belongs to multiple datasets."
),
] = None,
handle_server_url: Annotated[
str,
Option(
help="URL of the server to use for handling tracking IDs i.e. handles"
),
] = "http://hdl.handle.net/",
) -> None
Generate citations from CMIP files or tracking IDs or PIDs
Source code in src/cmipcite/cli/__init__.py
version_callback #
If requested, print the version string and exit