{"id":445373,"date":"2025-01-18T03:00:33","date_gmt":"2025-01-18T03:00:33","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=445373"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2025-01-18T03:00:33","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=445373","title":{"rendered":"<span>Spreadsheets ( \u0433\u0443\u0433\u043b \u0434\u043e\u043a ) \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430, \u0447\u0442\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u043d\u0435\u043a\u0448\u0435\u043d<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041a\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f? <\/p>\n<ul>\n<li>\n<p>\u0412\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u0432 Pandas\/Python \u0438 \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438\u0437 \u0433\u0443\u0433\u043b \u0434\u043e\u043a\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u0432 Pandas\/Python \u0438 \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432 \u0433\u0443\u0433\u043b \u0434\u043e\u043a.<\/p>\n<\/li>\n<li>\n<p>\u041d\u043e \u043a\u043e\u043d\u043d\u0435\u043a\u0448\u0435\u043d\u0430 \u043d\u0435\u0442\u0443, \u0442\u043e\u0433\u0434\u0430 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0434\u043b\u044f \u0432\u0430\u0441!<\/p>\n<\/li>\n<\/ul>\n<p>\u0418 \u0442\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e, \u043f\u043e\u0433\u043d\u0430\u043b\u0438! <\/p>\n<p>\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/pypi.org\/project\/gspread-pandas\/\" rel=\"noopener noreferrer nofollow\">gspread_pandas<\/a>, \u0438 \u043f\u043e \u0441\u0443\u0442\u0438 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043a\u043e\u043d\u043d\u0435\u043a\u0448\u0435\u043d\u044b, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0434\u0435\u043b\u0430\u043d\u0430 \u0437\u0430 \u043d\u0430\u0441. \u0412 \u043d\u0435\u043c \u043a\u0443\u0447\u0430 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0437\u0430\u0434\u0430\u0447. <\/p>\n<pre><code>import pandas as pd from gspread_pandas import Spread from gspread_pandas.conf import get_config, get_creds  secret = get_config(     conf_dir='&lt;\u041f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443 \u0441 \u043a\u0440\u0435\u0434\u0430\u043c\u0438&gt;',     file_name='&lt;\u0424\u0430\u0439\u043b \u0441 \u043a\u0440\u0435\u0434\u0430\u043c\u0438&gt;' )  creds = get_creds(config=secret)<\/code><\/pre>\n<p>\u0418 \u044d\u0442\u043e \u0432\u0441\u0435:D <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443, \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 Spread \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u0435\u043c\u0443 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0433\u0443\u0433\u043b \u0434\u043e\u043a:<\/p>\n<pre><code>spreadsheet_link = 'https:\/\/docs.google.com\/spreadsheets\/d\/1YULwugFvBatbIsDjLwMXbyeQobo2vf8LbM68dLu5R9w\/edit?gid=0#gid=0' spread = Spread(     spreadsheet_link,     creds=creds ) df = spread.sheet_to_df() df<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/518\/566\/aa4\/518566aa40c47c17e6a56e4f65db4104.png\" width=\"395\" height=\"373\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/518\/566\/aa4\/518566aa40c47c17e6a56e4f65db4104.png\"\/><\/figure>\n<p>\u0410 \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c DataFrame \u0432 \u0433\u0443\u0433\u043b \u0434\u043e\u043a \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 spread.df_to_sheet, \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u0435\u043c\u0443 DF:<\/p>\n<pre><code># Create test df dict_test = {'col1': [1, 2], 'col2': [3, 4]} df_test = pd.DataFrame(data=dict_test) df_test<\/code><\/pre>\n<p>\u041d\u043e \u0441\u0430\u043c \u0434\u044c\u044f\u0432\u043e\u043b \u0442\u0443\u0442 \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u0430\u043a\u0438 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0430:D <br \/>\u041d\u0430\u0433\u0443\u0433\u043b\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e, \u043f\u043e \u043f\u043e\u0435\u043c\u0443 \u043e\u043f\u044b\u0442\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432. <\/p>\n<p>\u0418 \u0442\u0430\u043a \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u043f\u043e\u0434 \u0441\u0432\u043e\u043c \u0433\u0443\u0433\u043b \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u043e\u043c (\u0438\u043b\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0439 \u0443\u0447\u0435\u0442\u043a\u043e\u0439) \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043f\u043e <a href=\"https:\/\/console.cloud.google.com\/apis\/credentials\" rel=\"noopener noreferrer nofollow\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/010\/b51\/a87\/010b51a877dae377624fd10d4a25ba35.png\" width=\"744\" height=\"358\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/010\/b51\/a87\/010b51a877dae377624fd10d4a25ba35.png\"\/><\/figure>\n<p>\u0422\u0430\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u043c Create credentials -&gt; Servise account.  <br \/>\u0422\u0443\u0442 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u0430\u043a\u043a\u0430\u0443\u043d\u0442.<br \/>\u0414\u0430\u043b\u0435\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432\u0441\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u043e\u043b\u044f \u0438 \u043a\u043b\u0438\u043a\u0430\u0435\u043c Done. <br \/>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u0430\u043a\u043a.  <br \/>\u0414\u0430\u043b\u0435\u0435 \u043a\u043b\u0438\u043a\u0430\u0435\u043c \u0438 \u043f\u0440\u043e\u0432\u0430\u043b\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u0432 \u043d\u0435\u0433\u043e (\u0441\u0442\u0440\u0435\u043b\u043a\u0430 \u043d\u0430 \u0441\u043a\u0440\u0438\u043d\u0435 \u043d\u0438\u0436\u0435):<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6ec\/833\/9cd\/6ec8339cd8d987009343498a98c888e8.png\" width=\"1961\" height=\"202\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6ec\/833\/9cd\/6ec8339cd8d987009343498a98c888e8.png\"\/><\/figure>\n<p>\u041f\u043e\u043f\u0430\u0434\u0430\u0435\u043c \u043d\u0430 \u044d\u0442\u0443 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443: <br \/>\u0418 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c Keys -&gt; Create new key.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/7a9\/2cf\/ee6\/7a92cfee64bb908128b02c3882a4d535.png\" width=\"656\" height=\"525\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7a9\/2cf\/ee6\/7a92cfee64bb908128b02c3882a4d535.png\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/7f2\/fe4\/edf\/7f2fe4edfd34fe6629c1f26855235ea3.png\" width=\"577\" height=\"365\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7f2\/fe4\/edf\/7f2fe4edfd34fe6629c1f26855235ea3.png\"\/><\/figure>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c JSON -&gt; create. <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0436\u0430\u0442\u0438\u044f create \u0443 \u0432\u0430\u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043a\u0430\u0447\u0430\u0435\u0442\u044c\u0441\u044f json \u0444\u0430\u0439\u043b \u0441 \u043a\u0440\u0435\u0434\u0430\u043c\u0438. <br \/>\u0414\u0430\u043b\u0435\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0443\u0442\u044c \u0432 \u043d\u0435\u043c\u0443 \u0438 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u043a\u043e\u0434 \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435: <\/p>\n<pre><code>secret = get_config(     conf_dir='&lt;\u041f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443 \u0441 \u043a\u0440\u0435\u0434\u0430\u043c\u0438&gt;',     file_name='&lt;\u0424\u0430\u0439\u043b \u0441 \u043a\u0440\u0435\u0434\u0430\u043c\u0438&gt;' )<\/code><\/pre>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0436\u0430\u0442\u044c 2 \u043a\u043d\u043e\u043f\u043a\u0438, \u0441\u043d\u043e\u0432\u0430 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043f\u043e <a href=\"https:\/\/console.cloud.google.com\/apis\/credentials\" rel=\"noopener noreferrer nofollow\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>. <br \/>\u0422\u0430\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432  Enabled API &amp; servises:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/060\/754\/023\/0607540232a7004a7b848af990b92165.png\" width=\"1215\" height=\"663\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/060\/754\/023\/0607540232a7004a7b848af990b92165.png\"\/><\/figure>\n<p>\u0418 \u043d\u0430\u0445\u043e\u0434\u0438\u043c Google Sheets API:<br \/>\u0427\u0435\u0440\u0435\u0437 \u043f\u043e\u0438\u0441\u043a \u043d\u0430\u0445\u043e\u0434\u0438\u043c Google Sheets API:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/313\/07a\/40b\/31307a40b3e0c028a30fd0e19dfd341a.png\" width=\"1570\" height=\"486\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/313\/07a\/40b\/31307a40b3e0c028a30fd0e19dfd341a.png\"\/><\/figure>\n<p>\u0418 \u043a\u043b\u0438\u043a\u0430\u0435\u043c  \u043a\u043d\u043e\u043f\u043a\u0443 Enable:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/543\/1a3\/9c4\/5431a39c4c659af64eefe443e2a3dc45.png\" width=\"663\" height=\"371\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/543\/1a3\/9c4\/5431a39c4c659af64eefe443e2a3dc45.png\"\/><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043f\u043e <a href=\"https:\/\/developers.google.com\/drive\/api\/guides\/enable-sdk#enable\" rel=\"noopener noreferrer nofollow\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>   \u0438 \u043a\u043b\u0438\u043a\u0430\u0435\u043c Enable the API :<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/41f\/6d3\/980\/41f6d3980cd545999d721dbfde3ec59d.png\" width=\"1330\" height=\"833\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/41f\/6d3\/980\/41f6d3980cd545999d721dbfde3ec59d.png\"\/><\/figure>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435, \u0434\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0439 \u0443\u0447\u0435\u0442\u043a\u0435 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0447\u0438\u0442\u0430\u0442\u044c\/\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043e\u0441\u0442\u0443\u043f \u0432 \u043a\u043e\u043d\u043a\u0442\u0435\u043d\u0442\u044b\u0439 \u0433\u0443\u0433\u043b \u0434\u043e\u043a. <\/p>\n<p>\u041f\u043e \u0442\u043e\u0439 \u0436\u0435 <a href=\"https:\/\/console.cloud.google.com\/apis\/credentials\" rel=\"noopener noreferrer nofollow\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a> \u0443\u0437\u043d\u0430\u0435\u043c \u0438\u043c\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0439 \u0443\u0447\u0435\u0442\u043a\u0438:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/817\/d49\/c8e\/817d49c8ed25cd3377b3e91c3e639ff7.png\" width=\"888\" height=\"742\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/817\/d49\/c8e\/817d49c8ed25cd3377b3e91c3e639ff7.png\"\/><\/figure>\n<p>\u0418 \u0434\u0430\u0435\u043c \u0435\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u0432 \u0441\u0430\u043c\u043e\u043c \u0433\u0443\u0433 \u0434\u043e\u043a\u0435:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d56\/495\/215\/d56495215f7a056fa6b51cc18d637f46.png\" width=\"424\" height=\"180\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d56\/495\/215\/d56495215f7a056fa6b51cc18d637f46.png\"\/><\/figure>\n<p>\u0414\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0443\u0441\u043f\u0435\u0445 \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0438\u0441\u0438! <\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/874510\/\"> https:\/\/habr.com\/ru\/articles\/874510\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041a\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f? <\/p>\n<ul>\n<li>\n<p>\u0412\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u0432 Pandas\/Python \u0438 \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438\u0437 \u0433\u0443\u0433\u043b \u0434\u043e\u043a\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u0432 Pandas\/Python \u0438 \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432 \u0433\u0443\u0433\u043b \u0434\u043e\u043a.<\/p>\n<\/li>\n<li>\n<p>\u041d\u043e \u043a\u043e\u043d\u043d\u0435\u043a\u0448\u0435\u043d\u0430 \u043d\u0435\u0442\u0443, \u0442\u043e\u0433\u0434\u0430 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0434\u043b\u044f \u0432\u0430\u0441!<\/p>\n<\/li>\n<\/ul>\n<p>\u0418 \u0442\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e, \u043f\u043e\u0433\u043d\u0430\u043b\u0438! <\/p>\n<p>\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/pypi.org\/project\/gspread-pandas\/\" rel=\"noopener noreferrer nofollow\">gspread_pandas<\/a>, \u0438 \u043f\u043e \u0441\u0443\u0442\u0438 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043a\u043e\u043d\u043d\u0435\u043a\u0448\u0435\u043d\u044b, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0434\u0435\u043b\u0430\u043d\u0430 \u0437\u0430 \u043d\u0430\u0441. \u0412 \u043d\u0435\u043c \u043a\u0443\u0447\u0430 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0437\u0430\u0434\u0430\u0447. <\/p>\n<pre><code>import pandas as pd from gspread_pandas import Spread from gspread_pandas.conf import get_config, get_creds  secret = get_config(     conf_dir='&lt;\u041f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443 \u0441 \u043a\u0440\u0435\u0434\u0430\u043c\u0438&gt;',     file_name='&lt;\u0424\u0430\u0439\u043b \u0441 \u043a\u0440\u0435\u0434\u0430\u043c\u0438&gt;' )  creds = get_creds(config=secret)<\/code><\/pre>\n<p>\u0418 \u044d\u0442\u043e \u0432\u0441\u0435:D <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443, \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 Spread \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u0435\u043c\u0443 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0433\u0443\u0433\u043b \u0434\u043e\u043a:<\/p>\n<pre><code>spreadsheet_link = 'https:\/\/docs.google.com\/spreadsheets\/d\/1YULwugFvBatbIsDjLwMXbyeQobo2vf8LbM68dLu5R9w\/edit?gid=0#gid=0' spread = Spread(     spreadsheet_link,     creds=creds ) df = spread.sheet_to_df() df<\/code><\/pre>\n<figure class=\"\"><\/figure>\n<p>\u0410 \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c DataFrame \u0432 \u0433\u0443\u0433\u043b \u0434\u043e\u043a \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 spread.df_to_sheet, \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u0435\u043c\u0443 DF:<\/p>\n<pre><code># Create test df dict_test = {'col1': [1, 2], 'col2': [3, 4]} df_test = pd.DataFrame(data=dict_test) df_test<\/code><\/pre>\n<p>\u041d\u043e \u0441\u0430\u043c \u0434\u044c\u044f\u0432\u043e\u043b \u0442\u0443\u0442 \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u0430\u043a\u0438 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0430:D <br \/>\u041d\u0430\u0433\u0443\u0433\u043b\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e, \u043f\u043e \u043f\u043e\u0435\u043c\u0443 \u043e\u043f\u044b\u0442\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432. <\/p>\n<p>\u0418 \u0442\u0430\u043a \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u043f\u043e\u0434 \u0441\u0432\u043e\u043c \u0433\u0443\u0433\u043b \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u043e\u043c (\u0438\u043b\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0439 \u0443\u0447\u0435\u0442\u043a\u043e\u0439) \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043f\u043e <a href=\"https:\/\/console.cloud.google.com\/apis\/credentials\" rel=\"noopener noreferrer nofollow\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>. <\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0422\u0430\u043c \u043d\u0430\u0445\u043e\u0434\u0438\u043c Create credentials -&gt; Servise account.  <br \/>\u0422\u0443\u0442 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u0430\u043a\u043a\u0430\u0443\u043d\u0442.<br \/>\u0414\u0430\u043b\u0435\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432\u0441\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u043e\u043b\u044f \u0438 \u043a\u043b\u0438\u043a\u0430\u0435\u043c Done. <br \/>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u0430\u043a\u043a.  <br \/>\u0414\u0430\u043b\u0435\u0435 \u043a\u043b\u0438\u043a\u0430\u0435\u043c \u0438 \u043f\u0440\u043e\u0432\u0430\u043b\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u0432 \u043d\u0435\u0433\u043e (\u0441\u0442\u0440\u0435\u043b\u043a\u0430 \u043d\u0430 \u0441\u043a\u0440\u0438\u043d\u0435 \u043d\u0438\u0436\u0435):<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u043e\u043f\u0430\u0434\u0430\u0435\u043c \u043d\u0430 \u044d\u0442\u0443 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443: <br \/>\u0418 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c Keys -&gt; Create new key.<\/p>\n<figure class=\"full-width\"><\/figure>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c JSON -&gt; create. <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0436\u0430\u0442\u0438\u044f create \u0443 \u0432\u0430\u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043a\u0430\u0447\u0430\u0435\u0442\u044c\u0441\u044f json \u0444\u0430\u0439\u043b \u0441 \u043a\u0440\u0435\u0434\u0430\u043c\u0438. <br \/>\u0414\u0430\u043b\u0435\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0443\u0442\u044c \u0432 \u043d\u0435\u043c\u0443 \u0438 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u043a\u043e\u0434 \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435: <\/p>\n<pre><code>secret = get_config(     conf_dir='&lt;\u041f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443 \u0441 \u043a\u0440\u0435\u0434\u0430\u043c\u0438&gt;',     file_name='&lt;\u0424\u0430\u0439\u043b \u0441 \u043a\u0440\u0435\u0434\u0430\u043c\u0438&gt;' )<\/code><\/pre>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0436\u0430\u0442\u044c 2 \u043a\u043d\u043e\u043f\u043a\u0438, \u0441\u043d\u043e\u0432\u0430 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043f\u043e <a href=\"https:\/\/console.cloud.google.com\/apis\/credentials\" rel=\"noopener noreferrer nofollow\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>. <br \/>\u0422\u0430\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432  Enabled API &amp; servises:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0418 \u043d\u0430\u0445\u043e\u0434\u0438\u043c Google Sheets API:<br \/>\u0427\u0435\u0440\u0435\u0437 \u043f\u043e\u0438\u0441\u043a \u043d\u0430\u0445\u043e\u0434\u0438\u043c Google Sheets API:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0418 \u043a\u043b\u0438\u043a\u0430\u0435\u043c  \u043a\u043d\u043e\u043f\u043a\u0443 Enable:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043f\u043e <a href=\"https:\/\/developers.google.com\/drive\/api\/guides\/enable-sdk#enable\" rel=\"noopener noreferrer nofollow\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>   \u0438 \u043a\u043b\u0438\u043a\u0430\u0435\u043c Enable the API :<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435, \u0434\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0439 \u0443\u0447\u0435\u0442\u043a\u0435 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0447\u0438\u0442\u0430\u0442\u044c\/\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043e\u0441\u0442\u0443\u043f \u0432 \u043a\u043e\u043d\u043a\u0442\u0435\u043d\u0442\u044b\u0439 \u0433\u0443\u0433\u043b \u0434\u043e\u043a. <\/p>\n<p>\u041f\u043e \u0442\u043e\u0439 \u0436\u0435 <a href=\"https:\/\/console.cloud.google.com\/apis\/credentials\" rel=\"noopener noreferrer nofollow\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a> \u0443\u0437\u043d\u0430\u0435\u043c \u0438\u043c\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0439 \u0443\u0447\u0435\u0442\u043a\u0438:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0418 \u0434\u0430\u0435\u043c \u0435\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u0432 \u0441\u0430\u043c\u043e\u043c \u0433\u0443\u0433 \u0434\u043e\u043a\u0435:<\/p>\n<figure class=\"\"><\/figure>\n<p>\u0414\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0443\u0441\u043f\u0435\u0445 \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0438\u0441\u0438! <\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/874510\/\"> https:\/\/habr.com\/ru\/articles\/874510\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-445373","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/445373","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=445373"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/445373\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=445373"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=445373"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=445373"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}