{"id":77002,"date":"2020-04-07T01:42:46","date_gmt":"2020-04-06T23:42:46","guid":{"rendered":"https:\/\/prohoster.info\/blog\/administrirovanie\/etl-proczess-polucheniya-dannyh-iz-elektronnoj-pochty-v-apache-airflow"},"modified":"2020-04-07T01:42:46","modified_gmt":"2020-04-06T23:42:46","slug":"etl-proczess-polucheniya-dannyh-iz-elektronnoj-pochty-v-apache-airflow","status":"publish","type":"post","link":"https:\/\/prohoster.info\/et\/blog\/administrirovanie\/etl-proczess-polucheniya-dannyh-iz-elektronnoj-pochty-v-apache-airflow","title":{"rendered":"ETL protsess andmete hankimiseks e-posti kaudu Apache Airflow's","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p><img decoding=\"async\" alt=\"ETL \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u044b \u0432 Apache Airflow\" src=\"\/wp-content\/uploads\/2020\/04\/5b5aa77a21c276caa5122769f367259a.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p>\u041a\u0430\u043a \u0431\u044b \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0435 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438, \u0437\u0430 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435\u043c \u0432\u0441\u0435\u0433\u0434\u0430 \u0442\u044f\u043d\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u0435\u043d\u0438\u0446\u0430 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0431\u0443\u0441\u043b\u043e\u0432\u043b\u0435\u043d\u043e \u043f\u043b\u0430\u0432\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u043c, \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u0438\u043c \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c, \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u0438\u043b\u0438 \u0447\u0435\u043c-\u0442\u043e \u0434\u0440\u0443\u0433\u0438\u043c. \u0412 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0432 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041a\u0430\u043a \u0431\u044b \u043c\u044b \u043d\u0435 \u043c\u0435\u0447\u0442\u0430\u043b\u0438 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f, \u043d\u043e \u043f\u043e\u043a\u0430 \u0447\u0430\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u0432 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440\u0430\u0445 \u0438 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u044b\u0445 \u043f\u0438\u0441\u044c\u043c\u0430\u0445, \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u044f \u0438 \u043f\u0440\u043e \u0431\u043e\u043b\u0435\u0435 \u0430\u0440\u0445\u0430\u0438\u0447\u043d\u044b\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u044b. \u041f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u044e \u043f\u043e\u0434 \u043a\u0430\u0442 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u0437 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0434\u043b\u044f Apache Airflow, \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0439, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0431\u0438\u0440\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u044b\u0445 \u043f\u0438\u0441\u0435\u043c.<\/p>\n<p><noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><\/p>\n<h2 id=\"predystoriya\">\u041f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u044f<\/h2>\n<p><\/p>\n<p>\u041c\u043d\u043e\u0433\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u0443\u044e \u043f\u043e\u0447\u0442\u0443, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u043c\u0435\u0436\u043b\u0438\u0447\u043d\u043e\u0441\u0442\u043d\u044b\u0445 \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u0439 \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430\u043c\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f\u043c\u0438. \u0425\u043e\u0440\u043e\u0448\u043e, \u0435\u0441\u043b\u0438 \u0443\u0434\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0438\u043b\u0438 \u043f\u043e\u0441\u0430\u0434\u0438\u0442\u044c \u043b\u044e\u0434\u0435\u0439 \u0432 \u043e\u0444\u0438\u0441\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044d\u0442\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0431\u0443\u0434\u0443\u0442 \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u0432 \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u044b\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438, \u043d\u043e \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0442\u0430\u043a\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0431\u044b\u0442\u044c. \u041a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u044f, \u2014 \u044d\u0442\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u0435\u0431\u0435\u0437\u044b\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0439 CRM \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043a \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u0434\u0430\u043b\u0435\u0435 \u2014 \u043a \u0441\u0438\u0441\u0442\u0435\u043c\u0435 OLAP. \u0422\u0430\u043a \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043b\u043e\u0436\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0431\u044b\u043b\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0432\u0437\u044f\u0442\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0431\u0438\u0437\u043d\u0435\u0441\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0435\u043c \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u043f\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u0438\u0437 \u044d\u0442\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435. \u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0431\u044b\u043b\u0430 \u0438\u0437\u0443\u0447\u0435\u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0433\u043e API. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, API \u043d\u0435 \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u043b\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0434\u0430 \u0438, \u0432\u044b\u0440\u0430\u0436\u0430\u044f\u0441\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u044f\u0437\u044b\u043a\u043e\u043c, \u0431\u044b\u043b\u043e \u0432\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u043a\u0440\u0438\u0432\u043e\u0432\u0430\u0442\u043e, \u0430 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043d\u0435 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u0430 \u0438\u043b\u0438 \u043d\u0435 \u0441\u043c\u043e\u0433\u043b\u0430 \u043f\u043e\u0439\u0442\u0438 \u043d\u0430\u0432\u0441\u0442\u0440\u0435\u0447\u0443 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u043e\u043b\u0435\u0435 \u0438\u0441\u0447\u0435\u0440\u043f\u044b\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430. \u0417\u0430\u0442\u043e \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u043b\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u044e\u0449\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u043f\u043e\u0447\u0442\u0443 \u0432 \u0432\u0438\u0434\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u0434\u043b\u044f \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0438 \u0430\u0440\u0445\u0438\u0432\u0430.<\/p>\n<p><\/p>\n<p>\u041d\u0443\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0431\u044b\u043b \u043d\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043a\u0435\u0439\u0441, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0431\u0438\u0437\u043d\u0435\u0441 \u0445\u043e\u0442\u0435\u043b \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043f\u043e\u0447\u0442\u043e\u0432\u044b\u0445 \u043f\u0438\u0441\u0435\u043c \u0438\u043b\u0438 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440\u043e\u0432. \u041e\u0434\u043d\u0430\u043a\u043e, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043d\u0435 \u043c\u043e\u0433\u043b\u0438 \u043f\u043e\u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u044e\u044e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0447\u0430\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u043a\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c.<\/p>\n<p><\/p>\n<h2 id=\"apache-airflow\">Apache Airflow<\/h2>\n<p><\/p>\n<p>\u0414\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f ETL \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u043c\u044b \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c Apache Airflow. \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c, \u043d\u0435\u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0439 \u0441 \u044d\u0442\u043e\u0439 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0435\u0439, \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u044f\u043b, \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0438 \u0432 \u0446\u0435\u043b\u043e\u043c, \u043e\u043f\u0438\u0448\u0443 \u043f\u0430\u0440\u0443 \u0432\u0432\u043e\u0434\u043d\u044b\u0445. <\/p>\n<p><\/p>\n<p>Apache Airflow \u2014 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u0430\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f, \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 ETL (Extract-Transform-Loading) \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Python. \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u043f\u043e\u043d\u044f\u0442\u0438\u0435\u043c \u0432 Airflow \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0430\u0446\u0438\u043a\u043b\u0438\u0447\u043d\u044b\u0439 \u0433\u0440\u0430\u0444, \u0433\u0434\u0435 \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0433\u0440\u0430\u0444\u0430 \u2014 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b, \u0430 \u0440\u0435\u0431\u0440\u0430 \u0433\u0440\u0430\u0444\u0430 \u2014 \u043f\u043e\u0442\u043e\u043a \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u0443\u044e Python \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0430 \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0438\u0437 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u043a\u043b\u0430\u0441\u0441\u0430. \u0414\u043b\u044f \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0447\u0430\u0441\u0442\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u043d\u0430\u0440\u0430\u0431\u043e\u0442\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432. \u041a \u0442\u0430\u043a\u0438\u043c \u043d\u0430\u0440\u0430\u0431\u043e\u0442\u043a\u0430\u043c \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f:<\/p>\n<p><\/p>\n<ul>\n<li>\u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u2014 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0433\u043e\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430 \u0432 \u0434\u0440\u0443\u0433\u043e\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0411\u0414 \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0434\u0430\u043d\u043d\u044b\u0445;<\/li>\n<li>\u0441\u0435\u043d\u0441\u043e\u0440\u044b \u2014 \u0434\u043b\u044f \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u043d\u0430\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0442\u043e\u043a\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0433\u0440\u0430\u0444\u0430;<\/li>\n<li>\u0445\u0443\u043a\u0438 \u2014 \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0411\u0414 (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u0445);<\/li>\n<li>\u0438 \u0442.\u0434.<\/li>\n<\/ul>\n<p><\/p>\n<p>\u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c Apache Airflow \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0446\u0435\u043b\u0435\u0441\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e. \u041a\u0440\u0430\u0442\u043a\u0438\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/company\/mailru\/blog\/339392\/\">\u0437\u0434\u0435\u0441\u044c<\/a><\/noindex> \u0438\u043b\u0438 <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/company\/newprolab\/blog\/358530\/\">\u0437\u0434\u0435\u0441\u044c<\/a><\/noindex>.<\/p>\n<p><\/p>\n<h2 id=\"huk-dlya-polucheniya-dannyh\">\u0425\u0443\u043a \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p><\/p>\n<p>\u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0445\u0443\u043a, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b: <\/p>\n<p><\/p>\n<ul>\n<li>\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u0435;<\/li>\n<li>\u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u043e\u0435 \u043f\u0438\u0441\u044c\u043c\u043e;<\/li>\n<li>\u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043f\u0438\u0441\u044c\u043c\u0430.<\/li>\n<\/ul>\n<p><\/p>\n<pre><code class=\"python\">from airflow.hooks.base_hook import BaseHook\nimport imaplib\nimport logging\n\nclass IMAPHook(BaseHook):\n    def __init__(self, imap_conn_id):\n        &quot;&quot;&quot;\n           IMAP hook \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u044b\n\n           :param imap_conn_id:       \u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u043f\u043e\u0447\u0442\u0435\n           :type imap_conn_id:        string\n        &quot;&quot;&quot;\n        self.connection = self.get_connection(imap_conn_id)\n        self.mail = None\n\n    def authenticate(self):\n        &quot;&quot;&quot; \n            \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043a \u043f\u043e\u0447\u0442\u0435\n        &quot;&quot;&quot;\n        mail = imaplib.IMAP4_SSL(self.connection.host)\n        response, detail = mail.login(user=self.connection.login, password=self.connection.password)\n        if response != &quot;OK&quot;:\n            raise AirflowException(&quot;Sign in failed&quot;)\n        else:\n            self.mail = mail\n\n    def get_last_mail(self, check_seen=True, box=&quot;INBOX&quot;, condition=&quot;(UNSEEN)&quot;):\n        &quot;&quot;&quot;\n            \u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u043f\u0438\u0441\u044c\u043c\u0430, \n            \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0430\u044f\u044e\u0449\u0435\u0433\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c \u043f\u043e\u0438\u0441\u043a\u0430\n\n            :param check_seen:      \u041e\u0442\u043c\u0435\u0447\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u043f\u0438\u0441\u044c\u043c\u043e \u043a\u0430\u043a \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043d\u043e\u0435\n            :type check_seen:       bool\n            :param box:             \u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u044f\u0449\u0438\u043a\u0430\n            :type box:              string\n            :param condition:       \u0423\u0441\u043b\u043e\u0432\u0438\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u0438\u0441\u0435\u043c\n            :type condition:        string\n        &quot;&quot;&quot;\n        self.authenticate()\n        self.mail.select(mailbox=box)\n        response, data = self.mail.search(None, condition)\n        mail_ids = data[0].split()\n        logging.info(&quot;\u0412 \u044f\u0449\u0438\u043a\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0438\u0441\u044c\u043c\u0430: &quot; + str(mail_ids))\n\n        if not mail_ids:\n            logging.info(&quot;\u041d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u043d\u043e\u0432\u044b\u0445 \u043f\u0438\u0441\u0435\u043c&quot;)\n            return None\n\n        mail_id = mail_ids[0]\n\n        # \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u0438\u0445 \u043f\u0438\u0441\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e\n        if len(mail_ids) &gt; 1:\n            # \u043e\u0442\u043c\u0435\u0447\u0430\u0435\u043c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u043c\u0438\n            for id in mail_ids:\n                self.mail.store(id, &quot;+FLAGS&quot;, &quot;\\Seen&quot;)\n\n            # \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435\n            mail_id = mail_ids[-1]\n\n        # \u043d\u0443\u0436\u043d\u043e \u043b\u0438 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u043c\n        if not check_seen:\n            self.mail.store(mail_id, &quot;-FLAGS&quot;, &quot;\\Seen&quot;)\n\n        return mail_id<\/code><\/pre>\n<p><\/p>\n<p>\u041b\u043e\u0433\u0438\u043a\u0430 \u0442\u0430\u043a\u0430\u044f: \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f, \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0441\u0430\u043c\u043e\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0438\u0441\u044c\u043c\u043e, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u2014 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u043c \u0438\u0445. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0437\u0434\u043d\u0438\u0435 \u043f\u0438\u0441\u044c\u043c\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0440\u0430\u043d\u043d\u0438\u0445. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u0432\u0441\u0435\u0445 \u043f\u0438\u0441\u0435\u043c \u0438\u043b\u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0432\u043e\u0435, \u0430 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u2014 \u043f\u0440\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u043e\u0445\u043e\u0434\u0435. \u0412 \u043e\u0431\u0449\u0435\u043c, \u0432\u0441\u0435 \u043a\u0430\u043a \u0432\u0441\u0435\u0433\u0434\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<p><\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a \u0445\u0443\u043a\u0443 \u0434\u0432\u0435 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438: \u0434\u043b\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u0438 \u0434\u043b\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u0438\u0437 \u043f\u0438\u0441\u044c\u043c\u0430. \u041a \u0441\u043b\u043e\u0432\u0443, \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440, \u044d\u0442\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430. \u0427\u0442\u043e \u0435\u0449\u0435 \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432 \u0445\u0443\u043a, \u043e\u043f\u044f\u0442\u044c \u0436\u0435, \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0437\u0430\u0434\u0430\u0447\u0438: \u0435\u0441\u043b\u0438 \u0432 \u043f\u0438\u0441\u044c\u043c\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0441\u0440\u0430\u0437\u0443 \u0444\u0430\u0439\u043b\u044b, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a \u043f\u0438\u0441\u044c\u043c\u0443, \u0435\u0441\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0432 \u043f\u0438\u0441\u044c\u043c\u0435, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0430\u0440\u0441\u0438\u0442\u044c \u043f\u0438\u0441\u044c\u043c\u043e \u0438 \u0442.\u0434. \u0412 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043f\u0438\u0441\u044c\u043c\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0441 \u043e\u0434\u043d\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u043e\u0439 \u043d\u0430 \u0430\u0440\u0445\u0438\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<p><\/p>\n<pre><code class=\"python\">    def download_from_url(self, url, path, chunk_size=128):\n        &quot;&quot;&quot;\n            \u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430\n\n            :param url:              \u0410\u0434\u0440\u0435\u0441 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438\n            :type url:               string\n            :param path:             \u041a\u0443\u0434\u0430 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0444\u0430\u0439\u043b\n            :type path:              string\n            :param chunk_size:       \u041f\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0430\u0439\u0442\u043e\u0432 \u043f\u0438\u0441\u0430\u0442\u044c\n            :type chunk_size:        int\n        &quot;&quot;&quot;\n        r = requests.get(url, stream=True)\n        with open(path, &quot;wb&quot;) as fd:\n            for chunk in r.iter_content(chunk_size=chunk_size):\n                fd.write(chunk)\n\n    def download_mail_href_attachment(self, mail_id, path):\n        &quot;&quot;&quot;\n            \u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u0438\u0437 \u043f\u0438\u0441\u044c\u043c\u0430\n\n            :param mail_id:         \u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u0438\u0441\u044c\u043c\u0430\n            :type mail_id:          string\n            :param path:            \u041a\u0443\u0434\u0430 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0444\u0430\u0439\u043b\n            :type path:             string\n        &quot;&quot;&quot;\n        response, data = self.mail.fetch(mail_id, &quot;(RFC822)&quot;)\n        raw_email = data[0][1]\n        raw_soup = raw_email.decode().replace(&quot;r&quot;, &quot;&quot;).replace(&quot;n&quot;, &quot;&quot;)\n        parse_soup = BeautifulSoup(raw_soup, &quot;html.parser&quot;)\n        link_text = &quot;&quot;\n\n        for a in parse_soup.find_all(&quot;a&quot;, href=True, text=True):\n            link_text = a[&quot;href&quot;]\n\n        self.download_from_url(link_text, path)<\/code><\/pre>\n<p><\/p>\n<p>\u041a\u043e\u0434 \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0440\u044f\u0434 \u043b\u0438 \u043d\u0443\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f\u0445. \u0420\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043b\u0438\u0448\u044c \u043f\u0440\u043e \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u0442\u0440\u043e\u0447\u043a\u0443 imap_conn_id. Apache Airflow \u0445\u0440\u0430\u043d\u0438\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 (\u043b\u043e\u0433\u0438\u043d, \u043f\u0430\u0440\u043e\u043b\u044c, \u0430\u0434\u0440\u0435\u0441 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b), \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u043c\u0443 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0443. \u0412\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a<\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"ETL \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u044b \u0432 Apache Airflow\" src=\"\/wp-content\/uploads\/2020\/04\/a26a8dadf637b0aa4d62150e9f68b8a0.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<h3 id=\"sensor-dlya-ozhidaniya-dannyh\">\u0421\u0435\u043d\u0441\u043e\u0440 \u0434\u043b\u044f \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p><\/p>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u0443\u0436\u0435 \u0443\u043c\u0435\u0435\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043f\u043e\u0447\u0442\u044b, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0435\u043d\u0441\u043e\u0440 \u0434\u043b\u044f \u0438\u0445 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f. \u041d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0438\u043c\u0435\u044e\u0442\u0441\u044f, \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043f\u043e\u0447\u0442\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435, \u0431\u0435\u0440\u0443\u0449\u0438\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0434\u0440\u0443\u0433\u0438\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 (API, \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0438\u044f, \u0432\u0435\u0431 \u043c\u0435\u0442\u0440\u0438\u043a\u0438 \u0438 \u0442.\u0434.). \u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440. \u0412 CRM \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u0438 \u043c\u044b \u0435\u0449\u0435 \u043d\u0435 \u0437\u043d\u0430\u0435\u043c \u043f\u0440\u043e \u0435\u0433\u043e UUID. \u0422\u043e\u0433\u0434\u0430 \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 SIP-\u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0438\u0438 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0437\u0432\u043e\u043d\u043a\u0438, \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043a \u0435\u0433\u043e UUID, \u043d\u043e \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u043c. \u0412 \u0442\u0430\u043a\u0438\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u0445 \u0432\u0430\u0436\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u0432 \u0432\u0438\u0434\u0443 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432. \u042d\u0442\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u0435 \u043c\u0435\u0440\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u043e \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435. \u0414\u0430 \u0438 \u0432 \u0445\u043e\u043b\u043e\u0441\u0442\u0443\u044e \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0442\u043e\u0436\u0435 \u043d\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e.<\/p>\n<p><\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043d\u0430\u0448 \u0441\u0435\u043d\u0441\u043e\u0440 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0433\u0440\u0430\u0444\u0430, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0441\u0432\u0435\u0436\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043d\u0430 \u043f\u043e\u0447\u0442\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043c\u0435\u0447\u0430\u0442\u044c \u043d\u0435\u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e.<\/p>\n<p><\/p>\n<pre><code class=\"python\">from airflow.sensors.base_sensor_operator import BaseSensorOperator\nfrom airflow.utils.decorators import apply_defaults\nfrom my_plugin.hooks.imap_hook import IMAPHook\n\nclass MailSensor(BaseSensorOperator):\n    @apply_defaults\n    def __init__(self, conn_id, check_seen=True, box=&quot;Inbox&quot;, condition=&quot;(UNSEEN)&quot;, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        self.conn_id = conn_id\n        self.check_seen = check_seen\n        self.box = box\n        self.condition = condition\n\n    def poke(self, context):\n        conn = IMAPHook(self.conn_id)\n        mail_id = conn.get_last_mail(check_seen=self.check_seen, box=self.box, condition=self.condition)\n\n        if mail_id is None:\n            return False\n        else:\n            return True<\/code><\/pre>\n<p><\/p>\n<h3 id=\"poluchaem-i-ispolzuem-dannye\">\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435<\/h3>\n<p><\/p>\n<p>\u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u043e\u043a\u0430 \u043b\u043e\u0433\u0438\u043a\u0430 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u2014 \u0437\u0430\u0431\u0440\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043f\u0438\u0441\u044c\u043c\u0430, \u0442\u043e \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 PythonOperator<\/p>\n<p><\/p>\n<pre><code class=\"python\">from airflow.models import DAG\n\nfrom airflow.operators.python_operator import PythonOperator\nfrom airflow.sensors.my_plugin import MailSensor\nfrom my_plugin.hooks.imap_hook import IMAPHook\n\nstart_date = datetime(2020, 4, 4)\n\n# \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0433\u0440\u0430\u0444\u0430\nargs = {\n    &quot;owner&quot;: &quot;example&quot;,\n    &quot;start_date&quot;: start_date,\n    &quot;email&quot;: [&quot;home@home.ru&quot;],\n    &quot;email_on_failure&quot;: False,\n    &quot;email_on_retry&quot;: False,\n    &quot;retry_delay&quot;: timedelta(minutes=15),\n    &quot;provide_context&quot;: False,\n}\n\ndag = DAG(\n    dag_id=&quot;test_etl&quot;,\n    default_args=args,\n    schedule_interval=&quot;@hourly&quot;,\n)\n\n# \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0441\u0435\u043d\u0441\u043e\u0440\nmail_check_sensor = MailSensor(\n    task_id=&quot;check_new_emails&quot;,\n    poke_interval=10,\n    conn_id=&quot;mail_conn_id&quot;,\n    timeout=10,\n    soft_fail=True,\n    box=&quot;my_box&quot;,\n    dag=dag,\n    mode=&quot;poke&quot;,\n)\n\n# \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043f\u0438\u0441\u044c\u043c\u0430\ndef prepare_mail():\n    imap_hook = IMAPHook(&quot;mail_conn_id&quot;)\n    mail_id = imap_hook.get_last_mail(check_seen=True, box=&quot;my_box&quot;)\n    if mail_id is None:\n        raise AirflowException(&quot;Empty mailbox&quot;)\n\n    conn.download_mail_href_attachment(mail_id, &quot;.\/path.zip&quot;)\n\nprepare_mail_data = PythonOperator(task_id=&quot;prepare_mail_data&quot;, default_args=args, dag=dag, python_callable= prepare_mail)\n\n# \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u0435\u0440\u0448\u0438\u043d \u0433\u0440\u0430\u0444\u0430\n...\n\n# \u0417\u0430\u0434\u0430\u0435\u043c \u0441\u0432\u044f\u0437\u044c \u043d\u0430 \u0433\u0440\u0430\u0444\u0435\nmail_check_sensor &gt;&gt; prepare_mail_data\nprepare_data &gt;&gt; ...\n# \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f<\/code><\/pre>\n<p><\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u0435\u0441\u043b\u0438 \u0432\u0430\u0448\u0430 \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u0430\u044f \u043f\u043e\u0447\u0442\u0430 \u0442\u043e\u0436\u0435 \u043d\u0430 mail.ru, \u0442\u043e \u0432\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e\u0438\u0441\u043a \u043f\u0438\u0441\u0435\u043c \u043f\u043e \u0442\u0435\u043c\u0435, \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0435\u043b\u044e \u0438 \u0442.\u0434. \u041e\u043d\u0438 \u0435\u0449\u0435 \u0432 \u0434\u0430\u043b\u0435\u043a\u043e\u043c 2016 \u043e\u0431\u0435\u0449\u0430\u043b\u0438 \u0432\u0432\u0435\u0441\u0442\u0438, \u043d\u043e, \u0432\u0438\u0434\u0438\u043c\u043e, \u043f\u0435\u0440\u0435\u0434\u0443\u043c\u0430\u043b\u0438. \u042f \u0440\u0435\u0448\u0438\u043b \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u0441\u043e\u0437\u0434\u0430\u0432 \u043f\u043e\u0434 \u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u0438\u0441\u044c\u043c\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0432 \u0432 \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 \u043f\u043e\u0447\u0442\u044b \u0444\u0438\u043b\u044c\u0442\u0440 \u043d\u0430 \u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u0438\u0441\u044c\u043c\u0430. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432 \u044d\u0442\u0443 \u043f\u0430\u043f\u043a\u0443 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u0438\u0441\u044c\u043c\u0430 \u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u0441\u0442\u043e (UNSEEN). <\/p>\n<p><\/p>\n<p>\u0420\u0435\u0437\u044e\u043c\u0438\u0440\u0443\u044f, \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c: \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0435\u0441\u0442\u044c \u043b\u0438 \u043d\u043e\u0432\u044b\u0435 \u043f\u0438\u0441\u044c\u043c\u0430, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u043c, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c, \u0442\u043e \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0430\u0440\u0445\u0438\u0432 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u0438\u0437 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u043f\u0438\u0441\u044c\u043c\u0430.<br \/>\n\u041f\u043e\u0434 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c\u0438 \u043c\u043d\u043e\u0433\u043e\u0442\u043e\u0447\u0438\u044f\u043c\u0438 \u043e\u043f\u0443\u0449\u0435\u043d\u043e, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0430\u0440\u0445\u0438\u0432 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u0430\u043d, \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430 \u043e\u0447\u0438\u0449\u0435\u043d\u044b \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b, \u0438 \u0432 \u0438\u0442\u043e\u0433\u0435 \u0432\u0441\u0435 \u044d\u0442\u043e \u0434\u0435\u043b\u043e \u0443\u0439\u0434\u0435\u0442 \u0434\u0430\u043b\u0435\u0435 \u043d\u0430 \u043a\u043e\u043d\u0432\u0435\u0439\u0435\u0440 ETL \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u043d\u043e \u044d\u0442\u043e \u0443\u0436\u0435 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u0440\u0430\u043c\u043a\u0438 \u0442\u0435\u043c\u044b \u0441\u0442\u0430\u0442\u044c\u0438. \u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u0442\u043e \u0441 \u0440\u0430\u0434\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0443 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c ETL \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438 \u0438\u0445 \u0447\u0430\u0441\u0442\u0438 \u0434\u043b\u044f Apache Airflow.\n<\/p>\n<p>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/495676\/\">habr.com<\/a> <\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u041a\u0430\u043a \u0431\u044b \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0435 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438, \u0437\u0430 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435\u043c \u0432\u0441\u0435\u0433\u0434\u0430 \u0442\u044f\u043d\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u0435\u043d\u0438\u0446\u0430 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0431\u0443\u0441\u043b\u043e\u0432\u043b\u0435\u043d\u043e \u043f\u043b\u0430\u0432\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u043c, \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u0438\u043c \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c, \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u0438\u043b\u0438 \u0447\u0435\u043c-\u0442\u043e \u0434\u0440\u0443\u0433\u0438\u043c. \u0412 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0432 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041a\u0430\u043a \u0431\u044b \u043c\u044b \u043d\u0435 \u043c\u0435\u0447\u0442\u0430\u043b\u0438 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f, \u043d\u043e \u043f\u043e\u043a\u0430 \u0447\u0430\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u0432 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440\u0430\u0445 \u0438 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u044b\u0445 [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":77003,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-77002","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u041a\u0430\u043a \u0431\u044b \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0435 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438, \u0437\u0430 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435\u043c \u0432\u0441\u0435\u0433\u0434\u0430 \u0442\u044f\u043d\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u0435\u043d\u0438\u0446\u0430 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0431\u0443\u0441\u043b\u043e\u0432\u043b\u0435\u043d\u043e \u043f\u043b\u0430\u0432\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u043c, \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u0438\u043c \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c, \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u0438\u043b\u0438 \u0447\u0435\u043c-\u0442\u043e \u0434\u0440\u0443\u0433\u0438\u043c. \u0412 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0432 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041a\u0430\u043a \u0431\u044b \u043c\u044b \u043d\u0435 \u043c\u0435\u0447\u0442\u0430\u043b\u0438 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f, \u043d\u043e \u043f\u043e\u043a\u0430 \u0447\u0430\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u0432 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440\u0430\u0445 \u0438 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u044b\u0445\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/et\/blog\/administrirovanie\/etl-proczess-polucheniya-dannyh-iz-elektronnoj-pochty-v-apache-airflow\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"et_EE\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47ETL \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u044b \u0432 Apache Airflow | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u041a\u0430\u043a \u0431\u044b \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0435 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438, \u0437\u0430 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435\u043c \u0432\u0441\u0435\u0433\u0434\u0430 \u0442\u044f\u043d\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u0435\u043d\u0438\u0446\u0430 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0431\u0443\u0441\u043b\u043e\u0432\u043b\u0435\u043d\u043e \u043f\u043b\u0430\u0432\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u043c, \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u0438\u043c \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c, \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u0438\u043b\u0438 \u0447\u0435\u043c-\u0442\u043e \u0434\u0440\u0443\u0433\u0438\u043c. \u0412 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0432 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041a\u0430\u043a \u0431\u044b \u043c\u044b \u043d\u0435 \u043c\u0435\u0447\u0442\u0430\u043b\u0438 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f, \u043d\u043e \u043f\u043e\u043a\u0430 \u0447\u0430\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u0432 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440\u0430\u0445 \u0438 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u044b\u0445\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/et\/blog\/administrirovanie\/etl-proczess-polucheniya-dannyh-iz-elektronnoj-pochty-v-apache-airflow\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2020-04-06T23:42:46+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-04-06T23:42:46+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47ETL protsess andmete hankimiseks e-postist Apache Airflow'is | ProHoster","description":"Kuigi tehnoloogia areneb pidevalt, on alati olemas rida vananenud l\u00e4henemisviise. See v\u00f5ib olla tingitud sujuvast \u00fcleminekust, inimfaktorist, tehnoloogilistest vajadustest v\u00f5i millestki muust. Andmete t\u00f6\u00f6tlemise valdkonnas on just andmeallikad k\u00f5ige silmatorkavamad. Kuigi me ei soovi sellest loobuda, saadetakse osa andmeid ikkagi messengeri ja e-posti teel.","canonical_url":"https:\/\/prohoster.info\/et\/blog\/administrirovanie\/etl-proczess-polucheniya-dannyh-iz-elektronnoj-pochty-v-apache-airflow","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"et_EE","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47ETL \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u044b \u0432 Apache Airflow | ProHoster","og:description":"\u041a\u0430\u043a \u0431\u044b \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0435 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438, \u0437\u0430 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0435\u043c \u0432\u0441\u0435\u0433\u0434\u0430 \u0442\u044f\u043d\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u0435\u043d\u0438\u0446\u0430 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0431\u0443\u0441\u043b\u043e\u0432\u043b\u0435\u043d\u043e \u043f\u043b\u0430\u0432\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043e\u043c, \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u0438\u043c \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c, \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u0438\u043b\u0438 \u0447\u0435\u043c-\u0442\u043e \u0434\u0440\u0443\u0433\u0438\u043c. \u0412 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0432 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041a\u0430\u043a \u0431\u044b \u043c\u044b \u043d\u0435 \u043c\u0435\u0447\u0442\u0430\u043b\u0438 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f, \u043d\u043e \u043f\u043e\u043a\u0430 \u0447\u0430\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u0432 \u043c\u0435\u0441\u0441\u0435\u043d\u0434\u0436\u0435\u0440\u0430\u0445 \u0438 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u044b\u0445","og:url":"https:\/\/prohoster.info\/et\/blog\/administrirovanie\/etl-proczess-polucheniya-dannyh-iz-elektronnoj-pochty-v-apache-airflow","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2020-04-06T23:42:46+00:00","article:modified_time":"2020-04-06T23:42:46+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"77002","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":null,"breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-02-28 17:25:30","updated":"2022-09-28 23:22:44"},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/et\/wp-json\/wp\/v2\/posts\/77002","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/et\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/et\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/et\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/et\/wp-json\/wp\/v2\/comments?post=77002"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/et\/wp-json\/wp\/v2\/posts\/77002\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/et\/wp-json\/wp\/v2\/media\/77003"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/et\/wp-json\/wp\/v2\/media?parent=77002"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/et\/wp-json\/wp\/v2\/categories?post=77002"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/et\/wp-json\/wp\/v2\/tags?post=77002"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}