{"id":966269,"date":"2024-12-27T04:45:59","date_gmt":"2024-12-26T20:45:59","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/966269.html"},"modified":"2024-12-27T04:46:02","modified_gmt":"2024-12-26T20:46:02","slug":"python%e5%a6%82%e4%bd%95%e5%bc%95%e5%85%a5abupy%e5%8c%85","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/966269.html","title":{"rendered":"python\u5982\u4f55\u5f15\u5165abupy\u5305"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24182135\/c7d97a96-f2bb-4217-bf6b-bd4a71f75739.webp\" alt=\"python\u5982\u4f55\u5f15\u5165abupy\u5305\" \/><\/p>\n<p><p> <strong>Python\u5f15\u5165abupy\u5305\u4e3b\u8981\u901a\u8fc7\u5b89\u88c5\u3001\u5bfc\u5165\u548c\u914d\u7f6e\u73af\u5883\u6765\u5b9e\u73b0\u3002\u4ee5\u4e0b\u662f\u5177\u4f53\u6b65\u9aa4\uff1a\u5b89\u88c5abupy\u5305\u3001\u5bfc\u5165\u5305\u3001\u914d\u7f6e\u6570\u636e\u5b58\u50a8\u8def\u5f84\u3002\u5b89\u88c5abupy\u5305\u53ef\u4ee5\u901a\u8fc7pip\u547d\u4ee4\u5b8c\u6210\uff0c\u5bfc\u5165\u5305\u9700\u8981\u5728Python\u4ee3\u7801\u4e2d\u4f7f\u7528import\u8bed\u53e5\uff0c\u914d\u7f6e\u6570\u636e\u8def\u5f84\u5219\u662f\u4e3a\u4e86\u786e\u4fddabupy\u53ef\u4ee5\u6b63\u5e38\u8bbf\u95ee\u548c\u5b58\u50a8\u6570\u636e\u3002<\/strong>\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u6bcf\u4e2a\u6b65\u9aa4\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u5b89\u88c5ABUPY\u5305<\/p>\n<\/p>\n<p><p>ABUPY\u662f\u4e00\u4e2a\u57fa\u4e8ePython\u7684\u91d1\u878d\u6570\u636e\u5206\u6790\u5e93\uff0c\u56e0\u6b64\u9996\u5148\u9700\u8981\u5728\u7cfb\u7edf\u4e2d\u5b89\u88c5Python\u73af\u5883\u3002\u786e\u4fdd\u4f60\u7684Python\u7248\u672c\u57283.6\u4ee5\u4e0a\uff0c\u56e0\u4e3aABUPY\u9700\u8981\u8fd9\u4e9b\u7248\u672c\u7684\u652f\u6301\u3002\u63a5\u4e0b\u6765\uff0c\u53ef\u4ee5\u901a\u8fc7Python\u7684\u5305\u7ba1\u7406\u5de5\u5177pip\u6765\u5b89\u88c5abupy\u5305\u3002\u5728\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install abupy<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd0\u884c\u4e0a\u8ff0\u547d\u4ee4\u540e\uff0cpip\u5c06\u81ea\u52a8\u4ecePython\u5305\u7d22\u5f15\uff08PyPI\uff09\u4e2d\u4e0b\u8f7d\u5e76\u5b89\u88c5abupy\u5305\u53ca\u5176\u6240\u6709\u4f9d\u8d56\u9879\u3002\u5982\u679c\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u9047\u5230\u7f51\u7edc\u95ee\u9898\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u4f7f\u7528\u955c\u50cf\u6e90\uff0c\u5982\u56fd\u5185\u5e38\u7528\u7684\u6e05\u534e\u6e90\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install abupy -i https:\/\/pypi.tuna.tsinghua.edu.cn\/simple<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u80fd\u591f\u66f4\u5feb\u5730\u4e0b\u8f7d\u548c\u5b89\u88c5abupy\u5305\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u5bfc\u5165ABUPY\u5305<\/p>\n<\/p>\n<p><p>\u5728\u5b89\u88c5\u6210\u529f\u540e\uff0c\u53ef\u4ee5\u5728Python\u9879\u76ee\u4e2d\u5bfc\u5165abupy\u5305\u3002\u4e00\u822c\u6765\u8bf4\uff0c\u5728Python\u811a\u672c\u7684\u5f00\u5934\u4f4d\u7f6e\u5bfc\u5165\u6240\u9700\u7684\u5e93\uff0c\u4ee5\u4fbf\u5728\u6574\u4e2a\u811a\u672c\u4e2d\u4f7f\u7528\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u5bfc\u5165\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import abupy<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u57fa\u7840\u4e0a\uff0c\u4f60\u53ef\u4ee5\u8fdb\u4e00\u6b65\u4eceabupy\u4e2d\u5bfc\u5165\u7279\u5b9a\u7684\u6a21\u5757\u6216\u51fd\u6570\u6765\u6ee1\u8db3\u5177\u4f53\u7684\u9700\u6c42\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f60\u9700\u8981\u4f7f\u7528abupy\u4e2d\u7684\u6570\u636e\u5206\u6790\u529f\u80fd\uff0c\u53ef\u4ee5\u5bfc\u5165\u76f8\u5173\u6a21\u5757\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from abupy import AbuDataCenter<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u4f60\u53ef\u4ee5\u66f4\u52a0\u65b9\u4fbf\u5730\u4f7f\u7528abupy\u63d0\u4f9b\u7684\u5404\u79cd\u529f\u80fd\u548c\u5de5\u5177\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001\u914d\u7f6e\u6570\u636e\u5b58\u50a8\u8def\u5f84<\/p>\n<\/p>\n<p><p>ABUPY\u9700\u8981\u5b58\u50a8\u548c\u8bbf\u95ee\u5927\u91cf\u7684\u91d1\u878d\u6570\u636e\uff0c\u56e0\u6b64\u9700\u8981\u4e3a\u5176\u914d\u7f6e\u4e00\u4e2a\u6570\u636e\u5b58\u50a8\u8def\u5f84\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cabupy\u4f1a\u5728\u7528\u6237\u4e3b\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a\u201cabu\u201d\u7684\u76ee\u5f55\u7528\u4e8e\u5b58\u50a8\u6570\u636e\u3002\u5982\u679c\u9700\u8981\u81ea\u5b9a\u4e49\u6570\u636e\u5b58\u50a8\u8def\u5f84\uff0c\u53ef\u4ee5\u5728\u7a0b\u5e8f\u4e2d\u8fdb\u884c\u5982\u4e0b\u8bbe\u7f6e\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import abupy<\/p>\n<p>abupy.env.g_project_data_dir = &#39;\/your\/custom\/data\/path&#39;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5c06\u201c\/your\/custom\/data\/path\u201d\u66ff\u6362\u4e3a\u4f60\u5e0c\u671b\u7528\u4f5c\u6570\u636e\u5b58\u50a8\u7684\u8def\u5f84\u3002\u8fd9\u6837\uff0cabupy\u5c06\u4f7f\u7528\u6307\u5b9a\u7684\u8def\u5f84\u6765\u8bfb\u53d6\u548c\u5b58\u50a8\u6570\u636e\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001\u4f7f\u7528ABUPY\u8fdb\u884c\u6570\u636e\u5206\u6790<\/p>\n<\/p>\n<p><p>\u5b8c\u6210\u4ee5\u4e0a\u6b65\u9aa4\u540e\uff0cabupy\u5305\u5df2\u7ecf\u5728\u4f60\u7684Python\u73af\u5883\u4e2d\u51c6\u5907\u5c31\u7eea\u3002\u63a5\u4e0b\u6765\uff0c\u53ef\u4ee5\u5f00\u59cb\u4f7f\u7528abupy\u8fdb\u884c\u5404\u79cd\u91d1\u878d\u6570\u636e\u5206\u6790\u4efb\u52a1\u3002ABUPY\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u529f\u80fd\uff0c\u5305\u62ec\u6570\u636e\u83b7\u53d6\u3001\u80a1\u7968\u5206\u6790\u3001\u7b56\u7565\u56de\u6d4b\u7b49\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u4f7f\u7528\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from abupy import AbuMarketDrawing<\/p>\n<h2><strong>\u52a0\u8f7d\u80a1\u7968\u6570\u636e<\/strong><\/h2>\n<p>from abupy import AbuDataCenter<\/p>\n<p>stock_data = AbuDataCenter.load_kline_ds(symbol=&#39;usAAPL&#39;)<\/p>\n<h2><strong>\u7ed8\u5236\u80a1\u7968\u6570\u636e\u56fe\u8868<\/strong><\/h2>\n<p>AbuMarketDrawing.plot_kline(stock_data)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u9996\u5148\u4eceabupy\u4e2d\u5bfc\u5165\u4e86AbuMarketDrawing\u6a21\u5757\u548cAbuDataCenter\u6a21\u5757\uff0c\u7136\u540e\u4f7f\u7528AbuDataCenter\u52a0\u8f7d\u82f9\u679c\u516c\u53f8\uff08AAPL\uff09\u7684\u80a1\u7968\u6570\u636e\uff0c\u6700\u540e\u4f7f\u7528AbuMarketDrawing\u7ed8\u5236\u80a1\u7968\u6570\u636e\u7684K\u7ebf\u56fe\u8868\u3002<\/p>\n<\/p>\n<p><p>\u4e94\u3001\u6df1\u5165\u4e86\u89e3ABUPY\u529f\u80fd<\/p>\n<\/p>\n<p><p>ABUPY\u4e0d\u4ec5\u4ec5\u63d0\u4f9b\u4e86\u57fa\u672c\u7684\u6570\u636e\u5206\u6790\u529f\u80fd\uff0c\u8fd8\u5177\u6709\u8bb8\u591a\u9ad8\u7ea7\u7279\u6027\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5173\u952e\u529f\u80fd\u7684\u4ecb\u7ecd\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u91d1\u878d\u6570\u636e\u83b7\u53d6<\/strong>\uff1aABUPY\u652f\u6301\u4ece\u591a\u4e2a\u6570\u636e\u6e90\u83b7\u53d6\u91d1\u878d\u6570\u636e\uff0c\u5305\u62ec\u80a1\u7968\u3001\u671f\u8d27\u3001\u5916\u6c47\u7b49\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528ABUPY\u63d0\u4f9b\u7684API\u8f7b\u677e\u83b7\u53d6\u6240\u9700\u7684\u6570\u636e\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6570\u636e\u53ef\u89c6\u5316<\/strong>\uff1a\u901a\u8fc7ABUPY\uff0c\u4f60\u53ef\u4ee5\u65b9\u4fbf\u5730\u5c06\u91d1\u878d\u6570\u636e\u53ef\u89c6\u5316\u3002ABUPY\u63d0\u4f9b\u4e86\u591a\u79cd\u56fe\u8868\u7c7b\u578b\uff0c\u5305\u62ecK\u7ebf\u56fe\u3001\u67f1\u72b6\u56fe\u3001\u6298\u7ebf\u56fe\u7b49\uff0c\u5e2e\u52a9\u4f60\u66f4\u597d\u5730\u7406\u89e3\u6570\u636e\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7b56\u7565\u56de\u6d4b<\/strong>\uff1aABUPY\u5185\u7f6e\u4e86\u7b56\u7565\u56de\u6d4b\u5f15\u64ce\uff0c\u652f\u6301\u591a\u79cd\u7b56\u7565\u7684\u56de\u6d4b\u548c\u8bc4\u4f30\u3002\u4f60\u53ef\u4ee5\u5b9a\u4e49\u81ea\u5df1\u7684\u4ea4\u6613\u7b56\u7565\uff0c\u5e76\u4f7f\u7528ABUPY\u8fdb\u884c\u5386\u53f2\u6570\u636e\u7684\u56de\u6d4b\uff0c\u4ee5\u8bc4\u4f30\u7b56\u7565\u7684\u6709\u6548\u6027\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u98ce\u9669\u7ba1\u7406<\/strong>\uff1aABUPY\u63d0\u4f9b\u4e86\u98ce\u9669\u7ba1\u7406\u5de5\u5177\uff0c\u5e2e\u52a9\u4f60\u5206\u6790\u548c\u8bc4\u4f30\u4ea4\u6613\u7b56\u7565\u7684\u98ce\u9669\uff0c\u5236\u5b9a\u5408\u7406\u7684\u98ce\u9669\u63a7\u5236\u63aa\u65bd\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u6df1\u5165\u4e86\u89e3\u548c\u4f7f\u7528ABUPY\u7684\u8fd9\u4e9b\u529f\u80fd\uff0c\u4f60\u53ef\u4ee5\u5728\u91d1\u878d\u6570\u636e\u5206\u6790\u4e2d\u83b7\u5f97\u66f4\u591a\u7684\u6d1e\u5bdf\u548c\u4ef7\u503c\u3002\u5e0c\u671b\u8fd9\u7bc7\u6587\u7ae0\u5bf9\u4f60\u4e86\u89e3\u5982\u4f55\u5728Python\u4e2d\u5f15\u5165\u548c\u4f7f\u7528ABUPY\u5305\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5b89\u88c5abupy\u5305\u4ee5\u4fbf\u5728Python\u4e2d\u4f7f\u7528\uff1f<\/strong><br \/>\u8981\u5728Python\u4e2d\u4f7f\u7528abupy\u5305\uff0c\u9996\u5148\u9700\u8981\u786e\u4fdd\u60a8\u7684\u73af\u5883\u4e2d\u5b89\u88c5\u4e86\u8be5\u5305\u3002\u53ef\u4ee5\u901a\u8fc7\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5\uff1a<code>pip install abupy<\/code>\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u60a8\u5c31\u53ef\u4ee5\u5728Python\u811a\u672c\u4e2d\u5f15\u5165\u8be5\u5305\u3002<\/p>\n<p><strong>abupy\u5305\u9002\u5408\u54ea\u4e9b\u7c7b\u578b\u7684\u9879\u76ee\uff1f<\/strong><br \/>abupy\u5305\u4e3b\u8981\u7528\u4e8e\u91cf\u5316\u4ea4\u6613\u548c\u6570\u636e\u5206\u6790\uff0c\u7279\u522b\u9002\u5408\u90a3\u4e9b\u9700\u8981\u5904\u7406\u91d1\u878d\u6570\u636e\u3001\u56de\u6d4b\u4ea4\u6613\u7b56\u7565\u6216\u8fdb\u884c\u6570\u636e\u53ef\u89c6\u5316\u7684\u9879\u76ee\u3002\u5982\u679c\u60a8\u6b63\u5728\u4ece\u4e8b\u91d1\u878d\u9886\u57df\u7684\u5de5\u4f5c\u6216\u7814\u7a76\uff0cabupy\u5c06\u662f\u4e00\u4e2a\u975e\u5e38\u6709\u7528\u7684\u5de5\u5177\u3002<\/p>\n<p><strong>\u5f15\u5165abupy\u5305\u540e\uff0c\u6211\u53ef\u4ee5\u4f7f\u7528\u54ea\u4e9b\u529f\u80fd\uff1f<\/strong><br \/>\u5f15\u5165abupy\u5305\u540e\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u5176\u4e2d\u63d0\u4f9b\u7684\u591a\u79cd\u529f\u80fd\uff0c\u4f8b\u5982\u83b7\u53d6\u80a1\u7968\u548c\u671f\u8d27\u7684\u5386\u53f2\u6570\u636e\u3001\u8fdb\u884c\u6570\u636e\u56de\u6d4b\u3001\u751f\u6210\u4ea4\u6613\u4fe1\u53f7\u3001\u4ee5\u53ca\u7ed8\u5236\u76f8\u5173\u7684\u56fe\u8868\u7b49\u3002\u8fd9\u4f7f\u5f97\u60a8\u80fd\u591f\u66f4\u65b9\u4fbf\u5730\u8fdb\u884c\u91cf\u5316\u5206\u6790\u548c\u51b3\u7b56\u652f\u6301\u3002<\/p>\n<p><strong>abupy\u5305\u7684\u6587\u6863\u548c\u5b66\u4e60\u8d44\u6e90\u5728\u54ea\u91cc\u53ef\u4ee5\u627e\u5230\uff1f<\/strong><br \/>abupy\u5305\u7684\u5b98\u65b9\u6587\u6863\u548c\u76f8\u5173\u5b66\u4e60\u8d44\u6e90\u901a\u5e38\u53ef\u4ee5\u5728\u5176GitHub\u9875\u9762\u6216PyPI\u9875\u9762\u4e0a\u627e\u5230\u3002\u8fd9\u4e9b\u6587\u6863\u4e2d\u5305\u542b\u4e86\u8be6\u7ec6\u7684\u4f7f\u7528\u8bf4\u660e\u3001\u793a\u4f8b\u4ee3\u7801\u548cAPI\u53c2\u8003\uff0c\u9002\u5408\u521d\u5b66\u8005\u548c\u8fdb\u9636\u7528\u6237\u67e5\u9605\u3002\u540c\u65f6\uff0c\u5728\u7ebf\u793e\u533a\u548c\u8bba\u575b\u4e5f\u63d0\u4f9b\u4e86\u5f88\u591a\u6709\u4ef7\u503c\u7684\u8ba8\u8bba\u548c\u5b9e\u8df5\u7ecf\u9a8c\u5206\u4eab\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u5f15\u5165abupy\u5305\u4e3b\u8981\u901a\u8fc7\u5b89\u88c5\u3001\u5bfc\u5165\u548c\u914d\u7f6e\u73af\u5883\u6765\u5b9e\u73b0\u3002\u4ee5\u4e0b\u662f\u5177\u4f53\u6b65\u9aa4\uff1a\u5b89\u88c5abupy\u5305\u3001\u5bfc\u5165\u5305\u3001\u914d\u7f6e [&hellip;]","protected":false},"author":3,"featured_media":966277,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/966269"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=966269"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/966269\/revisions"}],"predecessor-version":[{"id":966280,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/966269\/revisions\/966280"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/966277"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=966269"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=966269"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=966269"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}