{"id":345782,"date":"2023-02-22T21:02:09","date_gmt":"2023-02-22T21:02:09","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=345782"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=345782","title":{"rendered":"<span>\u041a\u0430\u043a \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c MVP \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430 \u0431\u0435\u0437 Docker, Kubernetes \u0438 Airflow<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! <\/p>\n<p>\u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u041c\u0430\u043a\u0441\u0438\u043c \u0428\u0435\u043f\u0442\u044f\u043a\u043e\u0432, \u0438 \u044f \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0441\u044c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432\u043e\u0439 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u043e\u0439 \u0443\u0436\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0447\u0435\u0442\u044b\u0440\u0451\u0445 \u043b\u0435\u0442. \u0422\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0438\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u044b, \u0433\u0434\u0435 (\u043f\u043e\u0447\u0442\u0438) \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0431\u044b\u043b\u043e \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438 \u0434\u043e \u043c\u0435\u043d\u044f, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0441 \u043d\u0443\u043b\u044f. \u0418 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0432\u0430\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u041c\u0412\u041f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0431\u0435\u0437 Docker, Kubernetes \u0438 Airflow, \u0432\u0435\u0434\u044c \u0447\u0430\u0441\u0442\u043e \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438 \u043d\u0435 \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0442 \u0437\u043d\u0430\u043d\u0438\u044f\u043c\u0438 \u044d\u0442\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c. <\/p>\n<p><em>\u0414\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0443\u0436\u043d\u043e \u0431\u0430\u0437\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u043d\u0438\u0435 Python \u0438 SQL.<\/em><\/p>\n<h2>\u0427\u0442\u043e \u0435\u0441\u0442\u044c \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u043a\u0443\u0434\u0430 \u0432\u044b \u043f\u0440\u0438\u0448\u043b\u0438, \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430<\/h2>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u043a\u0443\u0434\u0430 \u0432\u044b \u043f\u0440\u0438\u0448\u043b\u0438, \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0434\u0443\u043a\u0442, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u0431\u043e\u0435\u0432\u043e\u0439 (\u0442\u043e \u0435\u0441\u0442\u044c production) \u0431\u0430\u0437\u0435, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u0432 \u0431\u0430\u0437\u0443-\u0440\u0435\u043f\u043b\u0438\u043a\u0443. \u041f\u0435\u0440\u0432\u043e\u043c\u0443 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0443 \u0432\u044b\u0434\u0430\u0451\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u043e \u0445\u043e\u0434\u0438\u0442\u044c \u0432 \u0440\u0435\u043f\u043b\u0438\u043a\u0443 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442\u0442\u0443\u0434\u0430. \u041d\u043e \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u044e\u0430\u043d\u0441\u043e\u0432: <\/p>\n<ul>\n<li>\n<p>\u041d\u0435\u043b\u044c\u0437\u044f \u043a\u0438\u0434\u0430\u0442\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0442\u044f\u0436\u0435\u043b\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0432\u0435\u0434\u044c \u0438\u0434\u0451\u0442 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u0430\u044f \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u043b\u044c\u0437\u044f \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432\u0435\u0434\u044c \u044d\u0442\u043e \u0440\u0435\u043f\u043b\u0438\u043a\u0430 production-\u0431\u0430\u0437\u044b<\/p>\n<\/li>\n<li>\n<p>\u0427\u0430\u0441\u0442\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u0438\u0442\u044c\u0441\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 \u0434\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043d\u0435 \u0438\u0437 \u0440\u0435\u043f\u043b\u0438\u043a\u0438, \u0430 \u0438\u0437 \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 (\u0434\u0440\u0443\u0433\u0438\u0435 \u0411\u0414, API, etc.)<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0434\u0445\u043e\u0434, \u043a\u043e\u0433\u0434\u0430 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u0435\u043d, \u043d\u043e \u043e\u0442 \u043d\u0435\u0433\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0442\u043e\u0448\u043d\u0438\u0442\u044c \u0443\u0436\u0435 \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u0439 \u043d\u0435\u0434\u0435\u043b\u0435 \u0442\u0430\u043a\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u0441\u0435\u0431\u0435 \u0443\u0434\u043e\u0431\u043d\u0443\u044e \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443. <\/p>\n<h2>\u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0443\u0434\u043e\u0431\u043d\u0430\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430<\/h2>\n<p>\u041f\u043e \u043c\u043e\u0435\u043c\u0443 \u043e\u043f\u044b\u0442\u0443, \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f\u043c:<\/p>\n<ul>\n<li>\n<p>\u0412\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b, \u043b\u0435\u0436\u0430\u0442 \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044e\u0442\u0441\u044f<\/p>\n<\/li>\n<li>\n<p>\u0410\u043d\u0430\u043b\u0438\u0442\u0438\u043a \u0438\u043c\u0435\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a\u043e \u0432\u0441\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u043c, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b, \u0438 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0430 \u043d\u0438\u0445 \u0442\u044f\u0436\u0435\u043b\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b <\/p>\n<\/li>\n<li>\n<p>\u0410\u043d\u0430\u043b\u0438\u0442\u0438\u043a \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0432\u0438\u0442\u0440\u0438\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0432\u044c\u044e\u0445\u0438, etc<\/p>\n<\/li>\n<li>\n<p>\u0410\u043d\u0430\u043b\u0438\u0442\u0438\u043a \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u043d\u043e\u0432\u0443\u044e \u0432\u0438\u0442\u0440\u0438\u043d\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/p>\n<\/li>\n<li>\n<p>\u0410\u043d\u0430\u043b\u0438\u0442\u0438\u043a \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0438 \u0432\u044b\u0434\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a\u043e\u043c\u0430\u043d\u0434\u0435<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/dbc\/00f\/f30\/dbc00ff30e6e0b2baa9eedf7cf0e0c61.png\" alt=\"\u0421\u0445\u0435\u043c\u0430 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b\" title=\"\u0421\u0445\u0435\u043c\u0430 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b\" width=\"1231\" height=\"718\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dbc\/00f\/f30\/dbc00ff30e6e0b2baa9eedf7cf0e0c61.png\"\/><figcaption>\u0421\u0445\u0435\u043c\u0430 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/figcaption><\/figure>\n<p>\u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441 \u043d\u0443\u043b\u044f, \u0434\u0430 \u0435\u0449\u0451 \u0438 \u043a\u043e\u0433\u0434\u0430 \u0442\u044b \u043d\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u0430 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a, \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u043e. \u041d\u043e \u044f \u043f\u043e\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f MVP (<a href=\"https:\/\/habr.com\/ru\/company\/productstar\/blog\/508892\/\" rel=\"noopener noreferrer nofollow\">Minimal Viable Product<\/a>), \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0443\u0441\u0438\u043b\u0438\u0439 \u0438 \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0435\u0433\u043e \u0437\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u043e\u0432. <\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0433\u0430\u0439\u0434\u0435 \u0441\u0444\u043e\u043a\u0443\u0441\u0438\u0440\u0443\u0435\u043c\u0441\u044f \u043d\u0430 \u0447\u0430\u0441\u0442\u0438 \u0441 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0411\u0414 \u0438 \u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0435 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430 \u043a\u043e \u0432\u0441\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u043c. <\/p>\n<h2>\u0413\u0434\u0435 \u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435<\/h2>\n<p>\u0414\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0443\u044e \u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u0411\u0414, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Postgres. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u043a\u0443\u0434\u0430 \u0432\u044b \u043f\u0440\u0438\u0448\u043b\u0438, \u0435\u0441\u0442\u044c \u0440\u0435\u0431\u044f\u0442\u0430, \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0437\u0430 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0432\u0430\u043c \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u0411\u0414 \u0438 \u0432\u044b\u0434\u0430\u0442\u044c \u0432\u0441\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u044b \u0434\u043b\u044f \u043d\u0435\u0451. <\/p>\n<p>\u041d\u043e \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a, \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u0441\u0435\u0431\u0435 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0431\u0430\u0437\u0443: <\/p>\n<ul>\n<li>\n<p>\u0411\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u0431\u0430\u0437\u0443 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u043d\u0430 \u0441\u0432\u043e\u0451\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 (\u0421\u043a\u0430\u0447\u0430\u0442\u044c Postgres-\u043a\u043b\u0438\u0435\u043d\u0442 \u043c\u043e\u0436\u043d\u043e \u0441 <a href=\"https:\/\/www.postgresql.org\/download\/\" rel=\"noopener noreferrer nofollow\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430 PostgreSQL<\/a>)<\/p>\n<\/li>\n<li>\n<p>\u041f\u043b\u0430\u0442\u043d\u043e \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u0411\u0414 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435 (<a href=\"https:\/\/docs.aws.amazon.com\/AmazonRDS\/latest\/UserGuide\/CHAP_GettingStarted.CreatingConnecting.PostgreSQL.html\" rel=\"noopener noreferrer nofollow\">\u0413\u0430\u0439\u0434, \u043a\u0430\u043a \u043f\u043e\u0434\u043d\u044f\u0442\u044c Postgres \u0432 AWS<\/a>)<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0435 \u0431\u0443\u0434\u0443 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0442\u043e\u043c, \u043a\u0430\u043a \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0442\u044c \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u043b\u0443\u0447\u0448\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e \u0442\u043e, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0411\u0414. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/097\/8bb\/3dc\/0978bb3dcb17dd13ce9ec23bc58d0704.png\" alt=\"\u0421\u0445\u0435\u043c\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0411\u0414\" title=\"\u0421\u0445\u0435\u043c\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0411\u0414\" width=\"781\" height=\"536\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/097\/8bb\/3dc\/0978bb3dcb17dd13ce9ec23bc58d0704.png\"\/><figcaption>\u0421\u0445\u0435\u043c\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0411\u0414<\/figcaption><\/figure>\n<p>\u042f \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043b \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0411\u0414 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0445\u0435\u043c, \u0443 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0432\u043e\u044f \u0440\u043e\u043b\u044c: <\/p>\n<ul>\n<li>\n<p>etl \u2014 \u0441\u0445\u0435\u043c\u0430 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u044b\u0440\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>arch \u2014 \u0441\u0445\u0435\u043c\u0430 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0440\u044b\u0445 \u0441\u044b\u0440\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c<\/p>\n<\/li>\n<li>\n<p>public \u2014 \u0441\u0445\u0435\u043c\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430, \u0442\u043e \u0435\u0441\u0442\u044c \u0441\u0445\u0435\u043c\u0430 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0439, \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u043d\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0434\u0438\u0437\u0430\u0439\u043d\u0430 \u043d\u043e\u0432\u044b\u0445 \u0432\u0438\u0442\u0440\u0438\u043d \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/li>\n<li>\n<p>pre_dash \u2014 \u0441\u0445\u0435\u043c\u0430 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0432\u0438\u0442\u0440\u0438\u043d \u0434\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430, \u043d\u043e \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043d\u0435 \u0438\u0437 \u0411\u0414<\/p>\n<\/li>\n<li>\n<p>dash \u2014 \u0441\u0445\u0435\u043c\u0430 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 (\u0442\u043e \u0435\u0441\u0442\u044c \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0432\u0438\u0442\u0440\u0438\u043d \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u0438\u0437 \u0411\u0414)<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043b\u044f \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439, \u043d\u0430\u043c \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f 3 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f: <\/p>\n<ul>\n<li>\n<p>loader \u2014 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0432 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0411\u0414 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 \u0411\u0414<\/p>\n<\/li>\n<li>\n<p>analyst \u2014 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a\u043e \u0432\u0441\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u043c \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u0441\u0445\u0435\u043c\u0435 public<\/p>\n<\/li>\n<li>\n<p>viewer \u2014 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u0441\u0445\u0435\u043c\u0435 DASH \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0433\u043e\u0442\u043e\u0432\u044b\u043c\u0438 \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u043e\u0434 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0445\u0435\u043c, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u0432\u044b\u0434\u0430\u0447\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u0432 \u0432 Postgres: <\/p>\n<pre><code class=\"sql\">-- \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0441\u0445\u0435\u043c\u044b \u0434\u0430\u043d\u043d\u044b\u0445 create schema etl; create schema pre_dash; create schema dash; create schema arch;  -- \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 create role loader login password '*loader_password*'; create role analyst login password '*analyst_password*'; create role viewer login password '*viewer_password*';  -- \u0412\u044b\u0434\u0430\u0451\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u043a \u043d\u0443\u0436\u043d\u044b\u043c \u0441\u0445\u0435\u043c\u0430\u043c \u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c \u0432 \u043d\u0438\u0445  -- \u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043d\u043e\u0433\u043e \u0432\u044b\u0434\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u044b \u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c grant usage, create on schema etl, arch, pre_dash, dash to loader;  grant usage on schema etl, arch, pre_dash, dash to analyst; grant usage, create on schema public to analyst; grant select on all tables in schema etl, arch, pre_dash, dash, public to analyst;   grant usage on schema dash to viewer; grant select on all tables in schema dash to viewer;<\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0411\u0414 \u0433\u043e\u0442\u043e\u0432\u0430 \u043a \u0440\u0430\u0431\u043e\u0442\u0435, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u043d\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0435\u0451 \u0434\u0430\u043d\u043d\u044b\u043c\u0438! <\/p>\n<h2>ETL \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0411\u0414<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438, \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 ETL \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c\u0441\u044f \u0441 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c ETL-\u0441\u0438\u0441\u0442\u0435\u043c\u0430:<\/p>\n<ul>\n<li>\n<p>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0411\u0414<\/p>\n<\/li>\n<li>\n<p>\u0411\u044b\u0441\u0442\u0440\u043e\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0411\u0414<\/p>\n<\/li>\n<li>\n<p>\u0411\u044b\u0441\u0442\u0440\u043e\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 \u0411\u0414<\/p>\n<\/li>\n<li>\n<p>\u0423\u0447\u0451\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430 \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e (\u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0440\u0430\u0437 \u0432 \u0434\u0435\u043d\u044c)<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u0437\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 ETL-\u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0421\u0440\u0430\u0437\u0443 \u0443\u0447\u0442\u0451\u043c \u0442\u043e, \u0447\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437 \u0432 \u0434\u0435\u043d\u044c. <\/p>\n<pre><code class=\"python\">from datetime import date   class TransferData:     \"\"\"     \u041a\u043b\u0430\u0441\u0441, \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0437\u0430 \u0441\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0438\u0445 \u0432 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0411\u0414     \"\"\"     def __init__(self, work_date=date.today()):         self.work_date = work_date<\/code><\/pre>\n<p>\u0412\u0441\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043a\u0430\u043a JSON-\u0444\u0430\u0439\u043b\u044b (\u0434\u0436\u043e\u0431\u044b), \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043a\u043b\u0430\u0441\u0441 <code>TransferData<\/code>. \u0412 \u044d\u0442\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e<\/p>\n<ul>\n<li>\n<p>\u0422\u0438\u043f\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043c\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b (\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0438\u043b\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445)<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438\/\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0435\u0440\u0432\u0443\u044e \u0434\u0436\u043e\u0431\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0433\u043e API <a href=\"https:\/\/api.publicapis.org\/entries\" rel=\"noopener noreferrer nofollow\">https:\/\/api.publicapis.org\/entries<\/a> \u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u043a \u043d\u0430\u043c \u0432 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0431\u0430\u0437\u0443. \u0414\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0432 Python: <\/p>\n<pre><code class=\"python\">load_job = {     # \u0422\u0438\u043f \u0434\u0436\u043e\u0431\u044b     'job_type': 'load',      # \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445     'db_from':'open_api',      # DDL \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435     'ddl': '''create table if not exists etl.open_apis (     api text,     description text,     auth text,     https text,     cors text,     link text,     category text,     load_date date );''',     # \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435.     'product': 'etl.open_apis',     # \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435     'file_name': 'open_apis.txt', }<\/code><\/pre>\n<p>\u0418 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0430\u0448\u0435\u0433\u043e JSON \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0432 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0411\u0414 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442 \u0432 \u043d\u0435\u0451 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0439 \u0411\u0414. <\/p>\n<pre><code class=\"python\"># \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0438\u043c\u043f\u043e\u0440\u0442\u044b \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \u0444\u0430\u0439\u043b\u0430 import psycopg2 import os  # .....  # \u0414\u043e\u0431\u0430\u0432\u0438\u043c 2 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u043a\u043b\u0430\u0441\u0441 TransferData class TransferData:  # .....        def load_data(self, load_job):         \"\"\"         \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u043d\u0430 \u0434\u0438\u0441\u043a.         \u0414\u043e\u043b\u0436\u043d\u0430 \u043f\u043e \u0438\u0442\u043e\u0433\u0443 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c csv-\u0444\u0430\u0439\u043b \u043d\u0430 \u0434\u0438\u0441\u043a\u0435 \u0441 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u043c sep='|', quotechar=\"^\".          :param load_job: \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0434\u0436\u043e\u0431\u044b \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445         \"\"\"         if load_job.get('db_from') == 'open_api':             # \u0421\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u0430\u044f \u0434\u043b\u044f \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u043b\u043e\u0433\u0438\u043a\u0430 \u0441\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445             import requests             import pandas as pd             data = requests.get('https:\/\/api.publicapis.org\/entries').json()             data = pd.DataFrame(data['entries'])             data['work_date'] = self.work_date             data = data.loc[:, ['API', 'Description', 'Auth', 'HTTPS', 'Cors',                                  'Link', 'Category', 'work_date']]             # \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u043b\u044f \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043e\u0448\u0438\u0431\u043e\u043a \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435             data.to_csv(load_job.get('file_name'), index=False,                          sep='|', quotechar=\"^\")      def upload_data(self, load_job):         \"\"\"         \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0434\u0438\u0441\u043a\u0430 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0411\u0414.         \u0414\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0444\u0430\u0439\u043b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 csv \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 DELIMITER '|', QUOTE '^'         ANALYTICS_DB_CONN_STRING - \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f connect-\u0441\u0442\u0440\u043e\u043a\u0430 \u0434\u043b\u044f         \u043d\u0430\u0448\u0435\u0439 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0411\u0414 \u0434\u043b\u044f \u044e\u0437\u0435\u0440\u0430 loader.         \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, postgres:\/\/loader:*loader_password*@localhost:5432\/postgres          :param load_job: \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0434\u0436\u043e\u0431\u044b \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445         \"\"\"         #         with psycopg2.connect(os.environ['ANALYTICS_DB_CONN_STRING']) as conn:             curs = conn.cursor()             file_name = load_job.get('file_name')             with open(file_name, 'r') as f:                 product = load_job.get('product')                 curs.execute(load_job.get('ddl'))                 curs.execute(f'truncate {product};')                 copy_query = f\"\"\"COPY {product} from STDIN with (FORMAT csv, DELIMITER '|', QUOTE '^', HEADER True)\"\"\"                 curs.copy_expert(copy_query, f)                 conn.commit()             os.remove(file_name)<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c 2 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438\u0445 \u0432 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0411\u0414:<\/p>\n<pre><code class=\"python\"># \u0423\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0435\u0441\u044c \u0432 \u043e\u0434\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0441 \u0444\u0430\u0439\u043b\u043e\u043c simple_etl.py # \u0438 \u0447\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u0437 requirements.txt: pip install -r requirements.txt import simple_etl as se  tr = se.TransferData() tr.load_data(load_query) tr.upload_data(load_query)<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 \u0411\u0414. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0430\u043a\u0443\u044e \u0432\u0438\u0442\u0440\u0438\u043d\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u0441\u0435\u0431\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 API \u0432 <a href=\"https:\/\/api.publicapis.org\/entries\" rel=\"noopener noreferrer nofollow\">https:\/\/api.publicapis.org\/entries<\/a> \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c: <\/p>\n<pre><code class=\"python\">process_job = {     'job_type': 'process',     # SQL-\u0437\u0430\u043f\u0440\u043e\u0441, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. load_date \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u0441\u044f \u0432 \u043a\u043e\u0434\u0435:     'query': '''create table if not exists dash.openapi_daily_count (     work_date date,     public_api_count int );  delete from dash.openapi_daily_count where work_date = '{work_date}';  insert into dash.openapi_daily_count(work_date, public_api_count)  select work_date, count(distinct link) public_api_count  from etl.open_apis  where work_date = '{work_date}' group by 1;''',     # \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435. \u041d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439:     'product': 'dash.openapi_daily_count',     # \u0421\u043f\u0438\u0441\u043e\u043a \u0442\u0430\u0431\u043b\u0438\u0446, \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445     'dependencies': ['etl.open_public_apis'], }<\/code><\/pre>\n<p>\u0418 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u0411\u0414: <\/p>\n<pre><code class=\"python\">class TransferData:  # .....      def process_data(self, process_job):         \"\"\"         \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 \u0411\u0414.          :param process_job: \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0434\u0436\u043e\u0431\u044b \u043f\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445.         \"\"\"         with psycopg2.connect(os.environ['ANALYTICS_DB_CONN_STRING']) as conn:             curs = conn.cursor()             curs.execute(process_job.get('query').format(work_date=self.work_date))             conn.commit()<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439: <\/p>\n<pre><code class=\"python\">import simple_etl as se tr = se.TransferData() tr.process_data(process_job)<\/code><\/pre>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e \u0431\u044b\u0441\u0442\u0440\u043e\u043c\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u043d\u043e\u0432\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043d\u043e\u0432\u044b\u0445 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u044b \u0432\u0441\u0435 \u0434\u0436\u043e\u0431\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u044b, \u0432 \u0432\u0438\u0434\u0435 JSON-\u0444\u0430\u0439\u043b\u043e\u0432. <\/p>\n<pre><code class=\"python\">import os import json   os.mkdir('etl_jobs')  with open('etl_jobs\/dash_revenue_daily.json', 'w') as f:     json.dump(process_job, f, indent=4)      with open('etl_jobs\/etl_payments_daily.json', 'w') as f:     json.dump(load_job, f, indent=4)<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0431\u044b\u0441\u0442\u0440\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0432 \u043f\u0430\u043f\u043a\u0443 JSON-\u0444\u0430\u0439\u043b\u044b \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0434\u0436\u043e\u0431\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u0434\u043d\u044f. <\/p>\n<h2>\u0417\u0430\u043f\u0443\u0441\u043a \u0432\u0441\u0435\u0445 \u0434\u0436\u043e\u0431\u043e\u0432 \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0432\u0441\u0435 \u0434\u0436\u043e\u0431\u044b \u0440\u0430\u0437\u043e\u043c, \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/p>\n<pre><code class=\"python\"># ... import json  class TransferData:     # .....     # \u041e\u0431\u043d\u043e\u0432\u0438\u043c __init__ \u043c\u0435\u0442\u043e\u0434:      def __init__(self, work_date=date.today(), jobs_dir='etl_jobs'):         self.work_date = work_date         self.jobs_dir = jobs_dir         self.loaded_dependencies = set()      # .....      def launch_job(self, job):         \"\"\"         \u0424\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0434\u0436\u043e\u0431\u044b \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0438\u0445 \u0442\u0438\u043f\u0430          :param job: \u0414\u0436\u043e\u0431\u0430 \u043f\u043e \u0441\u0431\u043e\u0440\u0443 \u0438\u043b\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445         \"\"\"         job_type = job.get('job_type')         if job_type == 'load':             self.load_data(job)             self.upload_data(job)         elif job_type == 'process':             self.process_data(job)         else:             print('Unknown job type for job', job)      def launch_all_jobs(self):         \"\"\"         \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0432\u0441\u0435 \u0434\u0436\u043e\u0431\u044b \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u043d\u0438\u0445         \"\"\"         # \u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0432\u0441\u0435 \u0434\u0436\u043e\u0431\u044b \u0432 \u043f\u0430\u043c\u044f\u0442\u044c         job_paths = os.listdir(self.jobs_dir)         jobs = {}         for job_path in job_paths:             with open(os.path.join(self.jobs_dir, job_path), 'r') as f:                 jobs[job_path] = json.load(f)         # \u0418\u0442\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u0441\u044f \u043f\u043e \u0434\u0436\u043e\u0431\u0430\u043c, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044f, \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b \u043b\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043d\u0438\u0445.         # \u041e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e, \u0435\u0441\u043b\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0435 \u043d\u0430\u0439\u0434\u0443\u0442\u0441\u044f, \u0446\u0438\u043a\u043b \u0431\u0443\u0434\u0435\u0442 \u0432\u0435\u0447\u043d\u044b\u043c         while True:             jobs_local = jobs.copy() # \u0414\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u043e \u043d\u0435\u043c\u0443             for job_name, job in jobs_local.items():                 job_dependencies = job.get('dependencies')                 if job_dependencies is None or len(set(job_dependencies) - self.loaded_dependencies) == 0:                     print(f'Started {job_name}')                     self.launch_job(job)                     product = job.get('product')                     if product is not None:                         self.loaded_dependencies.add(product)                     jobs.pop(job_name)                     print(f'Finished {job_name}')             if len(jobs) == 0:                 break         print('All jobs processed')<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432\u0441\u0435 \u0434\u0436\u043e\u0431\u044b, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0435\u0441\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 <code>etl_jobs<\/code> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b: <\/p>\n<pre><code class=\"python\">import simple_etl as se tr = se.TransferData() tr.launch_all_jobs()<\/code><\/pre>\n<h2>\u0420\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u0441\u0431\u043e\u0440\u0430 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>\u0414\u043b\u044f \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0431\u043e\u0440\u0430 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0444\u0430\u0439\u043b \u0441 \u043a\u043b\u0430\u0441\u0441\u043e\u043c TransferData \u043b\u043e\u0433\u0438\u043a\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445: <\/p>\n<pre><code class=\"python\">if __name__ == '__main__':     \"\"\"     \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0440\u0430\u0437 \u0432 \u0434\u0435\u043d\u044c \u0432 10.00     \"\"\"     import schedule     import time      def scheduled_update():         tr = TransferData(jobs_dir='path_to_jobs_dir\/')         tr.launch_all_jobs()      schedule.every().day.at(\"10:00\").do(scheduled_update)      while True:         schedule.run_pending()         time.sleep(60)<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0430 \u0441\u0432\u043e\u0451\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 (\u0438\u043b\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u0435\u0433\u043e \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u0434\u0430\u0442\u044c \u0432\u0430\u0448\u0438 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0449\u0438\u043a\u0438) \u0432 \u0444\u043e\u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u043a \u0444\u0430\u0439\u043b\u0430 \u0438 \u043d\u0430\u0441\u043b\u0430\u0436\u0434\u0430\u0442\u044c\u0441\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0451\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 \u0411\u0414 \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c: <\/p>\n<h2>\u041a\u0430\u043a \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0441\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043d\u043e\u0432\u043e\u0433\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430<\/h2>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043d\u043e\u0432\u043e\u0433\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u043c\u043e\u0436\u043d\u043e, \u0435\u0441\u043b\u0438 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>load_data<\/code> \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0432 if c \u043d\u043e\u0432\u044b\u043c <code>db_from<\/code>. \u0422\u0443\u0442 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0441\u0431\u043e\u0440\u0430 \u0438\u0437 \u043b\u044e\u0431\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432: \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, API, \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b, \u043e\u043d\u043b\u0430\u0439\u043d-\u0442\u0430\u0431\u043b\u0438\u0446\u044b&#8230; <\/p>\n<p>\u0422\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0441\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">    def load_data(self, load_job):         # .....         if load_job.get('db_from') == 'open_api':             # .....          elif load_job.get('db_from') == 'other_db_type':             # DO SOME HERE AND SAVE FILE TO load_job.get('file_name')             return<\/code><\/pre>\n<p><a href=\"https:\/\/github.com\/MaxSheptyakov\/simple-etl\" rel=\"noopener noreferrer nofollow\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0441 \u043f\u043e\u043b\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c simple_etl.<\/a><\/p>\n<h2>\u0412\u043e\u0442 \u0438 \u0432\u0441\u0451<\/h2>\n<p>\u041f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u044e, \u0432\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 MVP \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b! \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c: <\/p>\n<ul>\n<li>\n<p>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0411\u0414<\/p>\n<\/li>\n<li>\n<p>\u041b\u0451\u0433\u043a\u043e\u0435 \u0438 \u0431\u044b\u0441\u0442\u0440\u043e\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 (\u0438\u043b\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0438\u043c\u0435\u044e\u0449\u0438\u0445\u0441\u044f) \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443<\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043a \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c\u044b\u043c \u0434\u0430\u043d\u043d\u044b\u043c<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0430\u043f\u043e\u043b\u043d\u044f\u0439\u0442\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u0443\u0434\u043e\u0431\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0439\u0442\u0435 \u0441 \u043d\u0438\u043c\u0438 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0411\u0414! <br \/>\u0414\u0430\u043b\u044c\u0448\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c\u044b\u0435 \u0434\u044d\u0448\u0431\u043e\u0440\u0434\u044b \u0432 \u043b\u044e\u0431\u043e\u0439 \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 Metabase (\u0435\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u043a\u0430\u043a \u0435\u0451 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c, \u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438). <\/p>\n<h2>\u041f\u043e\u0441\u043b\u0435\u0441\u043b\u043e\u0432\u0438\u0435<\/h2>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u044d\u0442\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u2014 \u044d\u0442\u043e \u043b\u0438\u0448\u044c \u043d\u0430\u0447\u0430\u043b\u043e, \u0435\u0451 \u043c\u043e\u0436\u043d\u043e \u0438 \u043d\u0443\u0436\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0430\u0442\u044c \u0438 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c: \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043e\u0448\u0438\u0431\u043e\u043a, \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b, \u0443\u043b\u0443\u0447\u0448\u0430\u0442\u044c \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u044c&#8230; \u0412\u043e\u043e\u0431\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u043e\u0431\u044b\u0447\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u041d\u043e \u044d\u0442\u043e \u0443\u0436\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0434\u0440\u0443\u0433\u0430\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f! <\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/718670\/\"> https:\/\/habr.com\/ru\/post\/718670\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! <\/p>\n<p>\u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u041c\u0430\u043a\u0441\u0438\u043c \u0428\u0435\u043f\u0442\u044f\u043a\u043e\u0432, \u0438 \u044f \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0441\u044c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432\u043e\u0439 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u043e\u0439 \u0443\u0436\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0447\u0435\u0442\u044b\u0440\u0451\u0445 \u043b\u0435\u0442. \u0422\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0438\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u044b, \u0433\u0434\u0435 (\u043f\u043e\u0447\u0442\u0438) \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0431\u044b\u043b\u043e \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438 \u0434\u043e \u043c\u0435\u043d\u044f, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0441 \u043d\u0443\u043b\u044f. \u0418 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0432\u0430\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u041c\u0412\u041f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0431\u0435\u0437 Docker, Kubernetes \u0438 Airflow, \u0432\u0435\u0434\u044c \u0447\u0430\u0441\u0442\u043e \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438 \u043d\u0435 \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0442 \u0437\u043d\u0430\u043d\u0438\u044f\u043c\u0438 \u044d\u0442\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c. <\/p>\n<p><em>\u0414\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0443\u0436\u043d\u043e \u0431\u0430\u0437\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u043d\u0438\u0435 Python \u0438 SQL.<\/em><\/p>\n<h2>\u0427\u0442\u043e \u0435\u0441\u0442\u044c \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u043a\u0443\u0434\u0430 \u0432\u044b \u043f\u0440\u0438\u0448\u043b\u0438, \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430<\/h2>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u043a\u0443\u0434\u0430 \u0432\u044b \u043f\u0440\u0438\u0448\u043b\u0438, \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0434\u0443\u043a\u0442, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u0431\u043e\u0435\u0432\u043e\u0439 (\u0442\u043e \u0435\u0441\u0442\u044c production) \u0431\u0430\u0437\u0435, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u0432 \u0431\u0430\u0437\u0443-\u0440\u0435\u043f\u043b\u0438\u043a\u0443. \u041f\u0435\u0440\u0432\u043e\u043c\u0443 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0443 \u0432\u044b\u0434\u0430\u0451\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u043e \u0445\u043e\u0434\u0438\u0442\u044c \u0432 \u0440\u0435\u043f\u043b\u0438\u043a\u0443 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0442\u0442\u0443\u0434\u0430. \u041d\u043e \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u044e\u0430\u043d\u0441\u043e\u0432: <\/p>\n<ul>\n<li>\n<p>\u041d\u0435\u043b\u044c\u0437\u044f \u043a\u0438\u0434\u0430\u0442\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0442\u044f\u0436\u0435\u043b\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0432\u0435\u0434\u044c \u0438\u0434\u0451\u0442 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u0430\u044f \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u044f<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u043b\u044c\u0437\u044f \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432\u0435\u0434\u044c \u044d\u0442\u043e \u0440\u0435\u043f\u043b\u0438\u043a\u0430 production-\u0431\u0430\u0437\u044b<\/p>\n<\/li>\n<li>\n<p>\u0427\u0430\u0441\u0442\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u0438\u0442\u044c\u0441\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 \u0434\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043d\u0435 \u0438\u0437 \u0440\u0435\u043f\u043b\u0438\u043a\u0438, \u0430 \u0438\u0437 \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 (\u0434\u0440\u0443\u0433\u0438\u0435 \u0411\u0414, API, etc.)<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0434\u0445\u043e\u0434, \u043a\u043e\u0433\u0434\u0430 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u0435\u043d, \u043d\u043e \u043e\u0442 \u043d\u0435\u0433\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0442\u043e\u0448\u043d\u0438\u0442\u044c \u0443\u0436\u0435 \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u0439 \u043d\u0435\u0434\u0435\u043b\u0435 \u0442\u0430\u043a\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u0441\u0435\u0431\u0435 \u0443\u0434\u043e\u0431\u043d\u0443\u044e \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443. <\/p>\n<h2>\u041a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0443\u0434\u043e\u0431\u043d\u0430\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430<\/h2>\n<p>\u041f\u043e \u043c\u043e\u0435\u043c\u0443 \u043e\u043f\u044b\u0442\u0443, \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f\u043c:<\/p>\n<ul>\n<li>\n<p>\u0412\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b, \u043b\u0435\u0436\u0430\u0442 \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044e\u0442\u0441\u044f<\/p>\n<\/li>\n<li>\n<p>\u0410\u043d\u0430\u043b\u0438\u0442\u0438\u043a \u0438\u043c\u0435\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a\u043e \u0432\u0441\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u043c, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b, \u0438 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0430 \u043d\u0438\u0445 \u0442\u044f\u0436\u0435\u043b\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b <\/p>\n<\/li>\n<li>\n<p>\u0410\u043d\u0430\u043b\u0438\u0442\u0438\u043a \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0432\u0438\u0442\u0440\u0438\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0432\u044c\u044e\u0445\u0438, etc<\/p>\n<\/li>\n<li>\n<p>\u0410\u043d\u0430\u043b\u0438\u0442\u0438\u043a \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u043d\u043e\u0432\u0443\u044e \u0432\u0438\u0442\u0440\u0438\u043d\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/p>\n<\/li>\n<li>\n<p>\u0410\u043d\u0430\u043b\u0438\u0442\u0438\u043a \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0438 \u0432\u044b\u0434\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a\u043e\u043c\u0430\u043d\u0434\u0435<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><figcaption>\u0421\u0445\u0435\u043c\u0430 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b<\/figcaption><\/figure>\n<p>\u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441 \u043d\u0443\u043b\u044f, \u0434\u0430 \u0435\u0449\u0451 \u0438 \u043a\u043e\u0433\u0434\u0430 \u0442\u044b \u043d\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u0430 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a, \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u043e. \u041d\u043e \u044f \u043f\u043e\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f MVP (<a href=\"https:\/\/habr.com\/ru\/company\/productstar\/blog\/508892\/\" rel=\"noopener noreferrer nofollow\">Minimal Viable Product<\/a>), \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0443\u0441\u0438\u043b\u0438\u0439 \u0438 \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0435\u0433\u043e \u0437\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u043e\u0432. <\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0433\u0430\u0439\u0434\u0435 \u0441\u0444\u043e\u043a\u0443\u0441\u0438\u0440\u0443\u0435\u043c\u0441\u044f \u043d\u0430 \u0447\u0430\u0441\u0442\u0438 \u0441 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0411\u0414 \u0438 \u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0435 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430 \u043a\u043e \u0432\u0441\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u043c. <\/p>\n<h2>\u0413\u0434\u0435 \u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435<\/h2>\n<p>\u0414\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0443\u044e \u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u0411\u0414, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Postgres. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438, \u043a\u0443\u0434\u0430 \u0432\u044b \u043f\u0440\u0438\u0448\u043b\u0438, \u0435\u0441\u0442\u044c \u0440\u0435\u0431\u044f\u0442\u0430, \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0437\u0430 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0432\u0430\u043c \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u0411\u0414 \u0438 \u0432\u044b\u0434\u0430\u0442\u044c \u0432\u0441\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u044b \u0434\u043b\u044f \u043d\u0435\u0451. <\/p>\n<p>\u041d\u043e \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a, \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u0441\u0435\u0431\u0435 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0431\u0430\u0437\u0443: <\/p>\n<ul>\n<li>\n<p>\u0411\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u0431\u0430\u0437\u0443 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u043d\u0430 \u0441\u0432\u043e\u0451\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 (\u0421\u043a\u0430\u0447\u0430\u0442\u044c Postgres-\u043a\u043b\u0438\u0435\u043d\u0442 \u043c\u043e\u0436\u043d\u043e \u0441 <a href=\"https:\/\/www.postgresql.org\/download\/\" rel=\"noopener noreferrer nofollow\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430 PostgreSQL<\/a>)<\/p>\n<\/li>\n<li>\n<p>\u041f\u043b\u0430\u0442\u043d\u043e \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u0411\u0414 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435 (<a href=\"https:\/\/docs.aws.amazon.com\/AmazonRDS\/latest\/UserGuide\/CHAP_GettingStarted.CreatingConnecting.PostgreSQL.html\" rel=\"noopener noreferrer nofollow\">\u0413\u0430\u0439\u0434, \u043a\u0430\u043a \u043f\u043e\u0434\u043d\u044f\u0442\u044c Postgres \u0432 AWS<\/a>)<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0435 \u0431\u0443\u0434\u0443 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0442\u043e\u043c, \u043a\u0430\u043a \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0442\u044c \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u043b\u0443\u0447\u0448\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e \u0442\u043e, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0411\u0414. <\/p>\n<figure class=\"full-width\"><figcaption>\u0421\u0445\u0435\u043c\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0411\u0414<\/figcaption><\/figure>\n<p>\u042f \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043b \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0411\u0414 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0445\u0435\u043c, \u0443 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0432\u043e\u044f \u0440\u043e\u043b\u044c: <\/p>\n<ul>\n<li>\n<p>etl \u2014 \u0441\u0445\u0435\u043c\u0430 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u044b\u0440\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>arch \u2014 \u0441\u0445\u0435\u043c\u0430 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0440\u044b\u0445 \u0441\u044b\u0440\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c<\/p>\n<\/li>\n<li>\n<p>public \u2014 \u0441\u0445\u0435\u043c\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430, \u0442\u043e \u0435\u0441\u0442\u044c \u0441\u0445\u0435\u043c\u0430 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0439, \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u043d\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0434\u0438\u0437\u0430\u0439\u043d\u0430 \u043d\u043e\u0432\u044b\u0445 \u0432\u0438\u0442\u0440\u0438\u043d \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/li>\n<li>\n<p>pre_dash \u2014 \u0441\u0445\u0435\u043c\u0430 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0432\u0438\u0442\u0440\u0438\u043d \u0434\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430, \u043d\u043e \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043d\u0435 \u0438\u0437 \u0411\u0414<\/p>\n<\/li>\n<li>\n<p>dash \u2014 \u0441\u0445\u0435\u043c\u0430 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 (\u0442\u043e \u0435\u0441\u0442\u044c \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0432\u0438\u0442\u0440\u0438\u043d \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u0438\u0437 \u0411\u0414)<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043b\u044f \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439, \u043d\u0430\u043c \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f 3 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f: <\/p>\n<ul>\n<li>\n<p>loader \u2014 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0432 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0411\u0414 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 \u0411\u0414<\/p>\n<\/li>\n<li>\n<p>analyst \u2014 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a\u043e \u0432\u0441\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u043c \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u0441\u0445\u0435\u043c\u0435 public<\/p>\n<\/li>\n<li>\n<p>viewer \u2014 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u0441\u0445\u0435\u043c\u0435 DASH \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0433\u043e\u0442\u043e\u0432\u044b\u043c\u0438 \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u043e\u0434 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0445\u0435\u043c, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u0432\u044b\u0434\u0430\u0447\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u0432 \u0432 Postgres: <\/p>\n<pre><code class=\"sql\">-- \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0441\u0445\u0435\u043c\u044b \u0434\u0430\u043d\u043d\u044b\u0445 create schema etl; create schema pre_dash; create schema dash; create schema arch;  -- \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 create role loader login password '*loader_password*'; create role analyst login password '*analyst_password*'; create role viewer login password '*viewer_password*';  -- \u0412\u044b\u0434\u0430\u0451\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u043a \u043d\u0443\u0436\u043d\u044b\u043c \u0441\u0445\u0435\u043c\u0430\u043c \u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c \u0432 \u043d\u0438\u0445  -- \u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043d\u043e\u0433\u043e \u0432\u044b\u0434\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u044b \u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c grant usage, create on schema etl, arch, pre_dash, dash to loader;  grant usage on schema etl, arch, pre_dash, dash to analyst; grant usage, create on schema public to analyst; grant select on all tables in schema etl, arch, pre_dash, dash, public to analyst;   grant usage on schema dash to viewer; grant select on all tables in schema dash to viewer;<\/code><\/pre>\n<p>\u0410\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0411\u0414 \u0433\u043e\u0442\u043e\u0432\u0430 \u043a \u0440\u0430\u0431\u043e\u0442\u0435, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u043d\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0435\u0451 \u0434\u0430\u043d\u043d\u044b\u043c\u0438! <\/p>\n<h2>ETL \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0411\u0414<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438, \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 ETL \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c\u0441\u044f \u0441 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c ETL-\u0441\u0438\u0441\u0442\u0435\u043c\u0430:<\/p>\n<ul>\n<li>\n<p>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0411\u0414<\/p>\n<\/li>\n<li>\n<p>\u0411\u044b\u0441\u0442\u0440\u043e\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0411\u0414<\/p>\n<\/li>\n<li>\n<p>\u0411\u044b\u0441\u0442\u0440\u043e\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 \u0411\u0414<\/p>\n<\/li>\n<li>\n<p>\u0423\u0447\u0451\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430 \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e (\u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0440\u0430\u0437 \u0432 \u0434\u0435\u043d\u044c)<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u0437\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 ETL-\u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0421\u0440\u0430\u0437\u0443 \u0443\u0447\u0442\u0451\u043c \u0442\u043e, \u0447\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437 \u0432 \u0434\u0435\u043d\u044c. <\/p>\n<pre><code class=\"python\">from datetime import date   class TransferData:     \"\"\"     \u041a\u043b\u0430\u0441\u0441, \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0437\u0430 \u0441\u0431\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0438\u0445 \u0432 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0411\u0414     \"\"\"     def __init__(self, work_date=date.today()):         self.work_date = work_date<\/code><\/pre>\n<p>\u0412\u0441\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043a\u0430\u043a JSON-\u0444\u0430\u0439\u043b\u044b (\u0434\u0436\u043e\u0431\u044b), \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043a\u043b\u0430\u0441\u0441 <code>TransferData<\/code>. \u0412 \u044d\u0442\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e<\/p>\n<ul>\n<li>\n<p>\u0422\u0438\u043f\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043c\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b (\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0438\u043b\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445)<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438\/\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0435\u0440\u0432\u0443\u044e \u0434\u0436\u043e\u0431\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0433\u043e API <a href=\"https:\/\/api.publicapis.org\/entries\" rel=\"noopener noreferrer nofollow\">https:\/\/api.publicapis.org\/entries<\/a> \u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u043a \u043d\u0430\u043c \u0432 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0431\u0430\u0437\u0443. \u0414\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0432 Python: <\/p>\n<pre><code class=\"python\">load_job = {     # \u0422\u0438\u043f \u0434\u0436\u043e\u0431\u044b     'job_type': 'load',      # \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445     'db_from':'open_api',      # DDL \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435     'ddl': '''create table if not exists etl.open_apis (     api text,     description text,     auth text,     https text,     cors text,     link text,     category text,     load_date date );''',     # \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435.     'product': 'etl.open_apis',     # \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435     'file_name': 'open_apis.txt', }<\/code><\/pre>\n<p>\u0418 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0430\u0448\u0435\u0433\u043e JSON \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0432 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0411\u0414 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442 \u0432 \u043d\u0435\u0451 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0439 \u0411\u0414. <\/p>\n<pre><code class=\"python\"># \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0438\u043c\u043f\u043e\u0440\u0442\u044b \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \u0444\u0430\u0439\u043b\u0430 import psycopg2 import os  # .....  # \u0414\u043e\u0431\u0430\u0432\u0438\u043c 2 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u043a\u043b\u0430\u0441\u0441 TransferData class TransferData:  # .....        def load_data(self, load_job):         \"\"\"         \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u043d\u0430 \u0434\u0438\u0441\u043a.         \u0414\u043e\u043b\u0436\u043d\u0430 \u043f\u043e \u0438\u0442\u043e\u0433\u0443 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c csv-\u0444\u0430\u0439\u043b \u043d\u0430 \u0434\u0438\u0441\u043a\u0435 \u0441 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u043c sep='|', quotechar=\"^\".          :param load_job: \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0434\u0436\u043e\u0431\u044b \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445         \"\"\"         if load_job.get('db_from') == 'open_api':             # \u0421\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u0430\u044f \u0434\u043b\u044f \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u043b\u043e\u0433\u0438\u043a\u0430 \u0441\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445             import requests             import pandas as pd             data = requests.get('https:\/\/api.publicapis.org\/entries').json()             data = pd.DataFrame(data['entries'])             data['work_date'] = self.work_date             data = data.loc[:, ['API', 'Description', 'Auth', 'HTTPS', 'Cors',                                  'Link', 'Category', 'work_date']]             # \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u043b\u044f \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043e\u0448\u0438\u0431\u043e\u043a \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435             data.to_csv(load_job.get('file_name'), index=False,                          sep='|', quotechar=\"^\")      def upload_data(self, load_job):         \"\"\"         \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0434\u0438\u0441\u043a\u0430 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0411\u0414.         \u0414\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0444\u0430\u0439\u043b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 csv \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 DELIMITER '|', QUOTE '^'         ANALYTICS_DB_CONN_STRING - \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f connect-\u0441\u0442\u0440\u043e\u043a\u0430 \u0434\u043b\u044f         \u043d\u0430\u0448\u0435\u0439 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0411\u0414 \u0434\u043b\u044f \u044e\u0437\u0435\u0440\u0430 loader.         \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, postgres:\/\/loader:*loader_password*@localhost:5432\/postgres          :param load_job: \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u0434\u0436\u043e\u0431\u044b \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445         \"\"\"         #         with psycopg2.connect(os.environ['ANALYTICS_DB_CONN_STRING']) as conn:             curs = conn.cursor()             file_name = load_job.get('file_name')             with open(file_name, 'r') as f:                 product = load_job.get('product')                 curs.execute(load_job.get('ddl'))                 curs.execute(f'truncate {product};')                 copy_query = f\"\"\"COPY {product} from STDIN with (FORMAT csv, DELIMITER '|', QUOTE '^', HEADER True)\"\"\"                 curs.copy_expert(copy_query, f)                 conn.commit()             os.remove(file_name)<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c 2 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438\u0445 \u0432 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0411\u0414:<\/p>\n<pre><code class=\"python\"># \u0423\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0435\u0441\u044c \u0432 \u043e\u0434\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0441 \u0444\u0430\u0439\u043b\u043e\u043c simple_etl.py # \u0438 \u0447\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u0437 requirements.txt: pip install -r requirements.txt import simple_etl as se  tr = se.TransferData() tr.load_data(load_query) tr.upload_data(load_query)<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 \u0411\u0414. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0430\u043a\u0443\u044e \u0432\u0438\u0442\u0440\u0438\u043d\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u0441\u0435\u0431\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 API \u0432 <a href=\"https:\/\/api.publicapis.org\/entries\" rel=\"noopener noreferrer nofollow\">https:\/\/api.publicapis.org\/entries<\/a> \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c: <\/p>\n<pre><code class=\"python\">process_job = {     <\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-345782","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/345782","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=345782"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/345782\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=345782"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=345782"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=345782"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}