+
    &j*                     V   R t ^ RIt^ RIHtHt ^ RIt^ RIHt ^ RIH	t	H
t
Ht ^ RIHtHt ^ RIHt ^RIHtHtHtHtHtHtHtHtHtHt ^RIHt ^R	IHtH t  ]!! ]! ]4      4      t"]! ]4      t#]PH                  ! R
]# U u/ uF  q V bK  	  up ]%R7      t&]]%R,          ]PN                  ! RRPQ                  ]"4       R2]! ]"4      R7      3,          t)]! RR7      t*]*PW                  R. R*OR7      RRRRR]RRRRRR3R R ll4       t,]*PW                  R. R+OR7      R,R R ll4       t-]*PW                  RRR.R7      R-R R ll4       t.]*PW                  R. R.OR7      R-R  R! ll4       t/]*PW                  R"R#R$.R7      R/R% R& ll4       t0]*PW                  R'. R0OR7      R1R( R) ll4       t1R# u up i )2a  Contains commands to interact with datasets on the Hugging Face Hub.

Usage:
    # list datasets on the Hub
    hf datasets ls

    # list datasets with a search query
    hf datasets ls --search "code"

    # get info about a dataset
    hf datasets info HuggingFaceFW/fineweb
N)	Annotatedget_args)execute_raw_sql_query)CLIErrorRepositoryNotFoundErrorRevisionNotFoundError)DatasetSort_TExpandDatasetProperty_T)DatasetCard)
REPO_LIST_DEFAULT_LIMIT	AuthorOpt	FilterOptLimitOptRevisionOpt	SearchOptTokenOpt
get_hf_apimake_expand_properties_parsertyper_factory)list_repo_files_cmd)_dataclass_to_dictoutDatasetSortEnum)typezComma-separated properties to return. When used, only the listed properties (and id) are returned. Example: '--expand=downloads,likes,tags'. Valid: z, .)helpcallbackz"Interact with datasets on the Hub.r   z	list | ls)examplesFc                &   V ^8  d   QhR\         \        R,          \        P                  ! RR7      3,          R\        R\
        R\        R\         \        R,          \        P                  ! R	R7      3,          R
