diff --git a/docs/source/api_doc/entry/index.rst b/docs/source/api_doc/entry/index.rst index 42dc6a1db9..fa19907297 100644 --- a/docs/source/api_doc/entry/index.rst +++ b/docs/source/api_doc/entry/index.rst @@ -15,4 +15,5 @@ hfutils.entry download ls upload + whoami diff --git a/docs/source/api_doc/entry/whoami.rst b/docs/source/api_doc/entry/whoami.rst new file mode 100644 index 0000000000..934eaa47b9 --- /dev/null +++ b/docs/source/api_doc/entry/whoami.rst @@ -0,0 +1,9 @@ +hfutils.entry.whoami +================================ + +.. currentmodule:: hfutils.entry.whoami + +.. automodule:: hfutils.entry.whoami + + + diff --git a/hfutils/config/meta.py b/hfutils/config/meta.py index d62b78ec5a..2ecc4a7310 100644 --- a/hfutils/config/meta.py +++ b/hfutils/config/meta.py @@ -7,7 +7,7 @@ __TITLE__ = 'hfutils' #: Version of this project. -__VERSION__ = '0.2.2' +__VERSION__ = '0.2.3' #: Short description of the project, will be included in ``setup.py``. __DESCRIPTION__ = 'Useful utilities for huggingface' diff --git a/hfutils/entry/whoami.py b/hfutils/entry/whoami.py index 829d0d1fc4..c366ce08d4 100644 --- a/hfutils/entry/whoami.py +++ b/hfutils/entry/whoami.py @@ -7,10 +7,27 @@ def _add_whoami_subcommand(cli: click.Group) -> click.Group: + """ + Add the 'whoami' subcommand to the CLI. + + This command displays the current identification. + + :param cli: The Click CLI application. + :type cli: click.Group + :return: The modified Click CLI application. + :rtype: click.Group + """ + @cli.command('whoami', help='See the current identification.\n\n' 'Set environment $HF_TOKEN to use your own access token.', context_settings=CONTEXT_SETTINGS) def whoami(): + """ + Display the current identification. + + This function retrieves the current user's identification from the Hugging Face Hub API and displays it. + + """ hf_client = get_hf_client() try: info = hf_client.whoami()