+
    –°³jˆ'  ã                   ó:  € R t ^ RIt^ RIHtHt ^ RIHtHt ^RIH	t	H
t
HtHt ^RI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]! ]4      t]P(                  ! R	] Uu/ uF  qVbK  	  up]R7      t]! R
R7      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-OR7      R.R R ll4       t]P5                  R. R/OR7      R0R R ll4       t]P5                  RRR.R7      R1R R ll4       t]P5                  R. R2OR7      R3R  R! ll4       t ]P5                  R"R#R$.R7      R4R% R& ll4       t!]P5                  R'4      R1R( R) ll4       t"R# u up i u upi )5zGContains commands to interact with collections on the Hugging Face Hub.N)Ú	AnnotatedÚget_args)ÚCollectionItemType_TÚCollectionSort_T)ÚLimitOptÚTokenOptÚ
get_hf_apiÚtyper_factory)ÚArgumentÚOption)Ú_dataclass_to_dictÚoutÚCollectionItemType)ÚtypeÚCollectionSortz%Interact with collections on the Hub.©Úhelpz	list | ls)Úexamplesc                ó  € V ^8„  d   QhR\         \        R,          \        RR7      3,          R\         \        R,          \        RR7      3,          R\         \        R,          \        RR7      3,          R	\        R
\
        RR/# )é   ÚownerNz)Filter by owner username or organization.r   ÚitemzkFilter collections containing a specific item (e.g., "models/gpt2", "datasets/squad", "papers/2311.12983").Úsortz4Sort results by last modified, trending, or upvotes.ÚlimitÚtokenÚreturn)r   Ústrr   r   r   r   )Úformats   "Ú`/home/luca/screen-checking/.venv/lib/python3.14/site-packages/huggingface_hub/cli/collections.pyÚ__annotate__r   -   s™   € ÷ ñ ÜÜˆd�
ÜÐ?Ô@ð	Bõðô
 Üˆd�
ÜØ~ô	
ð	õðô Ü˜ÕÜÐJÔKð	Mõðô ðô  ð!ð" 
ñ#ó    c                óÚ   € \        VR7      pV'       d   VP                  MRpVP                  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 )zList collections on the Hub.©r   N)r   r   r   r   )r   ÚvalueÚlist_collectionsr   r   Útable)	r   r   r   r   r   ÚapiÚsort_keyÚ
collectionÚresultss	   &&&&&    r   Úcollections_lsr*   %   su   € ô6 ˜5Ô
!€Cß!ˆt�zŠz t€Hð ×.Ñ.ØØØØð	 /ô 
óñ
ˆJô 	˜:Ö&ñ
ð ð ô ‡I‚IˆgÖùòs   ºA(Úinfoz/hf collections info username/my-collection-slugc                ób   € V ^8„  d   QhR\         \        \        RR7      3,          R\        RR/# )r   Úcollection_slugú7The collection slug (e.g., 'username/collection-slug').r   r   r   N)r   r   r
   r   )r   s   "r   r   r   T   s6   € ÷ ñ Üœs¤HÐ2kÔ$lÐlÕmðäðð 
ñr    c                ól   € \        VR7      pVP                  V 4      p\        P                  ! V4       R# )z'Get info about a collection on the Hub.r"   N)r   Úget_collectionr   Údict)r-   r   r&   r(   s   &&  r   Úcollections_infor2   N   s*   € ô ˜5Ô
!€CØ×#Ñ# OÓ4€JÜ‡H‚HˆZÖr    Úcreatec                óf  € V ^8„  d   QhR\         \        \        RR7      3,          R\         \        R,          \        RR7      3,          R\         \        R,          \        RR7      3,          R	\         \        \        R
R7      3,          R\         \        \        RR7      3,          R\
        RR/# )r   ÚtitlezThe title of the collection.r   Ú	namespaceNzMThe namespace (username or organization). Defaults to the authenticated user.Údescriptionz6A description for the collection (max 150 characters).ÚprivatezCreate a private collection.Ú	exists_okz7Do not raise an error if the collection already exists.r   r   )r   r   r
   r   Úboolr   )r   s   "r   r   r   f   sÊ   € ÷ Oñ OÜ”Sœ(Ð(FÔGÐGÕHðOäÜˆd�
ÜÐcÔdð	fõðOô Üˆd�
ÜÐLÔMð	OõðOô ÜÜÐ2Ô3ð	5õðOô ÜÜÐMÔNð	PõðOô$ ð%Oð& 
ñ'Or    c                ó¤   € \        VR7      pVP                  V VVVVR7      p\        P                  ! RVP                  VP
                  R7       R# )z#Create a new collection on the Hub.r"   )r5   r6   r7   r8   r9   zCollection created©ÚslugÚurlN)r   Úcreate_collectionr   Úresultr=   r>   )r5   r6   r7   r8   r9   r   r&   r(   s   &&&&&&  r   Úcollections_createrA   ^   sM   € ô: ˜5Ô