\        R\        R\         \        \        P                  ! RRRR7      3,          R\         \        \        P                  ! RRR7      3,          R\         \        \        P                  ! RRRR7      3,          R\        R\        RR/# )   repo_idNzVDataset ID (e.g. `username/repo-name`) to list files from. If omitted, lists datasets.r   searchauthorfiltersortzSort results.limitexpandhuman_readablez--human-readablez-hz=Show sizes in human readable format (only for listing files).as_treez--treez3List files in tree format (only for listing files).	recursivez--recursivez-Rz0List files recursively (only for listing files).revisiontokenreturn)r   strtyperArgumentr   r   r   r   Optionr   	ExpandOptboolr   r   )formats   "t/Users/jameslopez/projects/CWCArchive/cwc-podcast/.venv/lib/python3.14/site-packages/huggingface_hub/cli/datasets.py__annotate__r6   R   s4    O Od
tu	wO
 O O O $/*	,O O O '4st	vO$ X$YZ	\%O, ]D/ab	d-O4 5O6 7O8 
9O    c           
     8   V e   Ve   \         P                  ! R4      hVe   \         P                  ! R4      hVe   \         P                  ! R4      hVe   \         P                  ! R4      hV\        8w  d   \         P                  ! R4      hVe   \         P                  ! R4      h\        V RVVV	V
VR	7      # V'       d   \         P                  ! R
4      hV	'       d   \         P                  ! R4      hV'       d   \         P                  ! R4      hV
e   \         P                  ! R4      h\	        VR7      pV'       d   VP
                  MRpVP                  VVVVVVR7       Uu. uF  p\        V4      NK  	  pp\        P                  ! V4       R# u upi )zList datasets on the Hub, or files in a dataset repo.

When called with no argument, lists datasets on the Hub.
When called with a dataset ID, lists files in that dataset repo.
Nz'Cannot use --search when listing files.z'Cannot use --author when listing files.z'Cannot use --filter when listing files.z%Cannot use --sort when listing files.z&Cannot use --limit when listing files.z'Cannot use --expand when listing files.dataset)r!   	repo_typer(   r)   r*   r+   r,   z(Cannot use --tree when listing datasets.z-Cannot use --recursive when listing datasets.z2Cannot use --human-readable when listing datasets.z,Cannot use --revision when listing datasets.r,   )r$   r#   r"   r%   r&   r'   )
r/   BadParameterr   r   r   valuelist_datasetsr   r   table)r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   apisort_keydataset_inforesultss   &&&&&&&&&&&&    r5   datasets_lsrD   F   s   \ $$%NOO$$%NOO$$%NOO$$%LMM++$$%MNN$$%NOO")
 	
   !KLL  !PQQ  !UVV  !OPP
5
!C!tzztH  -- . 


L 	<(
  
 IIg
s   )Fleaderboardc                    V ^8  d   QhR\         \        \        P                  ! RR7      3,          R\        R\
        RR/# )r    
dataset_idz?The benchmark dataset ID (e.g. `SWE-bench/SWE-bench_Verified`).r   r&   r,   r-   N)r   r.   r/   r0   r   r   )r4   s   "r5   r6   r6      sJ     b b#u~~3tuuvbb b 
	br7   c                R   \        VR7      pVP                  V R7      pVRV  Uu. uF  p\        V4      NK  	  pp\        P                  ! V. R	ORR7       \        P
                  ! R4       V'       d.   \        P
                  ! RV^ ,          P                   R24       R# R# u upi )
zList model scores from a dataset leaderboard. This command helps find the best models for a task or compare models by benchmark scores. Use 'hf datasets ls --filter benchmark:official' to list available leaderboards.r;   )r!   Nmodel_idheadersid_keyzPUse 'hf datasets ls --filter benchmark:official' to list available leaderboards.zUse 'hf models info z' to get details about a model.)rankrI   r=   source)r   get_dataset_leaderboardr   r   r?   hintrI   )rG   r&   r,   r@   rE   entryrC   s   &&&    r5   datasets_leaderboardrR      s     5
!C--j-AK6A&56IJ6IU!%(6IGJII7
 HH_`'A(?(?'@@_`a  Ks   B$infoz&hf datasets info HuggingFaceFW/finewebz9hf datasets info my-dataset --expand downloads,likes,tagsc          
          V ^8  d   QhR\         \        \        P                  ! RR7      3,          R\        R\
        R\        RR/# )	r    rG   +The dataset ID (e.g. `username/repo-name`).r   r+   r'   r,   r-   N)r   r.   r/   r0   r   r2   r   )r4   s   "r5   r6   r6      sN      #u~~3`aab  	
 
r7   c                    \        VR7      p VP                  WVR7      p\
        P                  ! T4       R#   \         d   p\        RT  R24      ThRp?i\         d   p\        RT RT  R24      ThRp?ii ; i)	z$Get info about a dataset on the Hub.r;   )r!   r+   r'   z	Dataset 'z' not found.Nz
Revision 'z' not found on 'z'.)r   rB   r   r   r   r   dict)rG   r+   r'   r,   r@   rS   es   &&&&   r5   datasets_inforY      s     5
!CU
fU
 HHTN	 # D:,l;<!C  UH:-=j\LMSTTUs'   9 A:AA:!A:"A55A:parquetc                6   V ^8  d   QhR\         \        \        P                  ! RR7      3,          R\         \        R,          \        P                  ! RRR7      3,          R\         \        R,          \        P                  ! R	R7      3,          R
\
        RR/# )r    rG   rU   r   subsetNz--subsetz(Filter parquet entries by subset/config.splitz Filter parquet entries by split.r,   r-   )r   r.   r/   r0   r1   r   )r4   s   "r5   r6   r6      s     Q Q#u~~3`aabQcDj%,,z@j"kklQ S4Z3U!VVWQ 	Q
 
Qr7   c                \   \        VR7      pVP                  WR7      pV Uu. uF  qbe   VP                  V8X  g   K  VNK  	  ppV Uu. uF5  pRVP                  RVP                  RVP                  RVP
                  /NK7  	  pp\        P                  ! V. R	ORR7       R# u upi u upi )
z/List parquet file URLs available for a dataset.r;   )r!   configNr\   r]   urlsizerJ   )r\   r]   r`   ra   )r   list_dataset_parquet_filesr]   r_   r`   ra   r   r?   )	rG   r\   r]   r,   r@   entriesrQ   filteredrC   s	   &&&&     r5   datasets_parquetre      s      5
!C,,Z,OG#*T7%mu{{e?S7HTjrjraf5<<%++ueiiQVQ[Q[\jr   IIgA%P	 Us   B$B$
;B)sqlzhf datasets sql "SELECT COUNT(*) AS rows FROM read_parquet('https://huggingface.co/api/datasets/cfahlgren1/hub-stats/parquet/models/train/0.parquet')"zhf datasets sql "SELECT * FROM read_parquet('https://huggingface.co/api/datasets/cfahlgren1/hub-stats/parquet/models/train/0.parquet') LIMIT 5" --format jsonc                x    V ^8  d   QhR\         \        \        P                  ! RR7      3,          R\        RR/# )r    rf   zRaw SQL query to execute.r   r,   r-   N)r   r.   r/   r0   r   )r4   s   "r5   r6   r6      s:     	 		3,GHH	I		 
	r7   c                     \        WR7      p\        P
                  ! T4       R#   \         d   p\        \        T4      4      ThRp?ii ; i)zAExecute a raw SQL query with DuckDB against dataset parquet URLs.)	sql_queryr,   N)r   ImportErrorr   r.   r   r?   )rf   r,   resultrX   s   &&  r5   datasets_sqlrl      sB    &&B IIf  &s1vA%&s   & AAAcardc                   V ^8  d   QhR\         \        \        P                  ! RR7      3,          R\         \        \        P
                  ! RRR7      3,          R\         \        \        P
                  ! RR	R7      3,          R
\        RR/# )r    rG   rU   r   metadataz
--metadataz'Output only the metadata from the card.textz--textz(Output only the text body (no metadata).r,   r-   N)r   r.   r/   r0   r3   r1   r   )r4   s   "r5   r6   r6     s     g g#u~~3`aabgell<>ghhig D%,,x6`aa
bg 	g
 
gr7   c                   V'       d   V'       d   \        R4      h\        P                  ! WR7      pV'       d1   \        P                  ! VP
                  P                  4       4       R# V'       d#   \        P                  ! VP                  4       R# \        P                  ! VP                  4       \        P                  ! RV  R24       R# )z7Get the dataset card (README) for a dataset on the Hub.z---metadata and --text are mutually exclusive.r;   zUse `hf datasets card z/ --metadata` to extract only the card metadata.N)
r   r
   loadr   rW   datato_dictrp   contentrP   )rG   ro   rp   r,   rm   s   &&&& r5   datasets_cardrv     s{      DFGGJ4D""$%	)*5defr7   )zhf datasets lsz*hf datasets ls --sort downloads --limit 10zhf datasets ls --search "code"z*hf datasets ls --filter benchmark:officialz$hf datasets ls HuggingFaceFW/finewebz'hf datasets ls HuggingFaceFW/fineweb -Rz.hf datasets ls HuggingFaceFW/fineweb --tree -h)z4hf datasets leaderboard SWE-bench/SWE-bench_VerifiedzLhf datasets leaderboard SWE-bench/SWE-bench_Verified --limit 5 --format jsonzIhf datasets ls --filter benchmark:official  # list available leaderboards)   N)NNN)z(hf datasets parquet cfahlgren1/hub-statsz8hf datasets parquet cfahlgren1/hub-stats --subset modelsz6hf datasets parquet cfahlgren1/hub-stats --split trainz6hf datasets parquet cfahlgren1/hub-stats --format json)N)z&hf datasets card HuggingFaceFW/finewebz1hf datasets card HuggingFaceFW/fineweb --metadataz?hf datasets card HuggingFaceFW/fineweb --metadata --format jsonz-hf datasets card HuggingFaceFW/fineweb --text)FFN)2__doc__enumtypingr   r   r/   huggingface_hub._dataset_viewerr   huggingface_hub.errorsr   r   r   huggingface_hub.hf_apir   r	   huggingface_hub.repocardr
   
_cli_utilsr   r   r   r   r   r   r   r   r   r   _file_listingr   _outputr   r   sorted_EXPAND_PROPERTIES_SORT_OPTIONSEnumr.   r   r1   joinr2   datasets_clicommandrD   rR   rY   re   rl   rv   )ss   0r5   <module>r      sL    &  A [ [ I 0   / , H%<=> '))-m/Lm1m/LSVW $J	LL d  ei  en  en  oA  eB  dC  CD  E./AB	 "FG     	 	- 	 	 	 7OOd   bb& 
0C  "   QQ  	 	c 	j  		 
  ggk 0Ms   >F&
