
    
3j(              (       >   S SK r S SKrS SKJr  S SKJr  S SKJrJrJrJ	r	  S SK
JrJrJr  S SKJrJr   S SKr\ R(                  " 5       S 5       r\R-                  5       \ R.                  " S\ R0                  " S	S	S
9S9\ R.                  " S\ R0                  " S	S	S
9S9\ R2                  " SS\\S	S9\ R2                  " SS\\S	S9\ R2                  " SSS \S	S9\ R2                  " SSS \S	S9\ R2                  " SSS\ R8                  " S S5      S	S9\ R2                  " SS	S	S9\ R2                  " SS\SS	S9\ R2                  " SS\SS	S9\ R2                  " SS\SS9\ R2                  " SS	S	S9\ R2                  " SS\SSS9\ R2                  " SS	S	S9\ R2                  " S S	S	S9\ R2                  " S!S	S	S9\ R2                  " S"S	S	S9\ R2                  " S#S	S	S9\ R2                  " S$S	S	S9\ R2                  " S%S	S	S9\ R2                  " S&SS \S	S9\ R2                  " S'SS(\S	S9\ R2                  " S)SS\S	S9\ R2                  " S*SS+\SS9\ R2                  " S,S\ R<                  " S-S./S	S/9S	S-S09\ R2                  " S1S\ R<                  " S2S3/S	S/9S	S2S09\ R2                  " S4S	S	S9\ R2                  " S5SS\S	S9\ R2                  " S6S\ R<                  " / S7QS	S/9S	SS09\ R2                  " S8SS\ R8                  " S S5      S	S9\ R2                  " S9S\ R<                  " / S:QS	S/9S	S;S09\ R2                  " S<S	SS9S= 5       5       5       5       5       5       5       5       5       5       5       5       5       5       5       5       5       5       5       5       5       5       5       5       5       5       5       5       5       5       5       5       5       r\R-                  5       \ R.                  " S>\ R0                  " S	S	S
9S9\ R.                  " S?\ R0                  " S	S	S
9S9\ R2                  " S@SAS	S	S9\ R2                  " SBS	S	S9\ R2                  " S<S	SS9SC 5       5       5       5       5       5       r \R-                  5       \ R.                  " SDS	\SE9\ R.                  " S>\ R0                  " S	S	S
9S9\ R2                  " SFSGS	S	S9\ R2                  " SHS	S	S9\ R2                  " SS\SS	S9\ R2                  " SS\SS	S9\ R2                  " S8SS\ R8                  " S S5      S	S9\ R2                  " S<S	SS9SI 5       5       5       5       5       5       5       5       5       r!\R-                  5       \ R.                  " SJS	\SE9\ R.                  " S>\ R0                  " S	S	S
9S9\ R2                  " S<S	SS9SK 5       5       5       5       rg! \ a    Sr GNcf = f)L    N)Decimal)pprint)DeepDiff!CUTOFF_DISTANCE_FOR_PAIRS_DEFAULT%CUTOFF_INTERSECTION_FOR_PAIRS_DEFAULTlogger)Delta
DeepSearchextract)load_path_contentsave_content_to_pathc                      g)zA simple command line tool.N r       K/home/wildlama/miniconda3/lib/python3.13/site-packages/deepdiff/commands.pyclir      s     	r   t1T)existsresolve_path)typet2z--cutoff-distance-for-pairsF)requireddefaultr   show_defaultz--cutoff-intersection-for-pairsz--cache-sizez--cache-tuning-sample-sizez--cache-purge-level      z--create-patch)is_flagr   z--exclude-paths)r   r   r   multiplez--exclude-regex-pathsz--math-epsilon)r   r   r   z--get-deep-distancez
--group-byz--ignore-orderz--ignore-string-type-changesz--ignore-numeric-type-changesz--ignore-type-subclassesz--ignore-string-casez--ignore-nan-inequalityz--include-private-variablesz--log-frequency-in-secz--max-passesi z--max_diffsz--threshold-to-diff-deepergQ?z--number-format-notationfe)case_sensitive)r   r   r   r   z--progress-loggerinfoerrorz--report-repetitionz--significant-digitsz--truncate-datetime)secondminutehourdayz--verbose-levelz--view)treecoloredcolored_compactr(   z--debugc            
      P   UR                  S5      nUR                  S5      (       + US'   US   S:X  a  [        R                  O[        R                  US'   UR                  S5      nUR                  S5      nUR                  S5      nUR	                  S	5      S
   nUR	                  S	5      S
   nSU;   a  US   c  UR                  S5        SXF4SXW44 H  u  pn
 [        XS9X'   M     US;   a"  US    Vs/ s H  n[        U5      PM     snUS'   US;   a"  US    Vs/ s H  n[        U5      PM     snUS'   U(       a  SUS'    [        S0 UD6nU(       aD   [        W5      n[        R                  R                  R                  WR!                  5       5        g US   S;   a  [#        W5        g[#        WR%                  SS95        g! [         a9  nU(       a  e [        R                  " [        SU SU 35      5         SnAGM6  SnAff = fs  snf s  snf ! [         a)  n[        R                  " [        U5      5         SnANSnAff = f! [         a,  nU(       a  e [        R                  " SU 35         SnAGNSnAff = f! [         a    ['        WSS9   gf = f)z
Deep Diff Commandline

Deep Difference of content in files.
It can read csv, tsv, json, yaml, and toml files.

T1 and T2 are the path to the files to be compared with each other.
debuginclude_private_variablesignore_private_variablesprogress_loggerr"   create_patchr   r   .viewN	file_typeError when loading : >   csvtsvr   log_frequency_in_secz*Error when loading the patch (aka delta): >   r)   r*   r   indentr   )popr   r"   r#   splitr   	Exceptionsysexitstrdictr   r	   stdoutbufferwritedumpsprintto_jsonr   )argskwargsr,   r0   t1_patht2_patht1_extensiont2_extensionnamet_patht_extensionr    idiffdeltas                  r   rT   rT      ss   X JJwE-3ZZ8S-T)TF%&/56G/HF/RX^XdXdF::n-LjjGjjG==%b)L==%b)LF6N2

6'+W&CdGEb%c!k	A,VKFL &d ~%)/6AQ6t~%)/6AQ6t)*%&!&! 	K$KE 	

.	#f~!??ddll!l,-K  	A24&1#>?@@		A 76  Q  	KEaSIJJ		K  	#4"	#sl   G:H"H
H I !J 6J 
H-HH
I)II
J!JJJ%$J%path
delta_pathz--backupz-bz--raise-errorsc           	          [        XS9nU R                  S5      S   n [        XS9nWW-   n	 [        XXrS	9  g! [         a7  nU(       a  e [        R                  " [	        SU SU 35      5         SnANkSnAff = f! [         a/  n[        R                  " [	        SU  SU 35      5         SnANSnAff = f! [         a7  nU(       a  e [        R                  " [	        S
U  SU 35      5         SnAgSnAff = f)aK  
Deep Patch Commandline

Patches a file based on the information in a delta file.
The delta file can be created by the deep diff command and
passing the --create-patch argument.

Deep Patch is similar to Linux's patch command.
The difference is that it is made for patching data.
It can read csv, tsv, json, yaml, and toml files.

)rW   raise_errorsz)Error when loading the patch (aka delta) r7   Nr1   r2   r4   r6   )r5   keep_backupzError when saving )r	   r?   r@   rA   rB   r>   r   r   )
rV   rW   backuprY   r,   rU   r    	extensioncontentresults
             r   patchr_   ~   s    *YG 

3#I9#D> W_F<VYS!  YHHSDZLPRSTRUVWXX	Y  9*4&1#67889  <HHS-dV2aS9:;;	<sC   	: 	A> 
B: 
A;-A66A;>
B7%B22B7:
C;-C66C;item)r   r   z--ignore-casez-iz--exact-matchc           	         UR                  S5      (       + US'   UR                  S5      US'    [        U5      n [        WU 40 UD6n[        WS	S
9  g! [         a7  nU(       a  e [        R                  " [        SU SU 35      5         SnANUSnAff = f! [         a7  nU(       a  e [        R                  " [        SU SU 35      5         SnANSnAff = f)z
Deep Grep Commandline

Grep through the contents of a file and find the path to the item.
It can read csv, tsv, json, yaml, and toml files.

ignore_caser!   exact_matchmatch_stringr6   r7   N"Error when running deep search on r   r;   )r=   r   r?   r@   rA   rB   r
   r   )r`   rV   r,   rK   r]   r    r^   s          r   greprf      s    " $*::m#<<F#ZZ6F>=#D)LGT4V4 6!  =HHS.tfBqc:;<<	=  LHHS=dV2aSIJKK	Ls.   A B 
B-BB
C!-CCpath_insidec           	      Z    [        U5      n [        WU 5      n[        WSS9  g! [         a7  nU(       a  e [        R                  " [	        SU SU 35      5         SnANTSnAff = f! [         a7  nU(       a  e [        R                  " [	        SU SU 35      5         SnANSnAff = f)z
Deep Extract Commandline

Extract an item from a file based on the path that is passed.
It can read csv, tsv, json, yaml, and toml files.

r6   r7   Nre   r   r;   )r   r?   r@   rA   rB   deep_extractr   )rg   rV   r,   r]   r    r^   s         r   r   r      s    =#D)Lg{3 6!  =HHS.tfBqc:;<<	=  LHHS=dV2aSIJKK	Ls+   % A) 
A&-A!!A&)
B*3-B%%B*)"clickr@   decimalr   r   deepdiff.diffr   r   r   r   deepdiffr	   r
   r   ri   deepdiff.serializationr   r   orjsonImportErrorgroupr   commandargumentPathoptionfloatintIntRangerB   ChoicerT   r_   rf   r   r   r   <module>rz      sH    
    @ ? J
 	 	
 5::TEF5::TEF+eEfmr  BF  G/%Inuz  JN  OnuacPTU*UAC^bc#eQU^^TUWXEYhlm4@%cX\]%Ce^bcW5Q#TElU5SXY4@,dN-t$O($TJ$dF'DI+TM&Z^_nuhSW[\meTRVW*UDuchi(5u||SRUJgk?l{  JM  N!EfgEVgk8l{  JP  Q#TE$ud[_`#e%,,Gj{  ;A  PT  ^b  c%PQSTAUdhihU\\:`qu-v  FJ  TZ  [iE:@# ; [ j c a F Q N j X ] ` N J G K P O A Z F R d ^ A n d V O G G G B@#F UZZt$GH5::T#MNj$4@4@iE:&< ; A A O I &<R C0UZZt$GHotTEot$?%cX\]%Ce^bc%PQSTAUdhiiE: ; j d ^ @ F I 1 : 37UZZt$GHiE: ; I 8 O  Fs   V VV