
    k?1if                         d dl Z d dlZd dlZd dlmZ d dlmZ ddlmZ de	dee
   fdZd	ee	   de j                  fd
Zej                  dd fd	ee	   ddfdZedk(  r e        yy)    N)chain)List   )PDFp_strreturnc                     d| v r:t        t        | j                  d            \  }}t        t	        ||dz               S t        |       gS )N-r   )mapintsplitlistrange)r   startends      X/home/www/therecruiter.miabetepe.com/venv/lib/python3.12/site-packages/pdfplumber/cli.pyparse_page_specr      sD    
e|ekk#./
sE%q)**E
|    args_rawc                    t        j                  d      }|j                  ddt        j                  d      t        j
                  j                         |j                  dddgd	       |j                  d
d       |j                  ddd       |j                  ddd       |j                  dt        j                         |j                  dt               |j                  ddt               |j                  dt        d       |j                  |       }|j                   t        t        |j                         |_        |S )N
pdfplumberinfile?rb)nargstypedefaultz--formatcsvjson)choicesr   z--types+)r   z--include-attrsz1Include *only* these object attributes in output.)r   helpz--exclude-attrsz,Exclude these object attributes from output.z
--laparams)r   z--precisionz--pages)r   r   z--indentz&Indent level for JSON pretty-printing.)r   r"   )argparseArgumentParseradd_argumentFileTypesysstdinbufferr   loadsr   r   
parse_argspagesr   r   )r   parserargss      r   r+   r+      s=   $$\2F
("3"3D"9399CSCS   
UFOUK
	-
@   ;   4::6
C0
	?C
#K   X&Dzz%,-
Kr   c           	         t        |       }t        j                  |j                  |j                  |j
                        5 }|j                  dk(  rM|j                  t        j                  |j                  |j                  |j                  |j                         nW|j                  t        j                  |j                  |j                  |j                  |j                  |j                         d d d        y # 1 sw Y   y xY w)N)r,   laparamsr   )	precisioninclude_attrsexclude_attrs)r1   r2   r3   indent)r+   r   openr   r,   r0   formatto_csvr'   stdouttypesr1   r2   r3   to_jsonr4   )r   r.   pdfs      r   mainr<   :   s    hD	$++TZZ$--	H C;;%JJ



.."00"00   KK



.."00"00{{    s   B4C??D__main__)r#   r   r'   	itertoolsr   typingr   r;   r   strr   r   	Namespacer+   argvr<   __name__ r   r   <module>rE      s      
   3 49 $c $x'9'9 $N  #xx| 49  . zF r   