Skip to content

Commit

Permalink
dev(narugo): release as v0.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
narugo1992 committed May 2, 2024
1 parent ae996bd commit eac0b1e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/source/api_doc/entry/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ hfutils.entry
download
ls
upload
whoami

9 changes: 9 additions & 0 deletions docs/source/api_doc/entry/whoami.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
hfutils.entry.whoami
================================

.. currentmodule:: hfutils.entry.whoami

.. automodule:: hfutils.entry.whoami



2 changes: 1 addition & 1 deletion hfutils/config/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
17 changes: 17 additions & 0 deletions hfutils/entry/whoami.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit eac0b1e

Please sign in to comment.