{"id":466964,"date":"2025-07-14T15:00:14","date_gmt":"2025-07-14T15:00:14","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=466964"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=466964","title":{"rendered":"<span>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 CRM \u0432\u044b\u0431\u043e\u0440 \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c<\/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<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f7e\/6d6\/9ec\/f7e6d69ec508beed52bbd438fb76194d.png\" width=\"940\" height=\"529\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/f7e\/6d6\/9ec\/f7e6d69ec508beed52bbd438fb76194d.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f7e\/6d6\/9ec\/f7e6d69ec508beed52bbd438fb76194d.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440. \u041d\u0430 \u0441\u0432\u044f\u0437\u0438 \u0415\u043a\u0430\u0442\u0435\u0440\u0438\u043d\u0430 \u0421\u0430\u044f\u043f\u0438\u043d\u0430, Product Owner \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b <a href=\"https:\/\/exolve.ru\/\" rel=\"noopener noreferrer nofollow\">\u041c\u0422\u0421 Exolve<\/a>. \u0412 \u044d\u0442\u043e\u043c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 CRM \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c\u0438. \u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u044d\u0442\u043e\u0433\u043e \u043a\u0435\u0439\u0441\u0430 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u043d\u0430\u0448\u0435\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438\u0437 \u043d\u0435\u0435 \u0432 \u0411\u0438\u0442\u0440\u0438\u043a\u044124.<\/p>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u041c\u0422\u0421 Exolve<\/h2>\n<h3>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u043f\u0438\u0441\u0430\u043d \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 <a href=\"https:\/\/habr.com\/ru\/companies\/exolve\/articles\/877214\/\" rel=\"noopener noreferrer nofollow\">\u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432<\/a>: \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0432\u0435\u0441\u0442\u0438 \u0430\u043a\u043a\u0430\u0443\u043d\u0442, \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u043e\u0433\u043e\u0432\u043e\u0440, \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c API-\u043a\u043b\u044e\u0447. \u0412 <a href=\"https:\/\/dev.exolve.ru\/applications\" rel=\"noopener noreferrer nofollow\">\u0441\u043f\u0438\u0441\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439<\/a> \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043d\u0443\u0436\u043d\u043e\u0435:<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2c5\/060\/3c0\/2c50603c0f330654483b27fe48473141.png\" width=\"940\" height=\"475\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/2c5\/060\/3c0\/2c50603c0f330654483b27fe48473141.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2c5\/060\/3c0\/2c50603c0f330654483b27fe48473141.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0417\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u00ab\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438\u00bb \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u0438 \u0441\u043b\u0435\u0432\u0430:<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d6a\/954\/d52\/d6a954d52cff37cebe7bf83ae7fdd716.png\" width=\"940\" height=\"475\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/d6a\/954\/d52\/d6a954d52cff37cebe7bf83ae7fdd716.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d6a\/954\/d52\/d6a954d52cff37cebe7bf83ae7fdd716.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041f\u0440\u043e\u043b\u0438\u0441\u0442\u0430\u0439\u0442\u0435 \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u0432\u043d\u0438\u0437 \u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u00ab\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u00bb \u0432 \u0431\u043b\u043e\u043a\u0435 \u00ab\u0423\u043c\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u043e\u043c\u0435\u0440\u043e\u0432\u00bb:<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a30\/05f\/ebd\/a3005febd27bcbdab3e98aee00306324.png\" width=\"940\" height=\"192\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/a30\/05f\/ebd\/a3005febd27bcbdab3e98aee00306324.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a30\/05f\/ebd\/a3005febd27bcbdab3e98aee00306324.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u043f\u043b\u0430\u0442\u043d\u0430\u044f \u0443\u0441\u043b\u0443\u0433\u0430, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438 \u0438 \u0442\u0430\u0440\u0438\u0444\u0430\u043c\u0438 \u0438 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044c \u0432\u0430\u0448\u0435 \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u0435.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 <a href=\"https:\/\/docs.exolve.ru\/docs\/ru\/api-reference\/hlr-api\/\" rel=\"noopener noreferrer nofollow\">Number Lookup API<\/a> \u2014 \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0437\u0432\u043e\u043d\u043a\u0430. \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <a href=\"https:\/\/docs.exolve.ru\/docs\/ru\/api-reference\/hlr-api\/getting-best-call-time\/\" rel=\"noopener noreferrer nofollow\">GetBestCallTime<\/a>. \u041e\u043d \u043f\u043e\u043a\u0430\u0436\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u0437\u0432\u043e\u043d\u0438\u0442\u044c \u0430\u0431\u043e\u043d\u0435\u043d\u0442\u0443. \u041d\u0430\u0434\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c\u0438 \u041c\u0422\u0421.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c POST-\u0437\u0430\u043f\u0440\u043e\u0441 <a href=\"https:\/\/api.exolve.ru\/hlr\/v1\/GetBestCallTime\" rel=\"noopener noreferrer nofollow\">https:\/\/api.exolve.ru\/hlr\/v1\/GetBestCallTime<\/a>. \u0414\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0435\u0440\u0435\u043c Bearer-\u0442\u043e\u043a\u0435\u043d \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u041c\u0422\u0421 Exolve, \u0430 \u0432 \u0442\u0435\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 JSON-\u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c\u044b\u0439 \u0442\u0435\u043b\u0435\u0444\u043e\u043d. \u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u0432\u0435\u0442\u0430 \u043a \u043d\u0443\u0436\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u0443 \u0434\u0435\u043b\u0430\u0435\u043c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">def get_time(time_string: str):    hstr = time_string.split(':')[0]    return time(hour=int(hstr))   def get_time_range(recepient: str):    payload = {'number': recipient}    r = requests.post(r'https:\/\/api.exolve.ru\/hlr\/v1\/GetBestCallTime', headers={'Authorization': 'Bearer '+sms_api_key}, data=json.dumps(payload))    print(r.text)    if r.status_code == 200:        ans = json.loads(r.text)        text = ans['result'].split(',')        since, till = [get_time(t) for t in text]        ans.update({'since': since, 'till': till})        return ans    return None<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f get_time_range \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 get_time \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0440\u0435\u043c\u044f \u0432 \u0447\u0430\u0441\u0430\u0445, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u043d\u0430\u0447\u0430\u043b\u0443 \u0438 \u043a\u043e\u043d\u0446\u0443 \u043f\u0435\u0440\u0438\u043e\u0434\u0430, \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0431\u043b\u0430\u0433\u043e\u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0433\u043e \u0434\u043b\u044f \u0437\u0432\u043e\u043d\u043a\u0430 \u044d\u0442\u043e\u043c\u0443 \u0430\u0431\u043e\u043d\u0435\u043d\u0442\u0443.<\/p>\n<h2>\u0413\u043e\u0442\u043e\u0432\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 CRM \u0411\u0438\u0442\u0440\u0438\u043a\u044124, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u043d\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f:<\/p>\n<pre><code class=\"python\">from flask import Flask import requests import json from dataclasses import dataclass import pandas as pd from fast_bitrix24 import Bitrix from datetime import time from datetime import datetime as dt<\/code><\/pre>\n<h3>\u0411\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>\u0414\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u0445 \u0438 \u043d\u043e\u043c\u0435\u0440\u0430\u0445 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u0432 \u043f\u043e \u0438\u0445 ID. \u0420\u0430\u0431\u043e\u0442\u0443 \u0441 \u043d\u0438\u043c\u0438 \u043c\u044b \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043f\u0440\u043e\u0448\u043b\u044b\u0445 <a href=\"https:\/\/habr.com\/ru\/companies\/exolve\/articles\/888368\/\" rel=\"noopener noreferrer nofollow\">\u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432<\/a>. \u041d\u043e\u043c\u0435\u0440\u0430, \u0430 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043d\u0438\u043c\u0438 \u043d\u0430\u0447\u0430\u043b\u043e \u0438 \u043a\u043e\u043d\u0435\u0446 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0434\u043b\u044f \u0437\u0432\u043e\u043d\u043a\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0445\u0440\u0430\u043d\u0438\u043c \u0432 pandas DataFrame. \u042d\u0442\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043a\u043b\u0430\u0441\u0441\u0430 DataFrame \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441 \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u0435\u0439 \u043f\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c \u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c. <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0435\u0435 \u043f\u043e\u043b\u044f:<\/p>\n<pre><code class=\"python\">@dataclass class DB:    UTC_plus = 3    phones_and_clients_table = pd.DataFrame(columns=['phone', 'client_id', 'call_since', 'call_till']).set_index(['phone'])<\/code><\/pre>\n<p>\u041e\u043d\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0441\u0434\u0432\u0438\u0433 \u0432 \u0447\u0430\u0441\u0430\u0445 \u0432\u0430\u0448\u0435\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0437\u043e\u043d\u044b \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e UTC+0, \u0430 \u0442\u0430\u043a\u0436\u0435 pandas DataFrame \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u043d\u043e\u043c\u0435\u0440\u0430\u0445 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u0432. <\/p>\n<h4>\u0421\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0441 CRM<\/h4>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f add_client_phones \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043d\u043e\u043c\u0435\u0440\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438\u0437 \u0411\u0438\u0442\u0440\u0438\u043a\u044124 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0438\u0445 \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0431\u0430\u0437\u0443. \u0417\u0430\u0442\u0435\u043c push_phone \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0435\u0433\u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0432 \u0431\u0430\u0437\u0435 \u0438 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442. \u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u043e\u043c\u0435\u0440\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u0432\u043e\u0439 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 client_id. \u0415\u0441\u043b\u0438 \u0435\u0433\u043e \u043d\u0435\u0442, \u0442\u043e \u043e\u043d \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/p>\n<pre><code class=\"python\">   def add_client_phones(self, client_full_record):        contact_phones = [ph.get('VALUE', '') for ph in client_full_record.get('PHONE', [{}])]        if len(contact_phones) == 0:            return 0        for c in contact_phones:            self.push_phone(c, client_ID=[client_full_record.get('ID')])        return 1  def push_phone(self, phone, client_ID=None, since=None, till=None, replace=False):    phone_str = str(phone).replace(' ', '').replace('(', '').replace(')', '').replace('-', '').replace('+', '')    if not replace and phone_str in self.phones_and_clients_table.index:        return    if client_ID is None:        client_ID = self.phones_and_clients_table.shape[0]    self.phones_and_clients_table.loc[phone_str, 'client_id'] = client_ID    self.phones_and_clients_table.loc[phone_str, 'call_since'] = since + self.UTC_plus    self.phones_and_clients_table.loc[phone_str, 'call_till'] = till + self.UTC_plus<\/code><\/pre>\n<h4>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u043f\u0438\u0441\u043a\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u0432<\/h4>\n<p>\u041f\u0440\u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0441 \u0411\u0438\u0442\u0440\u0438\u043a\u044124 \u0434\u043b\u044f \u043d\u043e\u0432\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0433\u0440\u0430\u043d\u0438\u0446 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u2014 \u043a\u043e\u0433\u0434\u0430 \u0441\u0442\u043e\u0438\u0442 \u0437\u0432\u043e\u043d\u0438\u0442\u044c. \u0414\u043b\u044f \u0443\u0436\u0435 \u0432\u043d\u0435\u0441\u0435\u043d\u043d\u044b\u0445 \u0432 \u0431\u0430\u0437\u0443 \u043d\u043e\u043c\u0435\u0440\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u2014 \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a API, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0444\u043b\u0430\u0433 update=True.<\/p>\n<pre><code class=\"python\">def add_times(self, phone, update=False):    if phone not in self.phones_and_clients_table.index: return    if self.phones_and_clients_table.loc[phone, 'call_since'] and self.phones_and_clients_table.loc[phone, 'call_till'] and not update:        return    ans = get_time_range(phone)    if ans is None: return    self.phones_and_clients_table.loc[phone, 'call_since'] = ans['since']    self.phones_and_clients_table.loc[phone, 'call_till'] = ans['till']<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f add_times_for_db \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u0432 \u0432 \u0431\u0430\u0437\u0435:<\/p>\n<pre><code class=\"python\">def add_times_for_db(self, update=False):    for ph in self.phones_and_clients_table.index:        self.add_times(ph, update)<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f select_for_call \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u043e\u043c\u0435\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u0434\u043b\u044f \u0437\u0432\u043e\u043d\u043a\u0430 \u0432 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0435 \u0432\u0440\u0435\u043c\u044f:<\/p>\n<pre><code class=\"python\">def select_for_call(self, hour=None):    if hour is None: hour = dt.now().hour    since_indexes = self.phones_and_clients_table['call_since'] &lt;= hour + 1    till_indexes = self.phones_and_clients_table['call_till'] &gt;= hour    indexes = since_indexes * till_indexes    temp_table = self.phones_and_clients_table.loc[indexes].sort_values('call_till')    return temp_table.index.to_list()<\/code><\/pre>\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0447\u0430\u0441. \u0412\u044b\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u043d\u043e\u043c\u0435\u0440\u0430:<\/p>\n<ul>\n<li>\n<p>\u0447\u0435\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0435\u0449\u0435 \u043d\u0435 \u0438\u0441\u0442\u0435\u043a (call_till \u2265 hour);<\/p>\n<\/li>\n<li>\n<p>\u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0443\u0436\u0435 \u0438\u0434\u0435\u0442 \u0438\u043b\u0438 \u043d\u0430\u0447\u043d\u0435\u0442\u0441\u044f \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0447\u0430\u0441\u0430 (call_since \u2264 hour + 1).<\/p>\n<\/li>\n<\/ul>\n<p>\u0417\u0430\u0442\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 (call_till) \u2014 \u0432 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0435 \u0442\u0435, \u0443 \u043a\u043e\u0433\u043e \u043e\u043d \u0441\u043a\u043e\u0440\u043e \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u0441\u044f. \u041d\u043e\u043c\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043a\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b, \u0432 \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442.<\/p>\n<p>\u0414\u043b\u044f \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430 \u0431\u0430\u0437\u044b \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u0432 \u0432 Excel \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"python\">def dump(self):    self.phones_and_clients_table.to_excel('Dump.xlsx')<\/code><\/pre>\n<h3>\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c<\/h3>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435 Flask. \u041d\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0434\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0435\u0439 JSON-\u043e\u0431\u044a\u0435\u043a\u0442. Flask \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0432 \u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043f\u043e \u0441\u0435\u0442\u0438.<\/p>\n<pre><code class=\"python\">@app.route('\/get_phones', methods=['GET']) def get_phones():    ans = crm_pipeline()    return json.dumps(ans)   def main():    app.run(host='0.0.0.0', port=5000)<\/code><\/pre>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 JSON, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u043c\u0435\u0440\u0430, \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u044b\u0435 \u0432 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435:<\/p>\n<pre><code>[  \"79101????24\",  \"79101????09\",  \"79101????32\", ]<\/code><\/pre>\n<p>\u041c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432, \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0432 JSON \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 https:\/\/&lt;your_server&gt;\/get_phones_list \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"python\">@app.route('\/get_phones_list', methods=['GET']) def get_phones_list():    return db.phone_table.to_json(None, 'index')<\/code><\/pre>\n<p>\u041e\u043d\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 JSON \u0432\u0438\u0434\u0430:<\/p>\n<pre><code>{  \"79101????00\": {    \"client_id\": 0,    \"call_since\": 16,    \"call_till\": 17  },  \"79101????01\": {    \"client_id\": 1,    \"call_since\": 8,    \"call_till\": 9  },  \"79101????03\": {    \"client_id\": 2,    \"call_since\": 11,    \"call_till\": 12  } }<\/code><\/pre>\n<p>\u0412 \u0442\u0430\u043a\u043e\u043c \u0432\u0438\u0434\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438. \u0415\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0438 \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u043c. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Excel \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0444\u0430\u0439\u043b\u0430 \u043f\u043e HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u0443:<\/p>\n<pre><code class=\"python\">@app.route('\/get_phones_table', methods=['GET']) def get_phones_table():    db.dump()    try:        return send_file('Dump.xlsx', mimetype='application\/octet-stream', as_attachment=True)    except Exception as e:        return str(e), 405<\/code><\/pre>\n<p>\u0422\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430:<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d77\/958\/e08\/d77958e08ada04f3e65aaf0736f275db.png\" alt=\"\u041e\u0442\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c Excel-\u0444\u0430\u0439\u043b\u044b \u0443\u043c\u0435\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043a\u0442\u043e: pandas \u0438 polars \u043d\u0430 Python, MatLab, readxl \u043d\u0430 R\" title=\"\u041e\u0442\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c Excel-\u0444\u0430\u0439\u043b\u044b \u0443\u043c\u0435\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043a\u0442\u043e: pandas \u0438 polars \u043d\u0430 Python, MatLab, readxl \u043d\u0430 R\" width=\"940\" height=\"483\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/d77\/958\/e08\/d77958e08ada04f3e65aaf0736f275db.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d77\/958\/e08\/d77958e08ada04f3e65aaf0736f275db.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption><em>\u041e\u0442\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c Excel-\u0444\u0430\u0439\u043b\u044b \u0443\u043c\u0435\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043a\u0442\u043e: pandas \u0438 polars \u043d\u0430 Python, MatLab, readxl \u043d\u0430 R<\/em><\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043d\u043e\u043c\u0435\u0440\u043e\u0432 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u0432 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432, \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0433\u0440\u0430\u043d\u0438\u0446 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0434\u043b\u044f \u0437\u0432\u043e\u043d\u043a\u043e\u0432 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0439 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438:<\/p>\n<pre><code class=\"python\">def crm_pipeline():    clients = get_contacts()    for c in clients:        db.add_client_phones(c)    db.add_times_for_db()    ans = db.select_for_call()    return ans<\/code><\/pre>\n<p>\u042d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432 \u0434\u043e\u043a\u0435\u0440-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043d\u0430 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u043c \u0445\u043e\u0441\u0442\u0438\u043d\u0433\u0435, \u043a\u0430\u043a \u043c\u044b \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0438 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043d\u0430\u0448\u0435\u043c <a href=\"https:\/\/habr.com\/ru\/companies\/exolve\/articles\/877214\/\" rel=\"noopener noreferrer nofollow\">\u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0435<\/a>. \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0442 \u041c\u0422\u0421 Exolve \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043d\u043e\u043c\u0435\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432 \u0431\u0430\u0437\u0443 \u043f\u0440\u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0441 CRM, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0439 \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c.<\/p>\n<hr\/>\n<p>\u041c\u044b \u0441\u043e\u0431\u0440\u0430\u043b\u0438 \u0440\u0430\u0431\u043e\u0447\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0437\u0432\u043e\u043d\u043a\u0430 \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0435\u0433\u043e \u0441 CRM \u0411\u0438\u0442\u0440\u0438\u043a\u044124. \u0412 \u043e\u0441\u043d\u043e\u0432\u0435 \u2014 \u043c\u0435\u0442\u043e\u0434 \u043e\u0434\u0438\u043d\u043e\u0447\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 GetBestCallTime, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u0430\u0431\u043e\u043d\u0435\u043d\u0442 \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0430 \u0441\u0432\u044f\u0437\u0438. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u0441\u043f\u0438\u0441\u043a\u0430\u043c\u0438 \u043d\u043e\u043c\u0435\u0440\u043e\u0432 \u0435\u0441\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 <a href=\"https:\/\/docs.exolve.ru\/docs\/ru\/api-reference\/hlr-api\/generating-best-call-time-report\/\" rel=\"noopener noreferrer nofollow\">GenerateBestCallTimeReport<\/a>.<\/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\/927506\/\"> https:\/\/habr.com\/ru\/articles\/927506\/<\/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<figure class=\"full-width\"><\/figure>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440. \u041d\u0430 \u0441\u0432\u044f\u0437\u0438 \u0415\u043a\u0430\u0442\u0435\u0440\u0438\u043d\u0430 \u0421\u0430\u044f\u043f\u0438\u043d\u0430, Product Owner \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b <a href=\"https:\/\/exolve.ru\/\" rel=\"noopener noreferrer nofollow\">\u041c\u0422\u0421 Exolve<\/a>. \u0412 \u044d\u0442\u043e\u043c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 CRM \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c\u0438. \u0412 \u0440\u0430\u043c\u043a\u0430\u0445 \u044d\u0442\u043e\u0433\u043e \u043a\u0435\u0439\u0441\u0430 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u043d\u0430\u0448\u0435\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438\u0437 \u043d\u0435\u0435 \u0432 \u0411\u0438\u0442\u0440\u0438\u043a\u044124.<\/p>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u041c\u0422\u0421 Exolve<\/h2>\n<h3>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u043f\u0438\u0441\u0430\u043d \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043d\u0430\u0448\u0438\u0445 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 <a href=\"https:\/\/habr.com\/ru\/companies\/exolve\/articles\/877214\/\" rel=\"noopener noreferrer nofollow\">\u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432<\/a>: \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0432\u0435\u0441\u0442\u0438 \u0430\u043a\u043a\u0430\u0443\u043d\u0442, \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u043e\u0433\u043e\u0432\u043e\u0440, \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c API-\u043a\u043b\u044e\u0447. \u0412 <a href=\"https:\/\/dev.exolve.ru\/applications\" rel=\"noopener noreferrer nofollow\">\u0441\u043f\u0438\u0441\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439<\/a> \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043d\u0443\u0436\u043d\u043e\u0435:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0417\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u00ab\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438\u00bb \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u0438 \u0441\u043b\u0435\u0432\u0430:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u0440\u043e\u043b\u0438\u0441\u0442\u0430\u0439\u0442\u0435 \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u0432\u043d\u0438\u0437 \u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u00ab\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u00bb \u0432 \u0431\u043b\u043e\u043a\u0435 \u00ab\u0423\u043c\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u043e\u043c\u0435\u0440\u043e\u0432\u00bb:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u043f\u043b\u0430\u0442\u043d\u0430\u044f \u0443\u0441\u043b\u0443\u0433\u0430, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c\u0438 \u0438 \u0442\u0430\u0440\u0438\u0444\u0430\u043c\u0438 \u0438 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044c \u0432\u0430\u0448\u0435 \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u0435.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 <a href=\"https:\/\/docs.exolve.ru\/docs\/ru\/api-reference\/hlr-api\/\" rel=\"noopener noreferrer nofollow\">Number Lookup API<\/a> \u2014 \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0437\u0432\u043e\u043d\u043a\u0430. \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <a href=\"https:\/\/docs.exolve.ru\/docs\/ru\/api-reference\/hlr-api\/getting-best-call-time\/\" rel=\"noopener noreferrer nofollow\">GetBestCallTime<\/a>. \u041e\u043d \u043f\u043e\u043a\u0430\u0436\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u0437\u0432\u043e\u043d\u0438\u0442\u044c \u0430\u0431\u043e\u043d\u0435\u043d\u0442\u0443. \u041d\u0430\u0434\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c\u0438 \u041c\u0422\u0421.<\/p>\n<h3>\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c POST-\u0437\u0430\u043f\u0440\u043e\u0441 <a href=\"https:\/\/api.exolve.ru\/hlr\/v1\/GetBestCallTime\" rel=\"noopener noreferrer nofollow\">https:\/\/api.exolve.ru\/hlr\/v1\/GetBestCallTime<\/a>. \u0414\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0435\u0440\u0435\u043c Bearer-\u0442\u043e\u043a\u0435\u043d \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u041c\u0422\u0421 Exolve, \u0430 \u0432 \u0442\u0435\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 JSON-\u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c\u044b\u0439 \u0442\u0435\u043b\u0435\u0444\u043e\u043d. \u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u0432\u0435\u0442\u0430 \u043a \u043d\u0443\u0436\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u0443 \u0434\u0435\u043b\u0430\u0435\u043c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">def get_time(time_string: str):    hstr = time_string.split(':')[0]    return time(hour=int(hstr))   def get_time_range(recepient: str):    payload = {'number': recipient}    r = requests.post(r'https:\/\/api.exolve.ru\/hlr\/v1\/GetBestCallTime', headers={'Authorization': 'Bearer '+sms_api_key}, data=json.dumps(payload))    print(r.text)    if r.status_code == 200:        ans = json.loads(r.text)        text = ans['result'].split(',')        since, till = [get_time(t) for t in text]        ans.update({'since': since, 'till': till})        return ans    return None<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f get_time_range \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 get_time \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0440\u0435\u043c\u044f \u0432 \u0447\u0430\u0441\u0430\u0445, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u043d\u0430\u0447\u0430\u043b\u0443 \u0438 \u043a\u043e\u043d\u0446\u0443 \u043f\u0435\u0440\u0438\u043e\u0434\u0430, \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0431\u043b\u0430\u0433\u043e\u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0433\u043e \u0434\u043b\u044f \u0437\u0432\u043e\u043d\u043a\u0430 \u044d\u0442\u043e\u043c\u0443 \u0430\u0431\u043e\u043d\u0435\u043d\u0442\u0443.<\/p>\n<h2>\u0413\u043e\u0442\u043e\u0432\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 CRM \u0411\u0438\u0442\u0440\u0438\u043a\u044124, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u043d\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f:<\/p>\n<pre><code class=\"python\">from flask import Flask import requests import json from dataclasses import dataclass import pandas as pd from fast_bitrix24 import Bitrix from datetime import time from datetime import datetime as dt<\/code><\/pre>\n<h3>\u0411\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>\u0414\u043b\u044f \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u0445 \u0438 \u043d\u043e\u043c\u0435\u0440\u0430\u0445 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u0432 \u043f\u043e \u0438\u0445 ID. \u0420\u0430\u0431\u043e\u0442\u0443 \u0441 \u043d\u0438\u043c\u0438 \u043c\u044b \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043f\u0440\u043e\u0448\u043b\u044b\u0445 <a href=\"https:\/\/habr.com\/ru\/companies\/exolve\/articles\/888368\/\" rel=\"noopener noreferrer nofollow\">\u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432<\/a>. \u041d\u043e\u043c\u0435\u0440\u0430, \u0430 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043d\u0438\u043c\u0438 \u043d\u0430\u0447\u0430\u043b\u043e \u0438 \u043a\u043e\u043d\u0435\u0446 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0434\u043b\u044f \u0437\u0432\u043e\u043d\u043a\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0445\u0440\u0430\u043d\u0438\u043c \u0432 pandas DataFrame. \u042d\u0442\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043a\u043b\u0430\u0441\u0441\u0430 DataFrame \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441 \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u0435\u0439 \u043f\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c \u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c. <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0435\u0435 \u043f\u043e\u043b\u044f:<\/p>\n<pre><code class=\"python\">@dataclass class DB:    UTC_plus = 3    phones_and_clients_table = pd.DataFrame(columns=['phone', 'client_id', 'call_since', 'call_till']).set_index(['phone'])<\/code><\/pre>\n<p>\u041e\u043d\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0441\u0434\u0432\u0438\u0433 \u0432 \u0447\u0430\u0441\u0430\u0445 \u0432\u0430\u0448\u0435\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0437\u043e\u043d\u044b \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e UTC+0, \u0430 \u0442\u0430\u043a\u0436\u0435 pandas DataFrame \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u043d\u043e\u043c\u0435\u0440\u0430\u0445 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u0432. <\/p>\n<h4>\u0421\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0441 CRM<\/h4>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f add_client_phones \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043d\u043e\u043c\u0435\u0440\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438\u0437 \u0411\u0438\u0442\u0440\u0438\u043a\u044124 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0438\u0445 \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0431\u0430\u0437\u0443. \u0417\u0430\u0442\u0435\u043c push_phone \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043d\u043e\u043c\u0435\u0440 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0435\u0433\u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0432 \u0431\u0430\u0437\u0435 \u0438 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442. \u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u043e\u043c\u0435\u0440\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u0432\u043e\u0439 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 client_id. \u0415\u0441\u043b\u0438 \u0435\u0433\u043e \u043d\u0435\u0442, \u0442\u043e \u043e\u043d \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/p>\n<pre><code class=\"python\">   def add_client_phones(self, client_full_record):        contact_phones = [ph.get('VALUE', '') for ph in client_full_record.get('PHONE', [{}])]        if len(contact_phones) == 0:            return 0        for c in contact_phones:            self.push_phone(c, client_ID=[client_full_record.get('ID')])        return 1  def push_phone(self, phone, client_ID=None, since=None, till=None, replace=False):    phone_str = str(phone).replace(' ', '').replace('(', '').replace(')', '').replace('-', '').replace('+', '')    if not replace and phone_str in self.phones_and_clients_table.index:        return    if client_ID is None:        client_ID = self.phones_and_clients_table.shape[0]    self.phones_and_clients_table.loc[phone_str, 'client_id'] = client_ID    self.phones_and_clients_table.loc[phone_str, 'call_since'] = since + self.UTC_plus    self.phones_and_clients_table.loc[phone_str, 'call_till'] = till + self.UTC_plus<\/code><\/pre>\n<h4>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u043f\u0438\u0441\u043a\u0430 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u0432<\/h4>\n<p>\u041f\u0440\u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0441 \u0411\u0438\u0442\u0440\u0438\u043a\u044124 \u0434\u043b\u044f \u043d\u043e\u0432\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0433\u0440\u0430\u043d\u0438\u0446 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u2014 \u043a\u043e\u0433\u0434\u0430 \u0441\u0442\u043e\u0438\u0442 \u0437\u0432\u043e\u043d\u0438\u0442\u044c. \u0414\u043b\u044f \u0443\u0436\u0435 \u0432\u043d\u0435\u0441\u0435\u043d\u043d\u044b\u0445 \u0432 \u0431\u0430\u0437\u0443 \u043d\u043e\u043c\u0435\u0440\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u2014 \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a API, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0444\u043b\u0430\u0433 update=True.<\/p>\n<pre><code class=\"python\">def add_times(self, phone, update=False):    if phone not in self.phones_and_clients_table.index: return    if self.phones_and_clients_table.loc[phone, 'call_since'] and self.phones_and_clients_table.loc[phone, 'call_till'] and not update:        return    ans = get_time_range(phone)    if ans is None: return    self.phones_and_clients_table.loc[phone, 'call_since'] = ans['since']    self.phones_and_clients_table.loc[phone, 'call_till'] = ans['till']<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f add_times_for_db \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u0432 \u0432 \u0431\u0430\u0437\u0435:<\/p>\n<pre><code class=\"python\">def add_times_for_db(self, update=False):    for ph in self.phones_and_clients_table.index:        self.add_times(ph, update)<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f select_for_call \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u043e\u043c\u0435\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u0434\u043b\u044f \u0437\u0432\u043e\u043d\u043a\u0430 \u0432 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0435 \u0432\u0440\u0435\u043c\u044f:<\/p>\n<pre><code class=\"python\">def select_for_call(self, hour=None):    if hour is None: hour = dt.now().hour    since_indexes = self.phones_and_clients_table['call_since'] &lt;= hour + 1    till_indexes = self.phones_and_clients_table['call_till'] &gt;= hour    indexes = since_indexes * till_indexes    temp_table = self.phones_and_clients_table.loc[indexes].sort_values('call_till')    return temp_table.index.to_list()<\/code><\/pre>\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0447\u0430\u0441. \u0412\u044b\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u043d\u043e\u043c\u0435\u0440\u0430:<\/p>\n<ul>\n<li>\n<p>\u0447\u0435\u0439 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0435\u0449\u0435 \u043d\u0435 \u0438\u0441\u0442\u0435\u043a (call_till \u2265 hour);<\/p>\n<\/li>\n<li>\n<p>\u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0443\u0436\u0435 \u0438\u0434\u0435\u0442 \u0438\u043b\u0438 \u043d\u0430\u0447\u043d\u0435\u0442\u0441\u044f \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0447\u0430\u0441\u0430 (call_since \u2264 hour + 1).<\/p>\n<\/li>\n<\/ul>\n<p>\u0417\u0430\u0442\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430 (call_till) \u2014 \u0432 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u0435 \u0442\u0435, \u0443 \u043a\u043e\u0433\u043e \u043e\u043d \u0441\u043a\u043e\u0440\u043e \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u0441\u044f. \u041d\u043e\u043c\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043a\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b, \u0432 \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442.<\/p>\n<p>\u0414\u043b\u044f \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430 \u0431\u0430\u0437\u044b \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u0432 \u0432 Excel \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"python\">def dump(self):    self.phones_and_clients_table.to_excel('Dump.xlsx')<\/code><\/pre>\n<h3>\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c<\/h3>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0435 Flask. \u041d\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0434\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0435\u0439 JSON-\u043e\u0431\u044a\u0435\u043a\u0442. Flask \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0432 \u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043f\u043e \u0441\u0435\u0442\u0438.<\/p>\n<pre><code class=\"python\">@app.route('\/get_phones', methods=['GET']) def get_phones():    ans = crm_pipeline()    return json.dumps(ans)   def main():    app.run(host='0.0.0.0', port=5000)<\/code><\/pre>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 JSON, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u043c\u0435\u0440\u0430, \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u044b\u0435 \u0432 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435:<\/p>\n<pre><code>[  \"79101????24\",  \"79101????09\",  \"79101????32\", ]<\/code><\/pre>\n<p>\u041c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432, \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0432 JSON \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 https:\/\/&lt;your_server&gt;\/get_phones_list \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"python\">@app.route('\/get_phones_list', methods=['GET']) def get_phones_list():    return db.phone_table.to_json(None, 'index')<\/code><\/pre>\n<p>\u041e\u043d\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 JSON \u0432\u0438\u0434\u0430:<\/p>\n<pre><code>{  \"79101????00\": {    \"client_id\": 0,    \"call_since\": 16,    \"call_till\": 17  },  \"79101????01\": {    \"client_id\": 1,    \"call_since\": 8,    \"call_till\": 9  },  \"79101????03\": {    \"client_id\": 2,    \"call_since\": 11,    \"call_till\": 12  } }<\/code><\/pre>\n<p>\u0412 \u0442\u0430\u043a\u043e\u043c \u0432\u0438\u0434\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438. \u0415\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0438 \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u043c. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Excel \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0444\u0430\u0439\u043b\u0430 \u043f\u043e HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u0443:<\/p>\n<pre><code class=\"python\">@app.route('\/get_phones_table', methods=['GET']) def get_phones_table():    db.dump()    try:        return send_file('Dump.xlsx', mimetype='application\/octet-stream', as_attachment=True)    except Exception as e:        return str(e), 405<\/code><\/pre>\n<p>\u0422\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430:<\/p>\n<figure class=\"full-width\">\n<div><figcaption><em>\u041e\u0442\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c Excel-\u0444\u0430\u0439\u043b\u044b \u0443\u043c\u0435\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043a\u0442\u043e: pandas \u0438 polars \u043d\u0430 Python, MatLab, readxl \u043d\u0430 R<\/em><\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043d\u043e\u043c\u0435\u0440\u043e\u0432 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u043e\u0432 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432, \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0433\u0440\u0430\u043d\u0438\u0446 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u0432 \u0434\u043b\u044f \u0437\u0432\u043e\u043d\u043a\u043e\u0432 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0439 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438:<\/p>\n<pre><code class=\"python\">def crm_pipeline():    clients = get_contacts()    for c in clients:        db.add_client_phones(c)    db.add_times_for_db()    ans = db.select_for_call()    return ans<\/code><\/pre>\n<p>\u042d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432 \u0434\u043e\u043a\u0435\u0440-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043d\u0430 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u043c \u0445\u043e\u0441\u0442\u0438\u043d\u0433\u0435, \u043a\u0430\u043a \u043c\u044b \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0438 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043d\u0430\u0448\u0435\u043c <a href=\"https:\/\/habr.com\/ru\/companies\/exolve\/articles\/877214\/\" rel=\"noopener noreferrer nofollow\">\u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0435<\/a>. \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0442 \u041c\u0422\u0421 Exolve \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043d\u043e\u043c\u0435\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432 \u0431\u0430\u0437\u0443 \u043f\u0440\u0438 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0441 CRM, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0439 \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c.<\/p>\n<hr\/>\n<p>\u041c\u044b \u0441\u043e\u0431\u0440\u0430\u043b\u0438 \u0440\u0430\u0431\u043e\u0447\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0437\u0432\u043e\u043d\u043a\u0430 \u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0435\u0433\u043e \u0441 CRM \u0411\u0438\u0442\u0440\u0438\u043a\u044124. \u0412 \u043e\u0441\u043d\u043e\u0432\u0435 \u2014 \u043c\u0435\u0442\u043e\u0434 \u043e\u0434\u0438\u043d\u043e\u0447\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 GetBestCallTime, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u0430\u0431\u043e\u043d\u0435\u043d\u0442 \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0430 \u0441\u0432\u044f\u0437\u0438. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u0441\u043f\u0438\u0441\u043a\u0430\u043c\u0438 \u043d\u043e\u043c\u0435\u0440\u043e\u0432 \u0435\u0441\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 <a href=\"https:\/\/docs.exolve.ru\/docs\/ru\/api-reference\/hlr-api\/generating-best-call-time-report\/\" rel=\"noopener noreferrer nofollow\">GenerateBestCallTimeReport<\/a>.<\/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\/927506\/\"> https:\/\/habr.com\/ru\/articles\/927506\/<\/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-466964","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/466964","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=466964"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/466964\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=466964"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=466964"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=466964"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}