+
    &j*                     2   R t ^ RIt^ RIHtHt ^ RIt^ RIHt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]! ]4      t]P$                  ! R] Uu/ uF  qVbK  	  up]R7      t]! R	R
7      t]P1                  R. R)OR7      R*R R ll4       t]P1                  RR.R7      R+R R ll4       t]P1                  R. R,OR7      R-R R ll4       t]P1                  R. R.OR7      R/R R ll4       t]P1                  RRR.R7      R0R R ll4       t]P1                  R. R1OR7      R2R R  ll4       t]P1                  R!R"R#.R7      R3R$ R% ll4       t]P1                  R&4      R0R' R( ll4       t R# u up i u upi )4a_  Contains commands to interact with collections on the Hugging Face Hub.

Usage:
    # list collections on the Hub
    hf collections ls

    # list collections for a specific user
    hf collections ls --owner username

    # get info about a collection
    hf collections info username/collection-slug

    # create a new collection
    hf collections create "My Collection" --description "A collection of models"

    # add an item to a collection
    hf collections add-item username/collection-slug username/model-name model

    # delete a collection
    hf collections delete username/collection-slug
N)	Annotatedget_args)CollectionItemType_TCollectionSort_T)LimitOptTokenOpt
get_hf_apityper_factory)_dataclass_to_dictoutCollectionItemType)typeCollectionSortz%Interact with collections on the Hub.helpz	list | ls)examplesc                N   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
\        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   strtyperOptionr   r   r   )formats   "w/Users/jameslopez/projects/CWCArchive/cwc-podcast/.venv/lib/python3.14/site-packages/huggingface_hub/cli/collections.py__annotate__r   B   s      d
EF	H
 d
~	
	 PQ	S   !" 
#    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!tzztH ..	 / 

J 	:&
   IIgs   A(infoz/hf collections info username/my-collection-slugc                x    V ^8  d   QhR\         \        \        P                  ! RR7      3,          R\        RR/# )r   collection_slug7The collection slug (e.g., 'username/collection-slug').r   r   r   N)r   r   r   Argumentr   )r   s   "r   r   r   i   s:      sENN8q$rrs 
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_infor3   c   s*     5
!C##O4JHHZr    createc                   V ^8  d   QhR\         \        \        P                  ! RR7      3,          R\         \        R,          \        P                  ! RR7      3,          R\         \        R,          \        P                  ! RR7      3,          R	\         \
        \        P                  ! R
R7      3,          R\         \
        \        P                  ! 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.descriptionz!A description for the collection.privatezCreate a private collection.	exists_okz7Do not raise an error if the collection already exists.r   r   )r   r   r   r/   r   boolr   )r   s   "r   r   r   {   s     O OS%...LMMNOd
ij	lO d
=>	@O 89	;O ST	V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"   )r6   r7   r8   r9   r:   zCollection createdslugurlN)r   create_collectionr   resultr>   r?   )r6   r7   r8   r9   r:   r   r&   r(   s   &&&&&&  r   collections_createrB   s   sM    : 5
!C&& ' J JJ#*//z~~Nr    updatec                N   V ^8  d   Qh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,          \        P                  ! RR7      3,          R\        RR/# )r   r-   r.   r   r6   Nz!The new title for the collection.r8   z'The new description for the collection.positionz7The new position of the collection in the owner's list.r9   z)Whether the collection should be private.themez;The theme color for the collection (e.g., 'green', 'blue').r   r   )r   r   r   r/   r   intr;   r   )r   s   "r   r   r      s    "O "OsENN8q$rrs"Od
=>	@"O d
CD	F"O d
ST	V"O tEF	H"O$ d
WX	Z%"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-   r6   r8   rE   r9   rF   zCollection updatedr=   N)r   update_collection_metadatar   rA   r>   r?   )	r-   r6   r8   rE   r9   rF   r   r&   r(   s	   &&&&&&&  r   collections_updaterJ      sQ    B 5
!C//' 0 J JJ#*//z~~Nr    deletez,hf collections delete username/my-collectionz9hf collections delete username/my-collection --missing-okc          	          V ^8  d   QhR\         \        \        P                  ! RR7      3,          R\         \        \        P
                  ! 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   )r   s   "r   r   r      s_     ; ;sENN8q$rrs;RS	U; ; 
;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"   )rM   zCollection deletedr>   N)r   delete_collectionr   rA   )r-   rM   r   r&   s   &&& r   collections_deleterR      s.      5
!C/AJJ#/:r    zadd-itemc                   V ^8  d   QhR\         \        \        P                  ! RR7      3,          R\         \        \        P                  ! RR7      3,          R\         \        \        P                  ! RR7      3,          R\         \        R	,          \        P
                  ! R
R7      3,          R\         \        \        P
                  ! 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).r:   z?Do not raise an error if the item is already in the collection.r   r   )r   r   r   r/   r   r   r;   r   )r   s   "r   r   r      s     U UsENN8q$rrsUU^^!fggU
 ef	hU d
NO	QU [\	^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-   rT   rU   rV   r:   zItem added to collectionr=   N)r   add_collection_itemr#   r   rA   r?   )r-   rT   rU   rV   r:   r   r&   r(   s   &&&&&&  r   collections_add_itemrY      sK    8 5
!C(('// ) J JJ)^^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\         \        \        P                  ! RR7      3,          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.   r   item_object_idzTThe ID of the item in the collection (from 'item_object_id' field, not the repo_id).rV   Nz-A new note for the item (max 500 characters).rE   z/The new position of the item in the collection.r   r   )r   r   r   r/   r   rG   r   )r   s   "r   r   r     s     C CsENN8q$rrsCrs	uC d
IJ	LC d
KL	N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-   r[   rV   rE   zItem updated in collectionrP   N)r   update_collection_itemr   rA   )r-   r[   rV   rE   r   r&   s   &&&&& r   collections_update_itemr^     s>    0 5
!C'%	   JJ+/Br    zdelete-itemc                   V ^8  d   QhR\         \        \        P                  ! RR7      3,          R\         \        \        P                  ! RR7      3,          R\         \        \        P
                  ! RR7      3,          R\        R	R
/# )r   r-   r.   r   r[   znThe ID of the item in the collection (retrieved from `item_object_id` field returned by 'hf collections info'.rM   z0Do not raise an error if the item doesn't exist.r   r   NrN   )r   s   "r   r   r   '  s     E EsENN8q$rrsE B	
	E LM	O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-   r[   rM   zItem deleted from collectionrP   N)r   delete_collection_itemr   rA   )r-   r[   rM   r   r&   s   &&&& r   collections_delete_itemrb   &  s;      5
!C'%  
 JJ-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   r   huggingface_hub.hf_apir   r   
_cli_utilsr   r   r   r	   _outputr
   r   _COLLECTION_ITEM_TYPESEnumr   r   _COLLECTION_SORT_OPTIONSr   collections_clicommandr*   r3   rB   rJ   rR   rY   r^   rb   )tss   00r   <module>rq      s  ,  &  I E E , ""67 YY3DZ5[DZqdDZ5[bef #$45 +<T-U<Tqd<T-U\_`  %LM   B 
9     OO@   "O"OJ 6C  ;;   UU> `W  CC6 'E (Em 6\ .Vs   F
5F
