{"id":349129,"date":"2023-06-21T09:01:46","date_gmt":"2023-06-21T09:01:46","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=349129"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=349129","title":{"rendered":"<span>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 SpeedTab \u0438 \u043a\u0430\u043a \u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0441\u044f<\/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>\u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u044f \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e\u043a\u0435\u043d \u0434\u043b\u044f Google API \u0438 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u043b \u0441\u0432\u043e\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043a\u0430\u043a \u043f\u0440\u0438\u043c\u0435\u0440, \u0433\u0434\u0435 \u0442\u0430\u043a\u043e\u0439 \u0442\u043e\u043a\u0435\u043d \u043d\u0443\u0436\u0435\u043d. <a href=\"https:\/\/habr.com\/ru\/sandbox\/191038\/\" rel=\"noopener noreferrer nofollow\">\u0412\u043e\u0442 \u043f\u0440\u044f\u043c\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430<\/a>.<\/p>\n<p>SpeedTab \u044d\u0442\u043e \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u043d\u0430 API \u043e\u0442 \u0433\u0443\u0433\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0433\u0443\u0433\u043b \u0442\u0430\u0431\u043b\u0438\u0446\u044b. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0433\u0443\u0433\u043b \u0434\u0438\u0441\u043a\u043e\u043c.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 SpeedTab \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445.<\/p>\n<pre><code>import speedtab as st   with st.Client('token2.json') as user:     table1 = user.create_spreadsheet(title='My test Spreadsheet', sheets=['One', 'Two'], hide_grid_lines=False) <\/code><\/pre>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0443\u0441\u0442\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443.<\/p>\n<pre><code>import speedtab as st   with st.Client('token2.json') as user:     # table1 = user.create_spreadsheet(title='My test Spreadsheet', sheets=['One', 'Two'], hide_grid_lines=False)     table1 = user.get_spreadsheet('{spreadsheet_id}')      table1.sheet('One').clear().cell_range((2, 1, 21, 2)).set_borders()      (table1.sheet('One').cell_range('B3').write_range([[1, 2, 3], ['Text1', 'Text2', 'Text3']])       .cell_range('B3:D3').set_background_color(st.DefaultColors.DARK_BLUE2).set_borders()      .set_text_format(text_color=st.Color((255, 255, 255)), bold=True,                       vertical_alignment=st.VerticalAlignment.TOP,                       horizontal_alignment=st.HorizontalAlignment.CENTER)       .cell_range((2, 1, 2, 1)).set_num_format(st.ReadyFormats.DECIMAL_PERCENT)      .cell_range((2, 2, 2, 2)).set_num_format(st.Dollar('$#,##0.00'))       .cell_range((3, 1, 4, 2)).set_background_color(st.Color('#ffd966'))      .set_text_format(italic=True, font_size=16, font_family='Lexend')      .set_borders(border_style=st.BorderStyle.DOUBLE, border_sides=st.BorderSides.OUTER_BORDERS, color=st.Color((55, 145, 200)))      ) <\/code><\/pre>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u044d\u0442\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u043a\u043e\u0434\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u044d\u0442\u043e:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c15\/de1\/dc7\/c15de1dc7f0188b3df3a7cf102f95b32.png\" width=\"1868\" height=\"1322\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c15\/de1\/dc7\/c15de1dc7f0188b3df3a7cf102f95b32.png\"\/><\/figure>\n<p>\u0414\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u043d\u0435 \u0431\u0443\u0434\u0435\u043c, \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u044e\u0441\u044c \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u0430\u0445. \u041d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u044e\u0437\u0435\u0440 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0432 \u0433\u0443\u0433\u043b \u0434\u0438\u0441\u043a\u0435 (\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0434\u0430\u043b\u0435\u0435). \u041d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0435 \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c \u0438 \u044f\u0447\u0435\u0439\u043a\u0430\u043c\u0438. \u0427\u0442\u043e\u0431\u044b \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0435 \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440 (&#8216;{spreadsheet_id}&#8217;), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0441\u0441\u044b\u043b\u043a\u0435 \u043c\u0435\u0436\u0434\u0443 <code>spreadsheets\/d\/<\/code> \u0438 <code>\/edit#gid=...<\/code><\/p>\n<p>\u041f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043c\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0432\u0441\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u044b. \u0414\u043b\u044f \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u043e\u043c\u0435\u043d\u044c\u0448\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 &#8216;B3:C&#8217;, \u043b\u0438\u0431\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0437 \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0447\u0438\u0441\u0435\u043b (&#171;\u0441\u0442\u0440\u043e\u043a\u0430&#187;, &#171;\u0441\u0442\u043e\u043b\u0431\u0435\u0446&#187;, &#171;\u0441\u0442\u0440\u043e\u043a\u0430&#187;, &#171;\u0441\u0442\u043e\u043b\u0431\u0435\u0446&#187;), \u0433\u0434\u0435 None \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \u0438\u043b\u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u043c.<\/p>\n<p>\u0412\u0441\u0435 \u0442\u043e\u0447\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435 \u0443\u0436\u0435 \u0432\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432\u0430\u043c \u043d\u0443\u0436\u0435\u043d, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0435 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2ae\/30c\/a67\/2ae30ca6746e5d8e746d09ec01bf1568.png\" width=\"854\" height=\"326\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2ae\/30c\/a67\/2ae30ca6746e5d8e746d09ec01bf1568.png\"\/><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0430\u0431\u043b\u0438\u0447\u043a\u0443 \u0438 \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0435\u0435 \u0432 \u0433\u0443\u0433\u043b \u0442\u0430\u0431\u043b\u0438\u0446\u0443<\/p>\n<pre><code>import speedtab as st import pandas as pd import random   df = pd.DataFrame({'month': range(202301, 202311),                    'amount': random.sample(range(500, 2000), 10),                    'percent': [random.uniform(0, 0.5) for _ in range(10)]})  with st.Client('token2.json') as user:     table1 = user.get_spreadsheet('{spreadsheet_id}')     (table1.sheet('Two')      .cell_range((2, 2, 2, df.shape[1] + 1)).write_dataframe(df, index=False).set_borders()      .set_text_format(text_color=st.Color((255, 255, 255)), font_size=18)      .set_background_color(color=st.Color('#765252'))      .cell_range((2, 2, 2 + df.shape[0], df.shape[1] + 1))      .set_borders(border_sides=[st.BorderSides.OUTER_BORDERS, st.BorderSides.VERTICAL_BORDER])      .cell_range('D:D').set_num_format(st.ReadyFormats.PRETTY_DOLLAR)      .cell_range('E:E').set_num_format(st.ReadyFormats.DECIMAL_PERCENT)      ) <\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b73\/499\/dd8\/b73499dd80b4dfe5b7c9093c9d110e64.png\" width=\"890\" height=\"1295\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b73\/499\/dd8\/b73499dd80b4dfe5b7c9093c9d110e64.png\"\/><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0440\u0438\u0441\u0443\u0435\u043c \u0433\u0440\u0430\u0444\u0438\u043a\u0438<\/p>\n<pre><code>with st.Client('token2.json') as user:     table1 = user.get_spreadsheet('{spreadsheet_id}')     (table1.sheet('Two').cell_range('B16')      .add_chart(columns=[1], chart_type=st.ChartType.COLUMN, title='Income', data_start='C3')      .cell_range('H3')      .add_chart(columns=[2], target_axis=st.AxisPosition.RIGHT_AXIS,                 chart_type=st.ChartType.LINE, title='New Customers', data_start=(3, 3))      )<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/30f\/f37\/cf0\/30ff37cf07a803feca08bc8ce06ff755.png\" width=\"2044\" height=\"1305\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/30f\/f37\/cf0\/30ff37cf07a803feca08bc8ce06ff755.png\"\/><\/figure>\n<p>\u0418 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439<\/p>\n<pre><code>with st.Client('token2.json') as user:     table1 = user.get_spreadsheet('1NFLoAyy52HaNyBv6V7P_OOag_1fsKmQ5xY2p6K_4uQY')     (table1.sheet('One').cell_range('G3')      .add_combo_chart(         left_columns=[1], right_columns=[2], chart_type_left=st.ChartType.COLUMN,         chart_type_right=st.ChartType.LINE, title='Overall', legend_position=st.LegendPosition.RIGHT_LEGEND,         data_sheet_name='Two', data_start='C3')      )<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ce0\/0fd\/bdd\/ce00fdbdd0aa45c0654fa49b4b26aa33.png\" width=\"2231\" height=\"1311\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ce0\/0fd\/bdd\/ce00fdbdd0aa45c0654fa49b4b26aa33.png\"\/><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0430\u043f\u043a\u0443 \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043c \u0442\u0443\u0434\u0430 \u043d\u0430\u0448 \u0444\u0430\u0439\u043b<\/p>\n<pre><code>with st.Client('token2.json') as user:     folder_id = user.create_folder('My reports')     table1 = user.get_spreadsheet('1NFLoAyy52HaNyBv6V7P_OOag_1fsKmQ5xY2p6K_4uQY')      user.move_spreadsheet_to_folder(table1, folder_id)<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/cbf\/47b\/85d\/cbf47b85d00bcc7f47039a2b92d27366.png\" width=\"1178\" height=\"822\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cbf\/47b\/85d\/cbf47b85d00bcc7f47039a2b92d27366.png\"\/><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0430\u043f\u043a\u0430 \u0443\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0430, \u0442\u043e\u0433\u0434\u0430 <code>folder_id<\/code> \u0431\u0443\u0434\u0435\u0442 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0441\u0441\u044b\u043b\u043a\u0435 \u043f\u043e\u0441\u043b\u0435 <code>https:\/\/drive.google.com\/drive\/folders\/<\/code><\/p>\n<p>\u041e\u0442\u043b\u0438\u0447\u043d\u043e. \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438, \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u043b\u0438 \u0433\u0443\u0433\u043b \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043e\u0431\u0435\u0440\u0442\u043a\u0443 SpeedTab.<\/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\/742994\/\"> https:\/\/habr.com\/ru\/articles\/742994\/<\/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>\u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u044f \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e\u043a\u0435\u043d \u0434\u043b\u044f Google API \u0438 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u043b \u0441\u0432\u043e\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043a\u0430\u043a \u043f\u0440\u0438\u043c\u0435\u0440, \u0433\u0434\u0435 \u0442\u0430\u043a\u043e\u0439 \u0442\u043e\u043a\u0435\u043d \u043d\u0443\u0436\u0435\u043d. <a href=\"https:\/\/habr.com\/ru\/sandbox\/191038\/\" rel=\"noopener noreferrer nofollow\">\u0412\u043e\u0442 \u043f\u0440\u044f\u043c\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430<\/a>.<\/p>\n<p>SpeedTab \u044d\u0442\u043e \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u043d\u0430 API \u043e\u0442 \u0433\u0443\u0433\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0433\u0443\u0433\u043b \u0442\u0430\u0431\u043b\u0438\u0446\u044b. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0433\u0443\u0433\u043b \u0434\u0438\u0441\u043a\u043e\u043c.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 SpeedTab \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445.<\/p>\n<pre><code>import speedtab as st   with st.Client('token2.json') as user:     table1 = user.create_spreadsheet(title='My test Spreadsheet', sheets=['One', 'Two'], hide_grid_lines=False) <\/code><\/pre>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0443\u0441\u0442\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443.<\/p>\n<pre><code>import speedtab as st   with st.Client('token2.json') as user:     # table1 = user.create_spreadsheet(title='My test Spreadsheet', sheets=['One', 'Two'], hide_grid_lines=False)     table1 = user.get_spreadsheet('{spreadsheet_id}')      table1.sheet('One').clear().cell_range((2, 1, 21, 2)).set_borders()      (table1.sheet('One').cell_range('B3').write_range([[1, 2, 3], ['Text1', 'Text2', 'Text3']])       .cell_range('B3:D3').set_background_color(st.DefaultColors.DARK_BLUE2).set_borders()      .set_text_format(text_color=st.Color((255, 255, 255)), bold=True,                       vertical_alignment=st.VerticalAlignment.TOP,                       horizontal_alignment=st.HorizontalAlignment.CENTER)       .cell_range((2, 1, 2, 1)).set_num_format(st.ReadyFormats.DECIMAL_PERCENT)      .cell_range((2, 2, 2, 2)).set_num_format(st.Dollar('$#,##0.00'))       .cell_range((3, 1, 4, 2)).set_background_color(st.Color('#ffd966'))      .set_text_format(italic=True, font_size=16, font_family='Lexend')      .set_borders(border_style=st.BorderStyle.DOUBLE, border_sides=st.BorderSides.OUTER_BORDERS, color=st.Color((55, 145, 200)))      ) <\/code><\/pre>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u044d\u0442\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u043a\u043e\u0434\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u044d\u0442\u043e:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0414\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u043d\u0435 \u0431\u0443\u0434\u0435\u043c, \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u044e\u0441\u044c \u043d\u0430 \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u043c\u043e\u043c\u0435\u043d\u0442\u0430\u0445. \u041d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u044e\u0437\u0435\u0440 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0432 \u0433\u0443\u0433\u043b \u0434\u0438\u0441\u043a\u0435 (\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0434\u0430\u043b\u0435\u0435). \u041d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0435 \u0441 \u0442\u0435\u043a\u0441\u0442\u043e\u043c \u0438 \u044f\u0447\u0435\u0439\u043a\u0430\u043c\u0438. \u0427\u0442\u043e\u0431\u044b \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0435 \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440 (&#8216;{spreadsheet_id}&#8217;), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0441\u0441\u044b\u043b\u043a\u0435 \u043c\u0435\u0436\u0434\u0443 <code>spreadsheets\/d\/<\/code> \u0438 <code>\/edit#gid=...<\/code><\/p>\n<p>\u041f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043c\u044b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0432\u0441\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u044b. \u0414\u043b\u044f \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u043e\u043c\u0435\u043d\u044c\u0448\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 &#8216;B3:C&#8217;, \u043b\u0438\u0431\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0437 \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0447\u0438\u0441\u0435\u043b (&#171;\u0441\u0442\u0440\u043e\u043a\u0430&#187;, &#171;\u0441\u0442\u043e\u043b\u0431\u0435\u0446&#187;, &#171;\u0441\u0442\u0440\u043e\u043a\u0430&#187;, &#171;\u0441\u0442\u043e\u043b\u0431\u0435\u0446&#187;), \u0433\u0434\u0435 None \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \u0438\u043b\u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u043c.<\/p>\n<p>\u0412\u0441\u0435 \u0442\u043e\u0447\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435 \u0443\u0436\u0435 \u0432\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432\u0430\u043c \u043d\u0443\u0436\u0435\u043d, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0435 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445. \u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0430\u0431\u043b\u0438\u0447\u043a\u0443 \u0438 \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0435\u0435 \u0432 \u0433\u0443\u0433\u043b \u0442\u0430\u0431\u043b\u0438\u0446\u0443<\/p>\n<pre><code>import speedtab as st import pandas as pd import random   df = pd.DataFrame({'month': range(202301, 202311),                    'amount': random.sample(range(500, 2000), 10),                    'percent': [random.uniform(0, 0.5) for _ in range(10)]})  with st.Client('token2.json') as user:     table1 = user.get_spreadsheet('{spreadsheet_id}')     (table1.sheet('Two')      .cell_range((2, 2, 2, df.shape[1] + 1)).write_dataframe(df, index=False).set_borders()      .set_text_format(text_color=st.Color((255, 255, 255)), font_size=18)      .set_background_color(color=st.Color('#765252'))      .cell_range((2, 2, 2 + df.shape[0], df.shape[1] + 1))      .set_borders(border_sides=[st.BorderSides.OUTER_BORDERS, st.BorderSides.VERTICAL_BORDER])      .cell_range('D:D').set_num_format(st.ReadyFormats.PRETTY_DOLLAR)      .cell_range('E:E').set_num_format(st.ReadyFormats.DECIMAL_PERCENT)      ) <\/code><\/pre>\n<figure class=\"full-width\"><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0440\u0438\u0441\u0443\u0435\u043c \u0433\u0440\u0430\u0444\u0438\u043a\u0438<\/p>\n<pre><code>with st.Client('token2.json') as user:     table1 = user.get_spreadsheet('{spreadsheet_id}')     (table1.sheet('Two').cell_range('B16')      .add_chart(columns=[1], chart_type=st.ChartType.COLUMN, title='Income', data_start='C3')      .cell_range('H3')      .add_chart(columns=[2], target_axis=st.AxisPosition.RIGHT_AXIS,                 chart_type=st.ChartType.LINE, title='New Customers', data_start=(3, 3))      )<\/code><\/pre>\n<figure class=\"full-width\"><\/figure>\n<p>\u0418 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439<\/p>\n<pre><code>with st.Client('token2.json') as user:     table1 = user.get_spreadsheet('1NFLoAyy52HaNyBv6V7P_OOag_1fsKmQ5xY2p6K_4uQY')     (table1.sheet('One').cell_range('G3')      .add_combo_chart(         left_columns=[1], right_columns=[2], chart_type_left=st.ChartType.COLUMN,         chart_type_right=st.ChartType.LINE, title='Overall', legend_position=st.LegendPosition.RIGHT_LEGEND,         data_sheet_name='Two', data_start='C3')      )<\/code><\/pre>\n<figure class=\"full-width\"><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0430\u043f\u043a\u0443 \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043c \u0442\u0443\u0434\u0430 \u043d\u0430\u0448 \u0444\u0430\u0439\u043b<\/p>\n<pre><code>with st.Client('token2.json') as user:     folder_id = user.create_folder('My reports')     table1 = user.get_spreadsheet('1NFLoAyy52HaNyBv6V7P_OOag_1fsKmQ5xY2p6K_4uQY')      user.move_spreadsheet_to_folder(table1, folder_id)<\/code><\/pre>\n<figure class=\"full-width\"><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0430\u043f\u043a\u0430 \u0443\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0430, \u0442\u043e\u0433\u0434\u0430 <code>folder_id<\/code> \u0431\u0443\u0434\u0435\u0442 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0441\u0441\u044b\u043b\u043a\u0435 \u043f\u043e\u0441\u043b\u0435 <code>https:\/\/drive.google.com\/drive\/folders\/<\/code><\/p>\n<p>\u041e\u0442\u043b\u0438\u0447\u043d\u043e. \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438, \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u043b\u0438 \u0433\u0443\u0433\u043b \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043e\u0431\u0435\u0440\u0442\u043a\u0443 SpeedTab.<\/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\/742994\/\"> https:\/\/habr.com\/ru\/articles\/742994\/<\/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-349129","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/349129","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=349129"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/349129\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=349129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=349129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=349129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}