
    fi                     z    d Z ddlZddlZddlmZmZ dej        fdZe	dk    r e            Z
 ee
           dS dS )uk   
Date: 2023/4/7 15:05
Desc: 乐咕乐股-大盘拥挤度
https://legulegu.com/stockdata/ashares-congestion
    N)get_token_lgget_cookie_csrfreturnc                     d} t                      }d|i}t          j        | fd|it          d          }|                                }t          j        |d                   }t          j        |d                   j        j	        |d<   |g d         }t          j
        |d	         d
          |d	<   t          j
        |d         d
          |d<   |S )u   
    乐咕乐股-大盘拥挤度
    https://legulegu.com/stockdata/ashares-congestion
    :return: 大盘拥挤度
    :rtype: pandas.DataFrame
    z5https://legulegu.com/api/stockdata/ashares-congestiontokenparamsz1https://legulegu.com/stockdata/ashares-congestion)urlitemsdate)r   close
congestionr   coerce)errorsr   )r   requestsgetr   jsonpd	DataFrameto_datetimedtr   
to_numeric)r	   r   r   r	data_jsontemp_dfs         T/usr/local/lib/python3.11/dist-packages/akshare/stock_feature/stock_congestion_lg.pystock_a_congestion_lgr      s     BCNNEuF	 		 Q
R
R
R	 	A
 Il9W-..GnWV_558=GFO	
 	
 	
G }WW%5hGGGGGM',*?QQQGLN    __main__)__doc__pandasr   r   'akshare.stock_feature.stock_a_indicatorr   r   r   r   __name__stock_a_congestion_lg_dfprint r   r   <module>r&      s          Q Q Q Q Q Q Q Qr|    < z4466	E
"##### r   