openscm_zenodo.cli.app#
CLI app
Functions:
| Name | Description |
|---|---|
cli |
Entrypoint for the command-line interface |
create_new_version_command |
Create a new version of a record |
remove_files_command |
Remove files from a Zenodo deposition |
retrieve_bibtex_command |
Retrieve bibtex entry |
retrieve_metadata_command |
Retrieve metadata |
update_metadata_command |
Update metadata |
upload_files_command |
Upload files to a Zenodo deposition |
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,
no_logging: Annotated[
Optional[bool],
Option(
--no - logging,
help="Disable all logging.\n\nIf supplied, overrides `--logging-config`",
),
] = None,
logging_level: Annotated[
Optional[str],
Option(
help="Logging level to use.\n\nThis is only applied if no other logging configuration flags are supplied."
),
] = None,
logging_config: Annotated[
Optional[Path],
Option(
help="Path to the logging configuration file.\n\nThis will be loaded with [loguru-config](https://github.com/erezinman/loguru-config).\nIf supplied, this overrides any value provided with `--log-level`."
),
] = None,
) -> None
Entrypoint for the command-line interface
Source code in src/openscm_zenodo/cli/app.py
create_new_version_command #
create_new_version_command(
any_deposition_id: Annotated[
str,
Argument(
help="A deposition ID related to the record you wish to interact with. You can pick any published deposit/version. This ID is most easily extracted from the URL provided by Zenodo. It is just the digits at the end of that link. For example, if Zenodo URL is https://zenodo.org/records/10702583, then the deposit ID is 10702583."
),
],
token: TOKEN_TYPE,
metadata_file: METADATA_FILE_TYPE = None,
publish: Annotated[
bool,
Option(
--publish,
help="Publish the newly created version after creating it and uploading the files",
),
] = False,
zenodo_domain: ZENODO_DOMAIN_TYPE = production,
files_to_upload: FILES_TO_UPLOAD_TYPE = None,
n_threads: N_THREADS_TYPE = 4,
) -> None
Create a new version of a record
Source code in src/openscm_zenodo/cli/app.py
remove_files_command #
remove_files_command(
deposition_id: DEPOSITION_ID_TYPE,
token: TOKEN_TYPE,
files_to_remove: Annotated[
Optional[list[Path]],
Argument(
help="Files to remove from the Zenodo deposition"
),
] = None,
all: Annotated[
bool, Option(--all, help="Remove all files")
] = False,
zenodo_domain: ZENODO_DOMAIN_TYPE = production,
) -> None
Remove files from a Zenodo deposition
Source code in src/openscm_zenodo/cli/app.py
retrieve_bibtex_command #
retrieve_bibtex_command(
deposition_id: DEPOSITION_ID_TYPE,
token: TOKEN_TYPE = None,
zenodo_domain: ZENODO_DOMAIN_TYPE = production,
) -> None
Retrieve bibtex entry
Source code in src/openscm_zenodo/cli/app.py
retrieve_metadata_command #
retrieve_metadata_command(
deposition_id: DEPOSITION_ID_TYPE,
token: TOKEN_TYPE = None,
user_controlled_only: Annotated[
bool,
Option(
help="Only return metadata keys that the user can control.\n\nIf this is `True`, the metadata keys controlled by Zenodo (e.g. the DOI)\nare removed from the returned metadata.\nThis flag is important to use\nif you want to use the retrieved metadata\nas the starting point for the next version of a deposit."
),
] = False,
zenodo_domain: ZENODO_DOMAIN_TYPE = production,
) -> None
Retrieve metadata
Source code in src/openscm_zenodo/cli/app.py
update_metadata_command #
update_metadata_command(
deposition_id: DEPOSITION_ID_TYPE,
metadata_file: METADATA_FILE_TYPE,
token: TOKEN_TYPE,
zenodo_domain: ZENODO_DOMAIN_TYPE = production,
reserve_doi: Annotated[
bool,
Option(
--reserve - doi,
help="Reserve a DOI while updating the metadata. This will overwrite any value in the metadata file supplied.",
),
] = False,
) -> None
Update metadata
If the --reserve-doi flag is used,
this prints the reserved DOI to stdout.
Source code in src/openscm_zenodo/cli/app.py
upload_files_command #
upload_files_command(
deposition_id: DEPOSITION_ID_TYPE,
files_to_upload: FILES_TO_UPLOAD_TYPE,
token: TOKEN_TYPE,
zenodo_domain: ZENODO_DOMAIN_TYPE = production,
n_threads: N_THREADS_TYPE = 4,
) -> None
Upload files to a Zenodo deposition
Source code in src/openscm_zenodo/cli/app.py
version_callback #
If requested, print the version string and exit