
    fiF                        d Z ddlZddlZddedej        fdZddedej        fdZed	k    r ed
          Z	 e
e	            ed
          Z	 e
e	            ed
          Z	 e
e	            ed
          Z	 e
e	            ed
          Z e
e            ed
          Z e
e            ed
          Z e
e           dS dS )ud   
Date: 2021/12/27 15:47
Desc: 中国公路物流运价、运量指数
http://index.0256.cn/expx.htm
    N	   周指数symbolreturnc           	      T   ddddd}d}dd||          ddd	d	d	d
}dddd}t          j        |||          }|                                }t          j        |d         d         |d         d         |d         d         |d         d         g          j        }g d|_        t          j        |d         d          j        j	        |d<   t          j
        |d         d          |d<   t          j
        |d         d          |d<   t          j
        |d         d          |d<   |S )u  
    中国公路物流运价指数
    http://index.0256.cn/expx.htm
    :param symbol: choice of {"周指数", "月指数", "季度指数", "年度指数"}
    :type symbol: str
    :return: 中国公路物流运价指数
    :rtype: pandas.DataFrame
    2345)r   	   月指数   季度指数   年度指数z+http://index.0256.cn/expcenter_trend.action1u   华北 )marketId
attribute1exponentTypeIdcateId
attribute2city	startLineendLinehttp://index.0256.cnhttp://index.0256.cn/expx.htmsMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36OriginRefererz
User-Agentdataheaderschart1xLebalyLebalchart2chart3   日期   定基指数   环比指数   同比指数r'   coerceerrorsr(   r)   r*   requestspostjsonpd	DataFrameTcolumnsto_datetimedtdate
to_numericr   
symbol_mapurlparamsr    r	data_jsontemp_dfs           C/usr/local/lib/python3.11/dist-packages/akshare/index/index_cflp.pyindex_price_cflprB      so    	 J 8C$V,	 	F )2- G 	c888AIlh)h)h)h)		
    QPPGOwx'8JJJMRGH mGN,CHUUUGN mGN,CHUUUGN mGN,CHUUUGNN    r   c           	      R   dddd}d}dd||          dddddd}d	d
dd}t          j        |||          }|                                }t          j        |d         d         |d         d         |d         d         |d         d         g          j        }g d|_        t          j        |d         d          j        j	        |d<   t          j
        |d         d          |d<   t          j
        |d         d          |d<   t          j
        |d         d          |d<   |S )u   
    中国公路物流运量指数
    http://index.0256.cn/expx.htm
    :param symbol: choice of {"月指数", "季度指数", "年度指数"}
    :type symbol: str
    :return: 中国公路物流运量指数
    :rtype: pandas.DataFrame
    r   r	   r
   )r   r   r   z(http://index.0256.cn/volume_query.actionr   r   )typer   	expTypeId
startDate1endDate1r   
startDate3endDate3r   r   r   r   r   r!   r"   r#   r$   r%   r&   r'   r+   r,   r(   r)   r*   r.   r:   s           rA   index_volume_cflprK   ?   sl     J
 5C'	 	F )2- G 	c888AIlh)h)h)h)		
    QPPGOwx'8JJJMRGH mGN,CHUUUGN mGN,CHUUUGN mGN,CHUUUGNNrC   __main__)r   r   r   )r   )r   )__doc__pandasr2   r/   strr3   rB   rK   __name__index_price_cflp_dfprintindex_volume_cflp_df rC   rA   <module>rU      s        / /S /2< / / / /d. .c .BL . . . .b z**+>>>	E
**+>>>	E
**.AAA	E
**.AAA	E
,,K@@@	E
,,NCCC	E
,,NCCC	E
) rC   