!€CØ×&Ñ&ØØØØØð 'ó €Jô ‡J‚JÐ#¨*¯/©/¸z¿~¹~×Nr    Úupdatec                óÊ  € V ^8„  d   QhR\         \        \        RR7      3,          R\         \        R,          \        RR7      3,          R\         \        R,          \        RR7      3,          R	\         \        R,          \        R
R7      3,          R\         \
        R,          \        RR7      3,          R\         \        R,          \        RR7      3,          R\        RR/# )r   r-   r.   r   r5   Nz!The new title for the collection.r7   z<The new description for the collection (max 150 characters).Úpositionz7The new position of the collection in the owner's list.r8   z)Whether the collection should be private.Úthemez;The theme color for the collection (e.g., 'green', 'blue').r   r   )r   r   r
   r   Úintr:   r   )r   s   "r   r   r   Ž   sø   € ÷ "Oñ "OÜœs¤HÐ2kÔ$lÐlÕmð"OäÜˆd�
ÜÐ7Ô8ð	:õð"Oô Üˆd�
ÜÐRÔSð	Uõð"Oô Üˆd�
ÜÐMÔNð	Põð"Oô Üˆt�ÜÐ?Ô@ð	Bõð"Oô$ Üˆd�
ÜÐQÔRð	Tõð%"Oô, ð-"Oð. 
ñ/"Or    c           	     ó¦   € \        VR7      pVP                  V VVVVVR7      p\        P                  ! RVP                  VP
                  R7       R# )z*Update a collection's metadata on the Hub.r"   )r-   r5   r7   rD   r8   rE   zCollection updatedr<   N)r   Úupdate_collection_metadatar   r@   r=   r>   )	r-   r5   r7   rD   r8   rE   r   r&   r(   s	   &&&&&&&  r   Úcollections_updaterI   †   sQ   € ôB ˜5Ô
!€CØ×/Ñ/Ø'ØØØØØð 0ó €Jô ‡J‚JÐ#¨*¯/©/¸z¿~¹~×Nr    Údeletez,hf collections delete username/my-collectionz9hf collections delete username/my-collection --missing-okc          	      óœ   € V ^8„  d   QhR\         \        \        RR7      3,          R\         \        \	        RR7      3,          R\
        RR/# )	r   r-   r.   r   Ú
missing_okz6Do not raise an error if the collection doesn't exist.r   r   N©r   r   r
   r:   r   r   )r   s   "r   r   r   º   sW   € ÷ ;ñ ;Üœs¤HÐ2kÔ$lÐlÕmð;äÜÜÐLÔMð	Oõð;ô ð;ð 
ñ;r    c                ór   € \        VR7      pVP                  WR7       \        P                  ! RV R7       R# )z!Delete a collection from the Hub.r"   )rL   zCollection deleted©r=   N)r   Údelete_collectionr   r@   )r-   rL   r   r&   s   &&& r   Úcollections_deleterQ   ³   s.   € ô  ˜5Ô
!€CØ×Ñ˜/ÐÔAÜ‡J‚JÐ#¨/×:r    zadd-itemc                óX  € V ^8„  d   QhR\         \        \        RR7      3,          R\         \        \        RR7      3,          R\         \        \        RR7      3,          R\         \        R	,          \	        R
R7      3,          R\         \
        \	        RR7      3,          R\        RR	/# )r   r-   r.   r   Úitem_idzCThe ID of the item to add (repo_id for repos, paper ID for papers).Ú	item_typezGThe type of item (model, dataset, space, paper, collection, or bucket).ÚnoteNz2A note to attach to the item (max 500 characters).r9   z?Do not raise an error if the item is already in the collection.r   r   )r   r   r
   r   r   r:   r   )r   s   "r   r   r   Ð   sÀ   € ÷ Uñ UÜœs¤HÐ2kÔ$lÐlÕmðUä”sœHÐ*oÔpÐpÕqðUô ÜÜÐ_Ô`ð	bõðUô Üˆd�
ÜÐHÔIð	KõðUô ÜÜÐUÔVð	XõðUô ðUð  
ñ!Ur    c                ó¢   € \        VR7      pVP                  V VVP                  VVR7      p\        P                  ! RWP
                  R7       R# )zAdd an item to a collection.r"   )r-   rS   rT   rU   r9   zItem added to collectionr<   N)r   Úadd_collection_itemr#   r   r@   r>   )r-   rS   rT   rU   r9   r   r&   r(   s   &&&&&&  r   Úcollections_add_itemrX   È   sK   € ô4 ˜5Ô
