
    fi                         d Z ddlZddlZddlmZ dej        fdZdej        fdZe	dk    r, e            Z
 ee
            e            Z ee           dS dS )uw   
Date: 2023/10/27 20:30
Desc: 天天基金网-基金数据-规模份额
https://fund.eastmoney.com/data/cyrjglist.html
    N)demjsonreturnc                     d} ddddddd}t          j        | |	          }|j        }t          j        ||                    d
          d                   }|d         }t          j                    }t          dt          |          dz             D ]}|
                    d|i           t          j        | |	          }|j        }t          j        ||                    d
          d                   }t          j        |d                   }t          j        ||gd          }|                    d           |d         dz   |d<   g d|_        t          j        |d         d          j        j        |d<   t          j        |d         d          |d<   t          j        |d         j                            dd          d          |d<   t          j        |d         j                            dd          d          |d<   t          j        |d         j                            dd          d          |d<   t          j        |d         j                            dd          d          |d<   |S )u   
    天天基金网-基金数据-规模份额-规模变动
    https://fund.eastmoney.com/data/gmbdlist.html
    :return: 规模变动
    :rtype: pandas.DataFrame
    @https://fund.eastmoney.com/data/FundDataPortfolio_Interface.aspx9150
hypzDetaildesc
reportdatedtpipnmcstscparams{pages   r   dataTobjsignore_indexinplaceindex)   序号   截止日期   基金家数   期间申购   期间赎回   期末总份额   期末净资产r"   coerceerrorsr#   r$   , r%   r&   r'   requestsgettextr   decodefindpd	DataFramerangeintupdateconcatreset_indexcolumnsto_datetimer   date
to_numericstrreplace	urlr   r	data_text	data_json
total_pagebig_dfpagetemp_dfs	            E/usr/local/lib/python3.11/dist-packages/akshare/fund/fund_scale_em.pyfund_scale_change_emrJ      s    MC F 	S(((AIy)<)<r)ABCCI7#J\^^FaZ1,-- F FtTl###LV,,,F	N9Y^^C-@-@2-E#FGG	,y011 1EEE
t$$$Wo)F7O  FN  ^F>,B8TTTW\F>]6.+A(SSSF>]~"**333H  F>  ]~"**333H  F> !# !%--c266x! ! !F !# !%--c266x! ! !F M    c                  n   d} ddddddd}t          j        | |	          }|j        }t          j        ||                    d
          d                   }|d         }t          j                    }t          dt          |          dz             D ]}|
                    d|i           t          j        | |	          }|j        }t          j        ||                    d
          d                   }t          j        |d                   }t          j        ||gd          }|                    d           |d         dz   |d<   g d|_        t          j        |d         d          j        j        |d<   t          j        |d         d          |d<   t          j        |d         d          |d<   t          j        |d         d          |d<   t          j        |d         d          |d<   t          j        |d         j                            dd          d          |d<   |S )u   
    天天基金网-基金数据-规模份额-持有人结构
    https://fund.eastmoney.com/data/cyrjglist.html
    :return: 持有人结构
    :rtype: pandas.DataFrame
    r   11r   r	   r
   r   r   r   r   r   r   r   r   r   r   Tr   r   r    )r!   r"   r#      机构持有比列   个人持有比列   内部持有比列	   总份额r"   r(   r)   r#   rN   rO   rP   rQ   r+   r,   r-   r@   s	            rI   fund_hold_structure_emrR   G   sL    MC F 	S(((AIy)<)<r)ABCCI7#J\^^FaZ1,-- F FtTl###LV,,,F	N9Y^^C-@-@2-E#FGG	,y011 1EEE
t$$$Wo)F7O  FN  ^F>,B8TTTW\F>]6.+A(SSSF>#%=8L1MV^#_#_#_F #%=8L1MV^#_#_#_F #%=8L1MV^#_#_#_F -{''R00  F; MrK   __main__)__doc__pandasr3   r.   akshare.utilsr   r4   rJ   rR   __name__fund_scale_change_em_dfprintfund_hold_structure_em_df rK   rI   <module>r\      s          ! ! ! ! ! !5bl 5 5 5 5p/ / / / /d z2244	E
!""" 6 6 8 8	E
#$$$$$ rK   