
    h              
          S SK r S SKJrJr  S SKJr  S SKrS SKrS SKJ	r	  SSK
Jr  SSKJr  SSKJrJrJrJrJrJr  S	S
KJrJrJrJrJr  \R6                  " SSSS.S9\" SSS9\" SSSSSS9\" SSSSS94S\R8                  S\S\S\4S jj5       r  S+S\S\S\SS4S  jjr S,S!\S"\S\S\4S# jjr!S\"4S$ jr#S\S%\"S\4S& jr$S\S\4S' jr% S-S(\S)\\\      SS4S* jjr&g).    N)OptionalSequence)urljoin)msg   )about)OLD_MODEL_SHORTCUTS)get_minor_versionis_in_interactiveis_in_jupyter
is_packageis_prerelease_versionrun_command   )SDIST_SUFFIXWHEEL_SUFFIXArgOptappdownloadT)allow_extra_argsignore_unknown_options)context_settings.z$Name of pipeline package to download)helpFz--directz-dz-Dz'Force direct download of name + versionz--sdistz-SzBDownload sdist (.tar.gz) archive instead of pre-built binary wheelctxmodeldirectsdistc                 2    [        XU/U R                  Q76   g)a  
Download compatible trained pipeline from the default download path using
pip. If --direct flag is set, the command expects the full package name with
version. For direct downloads, the compatibility check will be skipped. All
additional arguments provided to this command will be passed to `pip install`
on package installation.

DOCS: https://spacy.io/api/cli#download
AVAILABLE PACKAGES: https://spacy.io/models
N)r   args)r   r   r   r   s       L/home/james-whalen/.local/lib/python3.13/site-packages/spacy/cli/download.pydownload_clir"      s    , UE-CHH-    returnc                    [        S5      (       d1  [        S5      (       d!  SU;  a  [        R                  " S5        US-   nU(       aK  SU ;   a  [        R                  " SSU  S	3S
S9  U R	                  S5      nSR                  US S 5      nUS   nONU nU [        ;   a-  [        R                  " SU  S[        U     S35        [        U    n[        5       n[        XW5      n[        XVU5      n[        X5        [        R                  " SSU S35        [        5       (       a  Sn	[        R                  " SU	5        g [        5       (       a  Sn	[        R                  " SU	5        g g )Nspacyzspacy-nightly	--no-depsai  Skipping pipeline package dependencies and setting `--no-deps`. You don't seem to have the spaCy package itself installed (maybe because you've built from source?), so installing the package dependencies would cause spaCy to be downloaded, which probably isn't what you want. If the pipeline package has other dependencies, you'll have to install them manually.)r'   /zModel download rejectedzCannot download model 'z>'. Models are expected to be file names, not URLs or fragmentsT)titletextexits- z"As of spaCy v3.0, shortcuts like 'z=' are deprecated. Please use the full pipeline package name 'z
' instead.z$Download and installation successfulz-You can now load the package via spacy.load('z')zIf you are in a Jupyter or Colab notebook, you may need to restart Python in order to load all the package's dependencies. You can do this by selecting the 'Restart kernel' or 'Restart runtime' option.zRestart to reload dependencieszIf you are in an interactive Python session, you may need to exit and restart Python to load all the package's dependencies. You can exit with Ctrl-D (or Ctrl-Z and Enter on Windows).)r   r   warnfailsplitjoinr	   get_compatibilityget_versionget_model_filenamedownload_modelgoodr   r   )
r   r   r   pip_args
components
model_nameversioncompatibilityfilenamereload_deps_msgs
             r!   r   r   /   sr      J$?$?x'B	
 n,%<HH/.ug5st
 [[%
WWZ_-
R.
''HH4UG <77J57Q6RR\^ -U3J)+j8!*u=H8&HH.
7
|2F  	 	,	
 
		I 	
 	,	
 
r#   r:   r;   c                 P    SnU(       a  [         O[        nUR                  XUS9nU$ )Nz{m}-{v}/{m}-{v}{s})mvs)r   r   format)r:   r;   r   dl_tplsuffixr=   s         r!   r5   r5   v   s'    !F"\F}}z}?HOr#   c                     [        [        R                  5      (       a  [        R                  n O[        [        R                  5      n [        R
                  " [        R                  5      nUR                  S:w  a6  [        R                  " SUR                   S3S[        R                   S3SS9  UR                  5       nUS   nX;  a  [        R                  " S	U  S
3SS9  X0   $ )N   zServer error ()zXCouldn't fetch compatibility table. Please find a package for your spaCy installation (vzc), and download it manually. For more details, see the documentation: https://spacy.io/usage/modelsr   r+   r&   z"No compatible packages found for vz	 of spaCy)r   r   __version__r
   requestsget__compatibility__status_coder   r0   json)r;   r
comp_tablecomps       r!   r3   r3   }   s    U..//!&!2!2#E$5$56U,,-A}}Q]]O1-#//0 1,- 	
 JgD5gYiHPQR=r#   rR   c                 n    X;  a*  [         R                  " SU  S[        R                   S3SS9  X   S   $ )Nz!No compatible package found for 'z
' (spaCy vrH   r   rI   r   )r   r0   r   rJ   r   rR   s     r!   r4   r4      s?    /wjARAR@SSTU	
 ;q>r#   c                 ,    [        5       n[        X5      $ N)r3   r4   rT   s     r!   get_latest_versionrW      s    Du##r#   r=   user_pip_argsc                 ^   [         R                  nUR                  S5      (       d  [         R                  S-   n[        X 5      nUR	                  [         R                  5      (       d  [        SU  S35      eUb  [        U5      O/ n[        R                  SSS/U-   U/-   n[        U5        g )Nr(   zDownload from z" rejected. Was it a relative path?z-mpipinstall)
r   __download_url__endswithr   
startswith
ValueErrorlistsys
executabler   )r=   rX   base_urldownload_urlr8   cmds         r!   r6   r6      s     %%HS!!))C/8.L""5#9#9::>(3UVWW&3&?tM"RH>>4	
2X
=
NCr#   )FF)FrV   )'ra   typingr   r   urllib.parser   rK   typerwasabir   r-   r   errorsr	   utilr
   r   r   r   r   r   _utilr   r   r   r   r   commandContextstrboolr"   r   r5   dictr3   r4   rW   r6    r#   r!   <module>rs      sk   
 %       (  = < *.$O SEFuj$;deeY3wx.	. . 	.
 .	.. D
D
D
 D

 
D
N3  T c 4 ,s $ 3 $c $c $ =A"*8C="9	r#   