!€CØ×(Ñ(Ø'ØØ—/‘/ØØð )ó €Jô ‡J‚JÐ)°Ç^Á^×Tr    zupdate-itemzVhf collections update-item username/my-collection ITEM_OBJECT_ID --note "Updated note"zMhf collections update-item username/my-collection ITEM_OBJECT_ID --position 0c                ó,  € V ^8„  d   QhR\         \        \        RR7      3,          R\         \        \        RR7      3,          R\         \        R,          \        RR7      3,          R	\         \        R,          \        R
R7      3,          R\
        RR/# )r   r-   r.   r   Úitem_object_idzTThe ID of the item in the collection (from 'item_object_id' field, not the repo_id).rU   Nz-A new note for the item (max 500 characters).rD   z/The new position of the item in the collection.r   r   )r   r   r
   r   rF   r   )r   s   "r   r   r   ô   s©   € ÷ Cñ CÜœs¤HÐ2kÔ$lÐlÕmðCäÜÜÐlÔmð	oõðCô Üˆd�
ÜÐCÔDð	FõðCô Üˆd�
ÜÐEÔFð	HõðCô ðCð 
ñCr    c                óx   € \        VR7      pVP                  V VVVR7       \        P                  ! RV R7       R# )zUpdate an item in a collection.r"   )r-   rZ   rU   rD   zItem updated in collectionrO   N)r   Úupdate_collection_itemr   r@   )r-   rZ   rU   rD   r   r&   s   &&&&& r   Úcollections_update_itemr]   í   s>   € ô0 ˜5Ô
!€CØ×ÑØ'Ø%ØØð	 ô ô ‡J‚JÐ+°/×Br    zdelete-itemc                óÖ   € V ^8„  d   QhR\         \        \        RR7      3,          R\         \        \        RR7      3,          R\         \        \	        RR7      3,          R\
        R	R
/# )r   r-   r.   r   rZ   znThe ID of the item in the collection (retrieved from `item_object_id` field returned by 'hf collections info'.rL   z0Do not raise an error if the item doesn't exist.r   r   NrM   )r   s   "r   r   r     sƒ   € ÷ Eñ EÜœs¤HÐ2kÔ$lÐlÕmðEäÜÜð Bô	
ð	õðEô ÜÜÐFÔGð	IõðEô ðEð 
ñEr    c                óv   € \        VR7      pVP                  V VVR7       \        P                  ! RV R7       R# )z!Delete an item from a collection.r"   )r-   rZ   rL   zItem deleted from collectionrO   N)r   Údelete_collection_itemr   r@   )r-   rZ   rL   r   r&   s   &&&& r   Úcollections_delete_itemra     s;   € ô  ˜5Ô
!€CØ×ÑØ'Ø%Øð ô ô
 ‡J‚JÐ-°O×Dr    )zhf collections lsz hf collections ls --owner nvidiazLhf collections ls --item models/teknium/OpenHermes-2.5-Mistral-7B --limit 10)NNNé
   N)N)z!hf collections create "My Models"z^hf collections create "My Models" --description "A collection of my favorite models" --privatez9hf collections create "Org Collection" --namespace my-org)NNFFN)z@hf collections update username/my-collection --title "New Title"zPhf collections update username/my-collection --description "Updated description"zDhf collections update username/my-collection --private --theme green)NNNNNN)FN)zGhf collections add-item username/my-collection moonshotai/kimi-k2 modelz`hf collections add-item username/my-collection Qwen/DeepPlanning dataset --note "Useful dataset"zGhf collections add-item username/my-collection Tongyi-MAI/Z-Image space)NFN)NNN)#Ú__doc__ÚenumÚtypingr   r   Úhuggingface_hub.hf_apir   r   Ú
_cli_utilsr   r   r   r	   Ú
_frameworkr
   r   Ú_outputr   r   Ú_COLLECTION_ITEM_TYPESÚEnumr   r   Ú_COLLECTION_SORT_OPTIONSr   Úcollections_cliÚcommandr*   r2   rA   rI   rQ   rX   r]   ra   )ÚtÚss   00r   Ú<module>rq      s  ðñ Nã ß &ç Iç EÓ Eß (ß ,ñ "Ð"6Ó7Ð Ø—Y’YÐ3ÑDZÓ5[ÑDZ¸q¸²dÑDZÑ5[ÐbeÔfÐ á#Ð$4Ó5Ð Ø—’Ð+Ñ<TÓ-UÑ<T°q°ªdÑ<TÑ-UÐ\_Ô`€ñ  Ð%LÔM€ð ×ÑØòð ó öóððB ×ÑØ
à9ðð ó öóðð ×ÑØòð ó öOóðOð@ ×ÑØòð ó ö"Oóð"OðJ ×ÑØà6ØCðð ó ö;óð;ð ×ÑØòð ó öUóðUð: ×ÑØà`ØWðð ó öCóðCð6 ×Ñ˜Ó'öEó (òEùòi 6\ùò .Vs   ÁF
Á9F
