### Install eastmoneypy Source: https://github.com/zvtvz/eastmoneypy/blob/master/README.md Install the library using pip. ```bash pip3 install -U eastmoneypy ``` -------------------------------- ### Configure eastmoneypy Source: https://github.com/zvtvz/eastmoneypy/blob/master/README.md Set the required header and appkey in the config.json file located in the eastmoney-home directory. ```json { "header": "parse your total header here", "appkey": "parse your appkey here" } ``` -------------------------------- ### Create a New Group Source: https://github.com/zvtvz/eastmoneypy/blob/master/README.md Create a new portfolio group by name. ```python In [3]: create_group('tmp') Out[3]: (True, {'gid': '350518464', 'msg': '添加组合成功'}) ``` -------------------------------- ### Retrieve User Groups Source: https://github.com/zvtvz/eastmoneypy/blob/master/README.md Fetch the list of existing stock groups from the account. ```python In [1]: from eastmoneypy import * In [2]: get_groups() Out[2]: [{'id': '130357503', 'name': '自选股', 'version': '322', 'source': 'web'}, {'id': '348275488', 'name': 'inging', 'version': '17', 'source': 'web'}, {'id': '215892391', 'name': '持仓', 'version': '118', 'source': 'mobile'}, {'id': '327237386', 'name': '港股', 'version': '6', 'source': 'mobile'}, {'id': '235046679', 'name': '刘世军', 'version': '10', 'source': 'mobile'}, {'id': '327744616', 'name': 'etf', 'version': '22', 'source': 'mobile'}, {'id': '350053618', 'name': 'tech', 'version': '0', 'source': 'web'}, {'id': '350485893', 'name': '你好', 'version': '0', 'source': 'web'}, {'id': '130357521', 'name': '持仓股', 'version': '1', 'source': 'mobile'}] ``` -------------------------------- ### Add Assets to a Group Source: https://github.com/zvtvz/eastmoneypy/blob/master/README.md Add stocks, blocks, or international assets to a specified group. ```python >>> add_to_group('000999', group_name='tmp') >>> add_to_group('BK1003', group_name='概念',entity_type='block') >>> add_to_group('MSFT', group_name='tmp', entity_type='stockus') >>> add_to_group('00700', group_name='tmp' entity_type='stockhk') ``` -------------------------------- ### Delete a Group Source: https://github.com/zvtvz/eastmoneypy/blob/master/README.md Remove an existing portfolio group by name. ```python In [5]: del_group('tmp') ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.