+
    &j                        R t ^ RIt^ RIt^ RIHtHt ^ RIt^ RIHtH	t	 ^ RI
Ht ^RIHtHtHtHt ^RIHtHt ]! ]4      t]P*                  ! R] U u/ uF  q V bK  	  up ]R7      tR	 R
 lt]! RR7      t]P5                  R. ROR7      RR R ll4       t]P5                  R. ROR7      RR R ll4       t]P5                  RR.R7      R R R ll4       t]P5                  RR.R7      R R R ll4       tR# u up i )!a  Contains commands to interact with papers on the Hugging Face Hub.

Usage:
    # list daily papers (most recently submitted)
    hf papers ls

    # list trending papers
    hf papers ls --sort=trending

    # list papers from a specific date, ordered by upvotes
    hf papers ls --date=2025-01-23

    # list today's papers, ordered by upvotes
    hf papers ls --date=today

    # list papers from a specific week
    hf papers ls --week=2025-W09

    # list papers by a specific submitter
    hf papers ls --submitter=someuser

    # search papers
    hf papers search "vision language"

    # get info about a paper
    hf papers info 2502.08025

    # read a paper as markdown
    hf papers read 2502.08025
N)	Annotatedget_args)CLIErrorHfHubHTTPError)DailyPapersSort_T)LimitOptTokenOpt
get_hf_apityper_factory)_dataclass_to_dictoutPaperSortEnum)typec                L    V ^8  d   QhR\         R,          R\         R,          /# )   valueNreturn)str)formats   "r/Users/jameslopez/projects/CWCArchive/cwc-podcast/.venv/lib/python3.14/site-packages/huggingface_hub/cli/papers.py__annotate__r   C   s"      sTz cDj     c                    V f   R# V P                  4       R8X  d-   \        P                  P                  4       P	                  4       # V # )z6Parse date option, converting 'today' to current date.Ntoday)lowerdatetimedater   	isoformat)r   s   &r   _parse_dater   C   s9    }{{}}}""$..00Lr   z Interact with papers on the Hub.helpz	list | ls)examplesc                   V ^8  d   QhR\         \        R,          \        P                  ! R\        R7      3,          R\         \        R,          \        P                  ! RR7      3,          R\         \        R,          \        P                  ! R	R7      3,          R
\         \        R,          \        P                  ! RR7      3,          R\         \
        R,          \        P                  ! RR7      3,          R\        R\        RR/# )r   r   Nz+Date in ISO format (YYYY-MM-DD) or 'today'.)r    callbackweekz'ISO week to filter by, e.g. '2025-W09'.r   monthz;Month to filter by in ISO format (YYYY-MM), e.g. '2025-02'.	submitterz$Filter by username of the submitter.sortzSort results.limittokenr   )r   r   typerOptionr   r   r   r   )r   s   "r   r   r   Z   s     . .
d
> 	
	. d
CD	F. d
WX	Z.  d
@A	C!.( /*	,).0 1.2 3.4 
5.r   c           	        \        VR7      pV'       d   VP                  MRp. p	VP                  V VVVVVR7       Fq  p
\        V
4      pVP	                  R4      ;'       g    / pVP	                  R4      ;'       g    VP	                  R4      ;'       g    RVR&   V	P                  V4       Ks  	  \        P                  ! V	. R
OR	7       R# )zList daily papers on the Hub.r)   N)r   r$   r%   r&   r'   r(   submitted_byfullnameusername submitted_by_nameheaders)idtitleupvotescommentspublished_atr2   )r	   r   list_daily_papersr   getappendr   table)r   r$   r%   r&   r'   r(   r)   apisort_keyresults
paper_infoitemr.   s   &&&&&&&      r   	papers_lsrC   O   s    N 5
!C!tzztHG++ , 
 "*-xx/552$0$4$4Z$@$f$fLDTDTU_D`$f$fdf !t II[r   searchc                    V ^8  d   QhR\         \        \        P                  ! RR7      3,          R\        R\
        RR/# )r   queryzSearch query string.r   r(   r)   r   N)r   r   r*   Argumentr   r   )r   s   "r   r   r      sJ     V VS%...DEEFVV V 
	Vr   c                    \        VR7      pVP                  WR7       Uu. uF  p\        V4      NK  	  pp\        P                  ! V. ROR7       R# u upi )zSearch papers on the Hub.r-   )rF   r(   r3   N)r5   r6   summaryr7   r9   )r	   list_papersr   r   r=   )rF   r(   r)   r>   rA   r@   s   &&&   r   papers_searchrK      sK     5
!C@CV[@ij@i*!*-@iGjIIgTU ks   Ainfozhf papers info 2601.15621c                x    V ^8  d   QhR\         \        \        P                  ! RR7      3,          R\        RR/# r   paper_idz'The arXiv paper ID (e.g. '2502.08025').r   r)   r   Nr   r   r*   rG   r   )r   s   "r   r   r      s:      U^^1Z[[\ 
r   c                    \        VR7      p VP                  V R7      p\        P                  ! T4       R#   \         d2   pTP                  P                  R8X  d   \        RT  R24      Thh Rp?ii ; i)z"Get info about a paper on the Hub.r-   r5     Paper '' not found on the Hub.N)r	   rA   r   responsestatus_coder   r   dict)rO   r)   r>   rL   es   &&   r   papers_inforZ      sn     5
!C~~~*
 HHTN	  ::!!S(WXJ.EFGQN   8 A4,A//A4readzhf papers read 2601.15621c                x    V ^8  d   QhR\         \        \        P                  ! RR7      3,          R\        RR/# rN   rP   )r   s   "r   r   r      s:      U^^1Z[[\ 
r   c                    \        VR7      p VP                  V R7      p\        P                  ! T4       R#   \         d2   pTP                  P                  R8X  d   \        RT  R24      Thh Rp?ii ; i)zRead a paper as markdown.r-   rR   rS   rT   rU   N)r	   
read_paperr   rV   rW   r   r   text)rO   r)   r>   contentrY   s   &&   r   papers_readrb      so     5
!C..H.-
 HHW	  ::!!S(WXJ.EFGQNr[   )zhf papers lszhf papers ls --sort trendingzhf papers ls --date 2025-01-23zhf papers ls --week 2025-W09z hf papers ls --submitter akhaliqzhf papers ls --format json)NNNNN2   N)z"hf papers search "vision language"z1hf papers search "attention mechanism" --limit 10z*hf papers search "diffusion" --format json)   N)N)__doc__r   enumtypingr   r   r*   huggingface_hub.errorsr   r   huggingface_hub.hf_apir   
_cli_utilsr   r   r	   r
   _outputr   r   _SORT_OPTIONSEnumr   r   r   
papers_clicommandrC   rK   rZ   rb   )ss   0r   <module>rq      s/  >   &  ; 4  - *+		/-+H-QqD-+HsS  BC
   
.
.b   VV 
#   
#  s ,Is   C5
