customeranalytics 0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- customeranalytics/__init__.py +319 -0
- customeranalytics/configs.py +480 -0
- customeranalytics/data_storage_configurations/__init__.py +245 -0
- customeranalytics/data_storage_configurations/data_access.py +165 -0
- customeranalytics/data_storage_configurations/data_works_pipeline.py +207 -0
- customeranalytics/data_storage_configurations/es_create_index.py +544 -0
- customeranalytics/data_storage_configurations/logger.py +36 -0
- customeranalytics/data_storage_configurations/query_es.py +157 -0
- customeranalytics/data_storage_configurations/reports.py +684 -0
- customeranalytics/data_storage_configurations/schedule_data_integration.py +355 -0
- customeranalytics/docs/queries.yaml +245 -0
- customeranalytics/docs/web_configs.yaml +2 -0
- customeranalytics/exploratory_analysis/__init__.py +109 -0
- customeranalytics/exploratory_analysis/churn.py +232 -0
- customeranalytics/exploratory_analysis/cohorts.py +535 -0
- customeranalytics/exploratory_analysis/descriptive_statistics.py +470 -0
- customeranalytics/exploratory_analysis/funnels.py +407 -0
- customeranalytics/exploratory_analysis/product_analytics.py +340 -0
- customeranalytics/exploratory_analysis/promotion_analytics.py +299 -0
- customeranalytics/exploratory_analysis/rfm.py +202 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_avg_order_count_per_promo_per_cust.csv +99 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_chart_1_search.csv +2 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_chart_2_search.csv +46 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_chart_3_search.csv +2 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_chart_4_search.csv +2 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_churn.csv +2 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_churn_weekly.csv +10 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_client_feature_predicted.csv +1590 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_client_kpis.csv +7060 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_clvrfm_anomaly.csv +561 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_clvsegments_amount.csv +8 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_customer_journey.csv +18 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_daily_clv.csv +103 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_daily_cohort_downloads.csv +68 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_daily_cohort_from_1_to_2.csv +66 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_daily_cohort_from_2_to_3.csv +64 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_daily_cohort_from_3_to_4.csv +55 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_daily_dimension_values.csv +199 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_daily_funnel.csv +36 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_daily_funnel_downloads.csv +68 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_daily_inorganic_ratio.csv +6070 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_daily_orders.csv +57 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_daily_organic_orders.csv +64 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_daily_products_of_sales.csv +12574 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_daily_promotion_discount.csv +64 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_daily_promotion_revenue.csv +6070 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_dcohort_anomaly.csv +6 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_dcohort_anomaly_2.csv +118 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_deliver.csv +47 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_deliver_kpis.csv +2 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_deliver_weekday_hour.csv +25 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_dfunnel_anomaly.csv +118 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_dimension_kpis.csv +199 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_dorders_anomaly.csv +85 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_frequency_clusters.csv +6 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_frequency_recency.csv +3740 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_hourly_funnel.csv +25 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_hourly_funnel_downloads.csv +25 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_hourly_inorganic_ratio.csv +2353 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_hourly_orders.csv +25 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_hourly_organic_orders.csv +2353 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_inorganic_orders_per_promotion_per_day.csv +6070 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_kpis.csv +2 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_monetary_clusters.csv +6 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_monetary_frequency.csv +3740 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_monthly_funnel.csv +5 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_monthly_funnel_downloads.csv +5 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_monthly_orders.csv +4 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_most_combined_products.csv +11 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_most_ordered_categories.csv +11 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_most_ordered_products.csv +11 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_order_and_payment_amount_differences.csv +91 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_prepare.csv +101 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_prepare_weekday_hour.csv +25 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_product_kpis.csv +201 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_product_usage_before_after_amount_accept.csv +11 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_product_usage_before_after_amount_reject.csv +7 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_product_usage_before_after_orders_accept.csv +11 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_product_usage_before_after_orders_reject.csv +11 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_promotion_comparison.csv +91 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_promotion_kpis.csv +99 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_promotion_number_of_customer.csv +99 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_promotion_usage_before_after_amount_accept.csv +81 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_promotion_usage_before_after_amount_reject.csv +11 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_promotion_usage_before_after_orders_accept.csv +55 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_promotion_usage_before_after_orders_reject.csv +37 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_purchase_amount_distribution.csv +22 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_recency_clusters.csv +6 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_recency_monetary.csv +3740 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_rfm.csv +2001 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_ride.csv +101 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_ride_weekday_hour.csv +25 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_segmentation.csv +11 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_segments_change_daily_before_after_amount.csv +10 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_segments_change_daily_before_after_orders.csv +9 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_segments_change_monthly_before_after_amount.csv +10 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_segments_change_monthly_before_after_orders.csv +11 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_segments_change_weekly_before_after_amount.csv +10 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_segments_change_weekly_before_after_orders.csv +10 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_user_counts_per_order_seq.csv +47 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_weekly_average_order_per_user.csv +13 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_weekly_average_payment_amount.csv +13 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_weekly_average_session_per_user.csv +13 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_weekly_cohort_downloads.csv +13 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_weekly_cohort_from_1_to_2.csv +13 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_weekly_cohort_from_2_to_3.csv +13 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_weekly_cohort_from_3_to_4.csv +12 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_weekly_funnel.csv +25 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_weekly_funnel_downloads.csv +25 -0
- customeranalytics/exploratory_analysis/sample_data/sample_data_weekly_orders.csv +10 -0
- customeranalytics/ml_process/__init__.py +64 -0
- customeranalytics/ml_process/ab_test.py +615 -0
- customeranalytics/ml_process/anomaly_detection.py +456 -0
- customeranalytics/ml_process/clv_prediction.py +301 -0
- customeranalytics/ml_process/customer_segmentation.py +354 -0
- customeranalytics/ml_process/delivery_analytics.py +754 -0
- customeranalytics/utils.py +186 -0
- customeranalytics/web/app/__init__.py +37 -0
- customeranalytics/web/app/base/__init__.py +9 -0
- customeranalytics/web/app/base/forms.py +16 -0
- customeranalytics/web/app/base/models.py +43 -0
- customeranalytics/web/app/base/routes.py +126 -0
- customeranalytics/web/app/base/static/assets/css/app.css +20 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-Black.woff +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-Black.woff2 +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-BlackItalic.woff +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-BlackItalic.woff2 +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-Bold.woff +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-Bold.woff2 +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-BoldItalic.woff +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-BoldItalic.woff2 +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-ExtraBold.woff +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-ExtraBold.woff2 +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-ExtraBoldItalic.woff +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-ExtraBoldItalic.woff2 +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-ExtraLight-BETA.woff +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-ExtraLight-BETA.woff2 +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-ExtraLightItalic-BETA.woff +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-ExtraLightItalic-BETA.woff2 +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-Italic.woff +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-Italic.woff2 +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-Light-BETA.woff +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-Light-BETA.woff2 +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-LightItalic-BETA.woff +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-LightItalic-BETA.woff2 +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-Medium.woff +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-Medium.woff2 +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-MediumItalic.woff +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-MediumItalic.woff2 +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-Regular.woff +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-Regular.woff2 +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-SemiBold.woff +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-SemiBold.woff2 +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-SemiBoldItalic.woff +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-SemiBoldItalic.woff2 +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-Thin-BETA.woff +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-Thin-BETA.woff2 +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-ThinItalic-BETA.woff +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-ThinItalic-BETA.woff2 +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-italic.var.woff2 +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter-upright.var.woff2 +0 -0
- customeranalytics/web/app/base/static/assets/fonts/Inter.var.woff2 +0 -0
- customeranalytics/web/app/base/static/assets/fonts/fa-brands-400.eot +0 -0
- customeranalytics/web/app/base/static/assets/fonts/fa-brands-400.svg +3570 -0
- customeranalytics/web/app/base/static/assets/fonts/fa-brands-400.ttf +0 -0
- customeranalytics/web/app/base/static/assets/fonts/fa-brands-400.woff +0 -0
- customeranalytics/web/app/base/static/assets/fonts/fa-brands-400.woff2 +0 -0
- customeranalytics/web/app/base/static/assets/fonts/fa-regular-400.eot +0 -0
- customeranalytics/web/app/base/static/assets/fonts/fa-regular-400.svg +801 -0
- customeranalytics/web/app/base/static/assets/fonts/fa-regular-400.ttf +0 -0
- customeranalytics/web/app/base/static/assets/fonts/fa-regular-400.woff +0 -0
- customeranalytics/web/app/base/static/assets/fonts/fa-regular-400.woff2 +0 -0
- customeranalytics/web/app/base/static/assets/fonts/fa-solid-900.eot +0 -0
- customeranalytics/web/app/base/static/assets/fonts/fa-solid-900.svg +5028 -0
- customeranalytics/web/app/base/static/assets/fonts/fa-solid-900.ttf +0 -0
- customeranalytics/web/app/base/static/assets/fonts/fa-solid-900.woff +0 -0
- customeranalytics/web/app/base/static/assets/fonts/fa-solid-900.woff2 +0 -0
- customeranalytics/web/app/base/static/assets/img/avatars/avatar-1.png +0 -0
- customeranalytics/web/app/base/static/assets/img/avatars/avatar-2.png +0 -0
- customeranalytics/web/app/base/static/assets/img/avatars/avatar-3.png +0 -0
- customeranalytics/web/app/base/static/assets/img/avatars/avatar-4.png +0 -0
- customeranalytics/web/app/base/static/assets/img/avatars/avatar-5.png +0 -0
- customeranalytics/web/app/base/static/assets/img/avatars/info.jpeg +0 -0
- customeranalytics/web/app/base/static/assets/img/icons/customanality.png +0 -0
- customeranalytics/web/app/base/static/assets/img/icons/icon-48x48.png +0 -0
- customeranalytics/web/app/base/static/assets/js/app.js +2 -0
- customeranalytics/web/app/base/static/assets/js/app.js.LICENSE +566 -0
- customeranalytics/web/app/base/static/assets/js/app.js.LICENSE.txt +556 -0
- customeranalytics/web/app/base/static/assets/js/modules/bootstrap.js +15 -0
- customeranalytics/web/app/base/static/assets/js/modules/chartjs.js +4 -0
- customeranalytics/web/app/base/static/assets/js/modules/feather.js +8 -0
- customeranalytics/web/app/base/static/assets/js/modules/flatpickr.js +4 -0
- customeranalytics/web/app/base/static/assets/js/modules/moment.js +4 -0
- customeranalytics/web/app/base/static/assets/js/modules/sidebar.js +23 -0
- customeranalytics/web/app/base/static/assets/js/modules/theme.js +16 -0
- customeranalytics/web/app/base/templates/accounts/login.html +81 -0
- customeranalytics/web/app/base/templates/accounts/register.html +80 -0
- customeranalytics/web/app/base/templates/includes/footer.html +28 -0
- customeranalytics/web/app/base/templates/includes/navigation.html +51 -0
- customeranalytics/web/app/base/templates/includes/scripts.html +3 -0
- customeranalytics/web/app/base/templates/includes/sidebar.html +146 -0
- customeranalytics/web/app/base/templates/layouts/base-fullscreen.html +36 -0
- customeranalytics/web/app/base/templates/layouts/base.html +84 -0
- customeranalytics/web/app/base/util.py +30 -0
- customeranalytics/web/app/home/__init__.py +9 -0
- customeranalytics/web/app/home/forms.py +1039 -0
- customeranalytics/web/app/home/models.py +438 -0
- customeranalytics/web/app/home/profiles.py +310 -0
- customeranalytics/web/app/home/routes.py +386 -0
- customeranalytics/web/app/home/search.py +288 -0
- customeranalytics/web/app/home/static/assets/img/avatars/avatar-1.png +0 -0
- customeranalytics/web/app/home/static/assets/img/avatars/avatar-2.png +0 -0
- customeranalytics/web/app/home/static/assets/img/avatars/avatar-3.png +0 -0
- customeranalytics/web/app/home/static/assets/img/avatars/avatar-4.png +0 -0
- customeranalytics/web/app/home/static/assets/img/avatars/avatar-5.png +0 -0
- customeranalytics/web/app/home/static/assets/img/icons/customanality.png +0 -0
- customeranalytics/web/app/home/static/assets/img/icons/icon-48x48.png +0 -0
- customeranalytics/web/app/home/templates/abtest-product.html +280 -0
- customeranalytics/web/app/home/templates/abtest-promotion.html +362 -0
- customeranalytics/web/app/home/templates/abtest-segments.html +298 -0
- customeranalytics/web/app/home/templates/add-data-delivery.html +184 -0
- customeranalytics/web/app/home/templates/add-data-product.html +177 -0
- customeranalytics/web/app/home/templates/add-data-purchase.html +392 -0
- customeranalytics/web/app/home/templates/anomaly.html +261 -0
- customeranalytics/web/app/home/templates/clv.html +211 -0
- customeranalytics/web/app/home/templates/cohorts.html +308 -0
- customeranalytics/web/app/home/templates/customer-segmentation.html +308 -0
- customeranalytics/web/app/home/templates/data-es.html +152 -0
- customeranalytics/web/app/home/templates/data-execute.html +397 -0
- customeranalytics/web/app/home/templates/delivery.html +404 -0
- customeranalytics/web/app/home/templates/funnel-customer.html +240 -0
- customeranalytics/web/app/home/templates/funnel-session.html +236 -0
- customeranalytics/web/app/home/templates/index.html +524 -0
- customeranalytics/web/app/home/templates/index2.html +515 -0
- customeranalytics/web/app/home/templates/page-403.html +46 -0
- customeranalytics/web/app/home/templates/page-404.html +45 -0
- customeranalytics/web/app/home/templates/page-500.html +45 -0
- customeranalytics/web/app/home/templates/pages-blank.html +33 -0
- customeranalytics/web/app/home/templates/pages-sign-in.html +67 -0
- customeranalytics/web/app/home/templates/pages-sign-up.html +61 -0
- customeranalytics/web/app/home/templates/product.html +203 -0
- customeranalytics/web/app/home/templates/profile.html +1009 -0
- customeranalytics/web/app/home/templates/rfm.html +254 -0
- customeranalytics/web/app/home/templates/search.html +167 -0
- customeranalytics/web/app/home/templates/settings.html +205 -0
- customeranalytics/web/app/home/templates/stats-desc.html +230 -0
- customeranalytics/web/app/home/templates/stats-purchase.html +221 -0
- customeranalytics/web/config.py +30 -0
- customeranalytics/web/db.sqlite3 +0 -0
- customeranalytics/web/run.py +30 -0
- customeranalytics-0.1.dist-info/METADATA +1102 -0
- customeranalytics-0.1.dist-info/RECORD +254 -0
- customeranalytics-0.1.dist-info/WHEEL +4 -0
- customeranalytics-0.1.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
import sys, os, inspect, logging
|
|
2
|
+
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
|
|
3
|
+
parentdir = os.path.dirname(currentdir)
|
|
4
|
+
sys.path.insert(0, parentdir)
|
|
5
|
+
import schedule
|
|
6
|
+
import threading
|
|
7
|
+
import time
|
|
8
|
+
import pandas as pd
|
|
9
|
+
from numpy import unique
|
|
10
|
+
from sqlalchemy import create_engine, MetaData
|
|
11
|
+
from os.path import abspath, join
|
|
12
|
+
from flask_login import current_user
|
|
13
|
+
|
|
14
|
+
try:
|
|
15
|
+
from exploratory_analysis.__init__ import create_exploratory_analysis, create_exploratory_analyse
|
|
16
|
+
except Exception as e:
|
|
17
|
+
from customeranalytics.exploratory_analysis import create_exploratory_analysis, create_exploratory_analyse
|
|
18
|
+
try:
|
|
19
|
+
from ml_process.__init__ import create_ml
|
|
20
|
+
except Exception as e:
|
|
21
|
+
from customeranalytics.ml_process import create_ml
|
|
22
|
+
|
|
23
|
+
from customeranalytics.data_storage_configurations.es_create_index import CreateIndex
|
|
24
|
+
from customeranalytics.data_storage_configurations.query_es import QueryES
|
|
25
|
+
from customeranalytics.data_storage_configurations.data_works_pipeline import DataPipelines
|
|
26
|
+
from customeranalytics.data_storage_configurations.reports import Reports
|
|
27
|
+
from customeranalytics.utils import current_date_to_day, convert_to_day, abspath_for_sample_data, read_yaml
|
|
28
|
+
from customeranalytics.configs import query_path
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
engine = create_engine('sqlite://///' + join(abspath_for_sample_data(), "web", 'db.sqlite3'), connect_args={'check_same_thread': False})
|
|
32
|
+
metadata = MetaData()
|
|
33
|
+
con = engine.connect()
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class Scheduler:
|
|
37
|
+
"""
|
|
38
|
+
It allows us to schedule data storage process, triggering Exploratory Analysis and
|
|
39
|
+
Ml Creation Processes jobs sequentially. this will work on a thread that goes on as a background process.
|
|
40
|
+
Once you have shot down the platform, the thread will be killed. In order to cancel the ongoing process,
|
|
41
|
+
Delete schedule job from web interface from 'Schedule Data Process' page.
|
|
42
|
+
There are 4 options for scheduling;
|
|
43
|
+
- Once; Only once, it collects data store into the orders and downloads indexes,
|
|
44
|
+
Exploratory Analysis and ML Processes Creation.
|
|
45
|
+
- Weekly; every Mondays, fetching data and storing it into the indexes.
|
|
46
|
+
- Daily; daily fetching data and storing it into the indexes.
|
|
47
|
+
|
|
48
|
+
"""
|
|
49
|
+
def __init__(self,
|
|
50
|
+
es_tag,
|
|
51
|
+
data_connection_structure,
|
|
52
|
+
ea_connection_structure,
|
|
53
|
+
ml_connection_structure,
|
|
54
|
+
data_columns,
|
|
55
|
+
actions):
|
|
56
|
+
"""
|
|
57
|
+
Example of data_connection_structure;
|
|
58
|
+
For more details pls check 'create_data_access_parameters', 'get_data_connection_arguments' in __init__.py.
|
|
59
|
+
|
|
60
|
+
data_configs = {'orders': {'data_source': 'postgresql', 'data_query_path': 'select * ...', ...},
|
|
61
|
+
'downloads': {'data_source': 'postgresql', 'data_query_path': 'select * ...', ...},
|
|
62
|
+
'products': {'data_source': 'postgresql', 'data_query_path': 'select * ...', ...}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
Example of ea_connection_structure;
|
|
66
|
+
For more details pls check 'get_ea_and_ml_config' in __init__.py.
|
|
67
|
+
|
|
68
|
+
ea_configs = {"date": None,
|
|
69
|
+
"funnel": {"actions": ["download", "signup"],
|
|
70
|
+
"purchase_actions": ["has_basket", "order_screen"],
|
|
71
|
+
"host": 'localhost',
|
|
72
|
+
"port": '9200',
|
|
73
|
+
'download_index': 'downloads',
|
|
74
|
+
'order_index': 'orders'},
|
|
75
|
+
"cohort": {"has_download": True, "host": 'localhost', "port": '9200'},
|
|
76
|
+
"products": {"has_download": True, "host": 'localhost', "port": '9200'},
|
|
77
|
+
"rfm": {"host": 'localhost', "port": '9200',
|
|
78
|
+
'download_index': 'downloads', 'order_index': 'orders'},
|
|
79
|
+
"stats": {"host": 'localhost', "port": '9200',
|
|
80
|
+
'download_index': 'downloads', 'order_index': 'orders'}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
Example of ea_connection_structure;
|
|
85
|
+
For more details pls check 'get_ea_and_ml_config' in __init__.py.
|
|
86
|
+
|
|
87
|
+
ml_configs = {"date": None,
|
|
88
|
+
"segmentation": {"host": 'localhost', "port": '9200',
|
|
89
|
+
'download_index': 'downloads', 'order_index': 'orders'},
|
|
90
|
+
"clv_prediction": {"temporary_export_path": None,
|
|
91
|
+
"host": 'localhost', "port": '9200',
|
|
92
|
+
'download_index': 'downloads', 'order_index': 'orders'},
|
|
93
|
+
"abtest": {"temporary_export_path": None,
|
|
94
|
+
"host": 'localhost', "port": '9200',
|
|
95
|
+
'download_index': 'downloads', 'order_index': 'orders'}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
Example of data_columns;
|
|
99
|
+
For more details pls check 'get_data_connection_arguments' in __init__.py.
|
|
100
|
+
|
|
101
|
+
|order_id | client | session_start_date | payment_amount | ....| category promotion_id | ...
|
|
102
|
+
--------------------------------------------------------------------------------------------------
|
|
103
|
+
|order_id | client | session_start_date | payment_amount | ....| category promotion_id | ...
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
:param es_tag: elasticsearch tag name that is created on web interface 'ElasticSearch Configuration' page
|
|
108
|
+
:param data_connection_structure: check :data_configs above
|
|
109
|
+
:param ea_connection_structure: check :ea_configs above
|
|
110
|
+
:param ml_connection_structure: check :ml_configs above
|
|
111
|
+
:param data_columns: check :data_columns above
|
|
112
|
+
:param actions: whole actions which are stored into the actions table in sqlite
|
|
113
|
+
"""
|
|
114
|
+
self.es_tag = es_tag
|
|
115
|
+
self.data_connection_structure = data_connection_structure
|
|
116
|
+
self.ea_connection_structure = ea_connection_structure
|
|
117
|
+
self.ml_connection_structure = ml_connection_structure
|
|
118
|
+
self.actions = actions
|
|
119
|
+
self.data_columns = data_columns
|
|
120
|
+
self.es_con = pd.read_sql("select * from es_connection", con).to_dict('records')[-1]
|
|
121
|
+
self.create_index = CreateIndex(data_connection_structure=data_connection_structure,
|
|
122
|
+
data_columns=data_columns, actions=actions)
|
|
123
|
+
self.create_build_in_reports = Reports()
|
|
124
|
+
self.data_pipelines = DataPipelines(es_tag,
|
|
125
|
+
data_connection_structure,
|
|
126
|
+
ea_connection_structure,
|
|
127
|
+
ml_connection_structure,
|
|
128
|
+
data_columns,
|
|
129
|
+
actions)
|
|
130
|
+
self.query_es = QueryES(host=self.es_con['host'], port=self.es_con['port'])
|
|
131
|
+
self.unique_dimensions = []
|
|
132
|
+
self.schedule = True
|
|
133
|
+
self.sqlite_queries = read_yaml(query_path, "queries.yaml")
|
|
134
|
+
self.tables = pd.read_sql(self.sqlite_queries['tables'], con)
|
|
135
|
+
self.separator = lambda dim: [print("*" * 20) for i in range(3)] + [print("*"*10, " "," DIMENSION : ",dim, "*"*10)]
|
|
136
|
+
self.info_logs_for_chat = lambda info: {'user': 'info',
|
|
137
|
+
'date': str(current_date_to_day())[0:19],
|
|
138
|
+
'user_logo': 'info.jpeg',
|
|
139
|
+
'chat_type': 'info', 'chart': '',
|
|
140
|
+
'general_message': info, 'message': ''}
|
|
141
|
+
self.suc_log_for_data_works = lambda x: " {0} is created! Check {0} sections. ".format(
|
|
142
|
+
DATA_WORKS_READABLE_FORM[x])
|
|
143
|
+
self.fail_log_for_data_works = lambda x, e: " {0} is is failed! Check {0} sections. - {1}".format(
|
|
144
|
+
DATA_WORKS_READABLE_FORM[x])
|
|
145
|
+
|
|
146
|
+
def query_schedule_status(self):
|
|
147
|
+
"""
|
|
148
|
+
When the process is scheduled for daily, 'weekly',
|
|
149
|
+
before it starts, checks scheduling is still 'on' or not deleted.
|
|
150
|
+
"""
|
|
151
|
+
return pd.read_sql("SELECT * FROM schedule_data ", con)
|
|
152
|
+
|
|
153
|
+
def collect_dimensions_for_data_works(self):
|
|
154
|
+
"""
|
|
155
|
+
checking if dimensions are created in orders index.
|
|
156
|
+
This will help us to create Exploratory Analysis and ML Works or each dimension include whole data (index='main')
|
|
157
|
+
"""
|
|
158
|
+
_res = self.query_es.es.search(index='orders',
|
|
159
|
+
body={"size": self.query_es.query_size,
|
|
160
|
+
"from": 0,
|
|
161
|
+
'_source': False,
|
|
162
|
+
"fields": ["dimension"]})['hits']['hits']
|
|
163
|
+
_res = [r['fields']['dimension'][0] for r in _res]
|
|
164
|
+
self.unique_dimensions = unique(_res).tolist()
|
|
165
|
+
|
|
166
|
+
def check_for_table_exits(self, table):
|
|
167
|
+
"""
|
|
168
|
+
checking sqlite if table is created before. If it not, table is created.
|
|
169
|
+
:params table: checking table name in sqlite
|
|
170
|
+
"""
|
|
171
|
+
|
|
172
|
+
try:
|
|
173
|
+
if table not in list(self.tables['name']):
|
|
174
|
+
con.execute(self.sqlite_queries[table])
|
|
175
|
+
except Exception as e: print(e)
|
|
176
|
+
|
|
177
|
+
def insert_query(self, table, columns, values):
|
|
178
|
+
"""
|
|
179
|
+
insert sqlite tables with given table column and values
|
|
180
|
+
|
|
181
|
+
:param table: tables to be inserted the row
|
|
182
|
+
:param columns: tables of columns (all columns)
|
|
183
|
+
:param values: values for each column in the table
|
|
184
|
+
"""
|
|
185
|
+
values = [values[col] for col in columns]
|
|
186
|
+
_query = "INSERT INTO " + table + " "
|
|
187
|
+
_query += " (" + ", ".join(columns) + ") "
|
|
188
|
+
_query += " VALUES (" + ", ".join([" '{}' ".format(v) for v in values]) + ") "
|
|
189
|
+
_query = _query.replace("\\", "")
|
|
190
|
+
return _query
|
|
191
|
+
|
|
192
|
+
def logs_update(self, logs):
|
|
193
|
+
"""
|
|
194
|
+
logs table in sqlite table is updated.
|
|
195
|
+
chats table in sqlite table is updated.
|
|
196
|
+
"""
|
|
197
|
+
try: self.check_for_table_exits(table='logs')
|
|
198
|
+
except Exception as e: print(e)
|
|
199
|
+
|
|
200
|
+
try: self.check_for_table_exits(table='chat')
|
|
201
|
+
except Exception as e: print(e)
|
|
202
|
+
|
|
203
|
+
try:
|
|
204
|
+
logs['login_user'] = current_user
|
|
205
|
+
logs['log_time'] = str(current_date_to_day())[0:19]
|
|
206
|
+
con.execute(self.insert_query(table='logs',
|
|
207
|
+
columns=self.sqlite_queries['columns']['logs'][1:],
|
|
208
|
+
values=logs
|
|
209
|
+
))
|
|
210
|
+
except Exception as e: print(e)
|
|
211
|
+
|
|
212
|
+
try:
|
|
213
|
+
con.execute(self.insert_query(table='chat', columns=self.sqlite_queries['columns']['chat'][1:],
|
|
214
|
+
values=self.info_logs_for_chat(logs['info'])))
|
|
215
|
+
except Exception as e:
|
|
216
|
+
print(e)
|
|
217
|
+
|
|
218
|
+
def info_log_create(self, type, dim=None):
|
|
219
|
+
"""
|
|
220
|
+
Logging system on creating E.A. or ML Works. This print processes are also shown at profile.html activities.
|
|
221
|
+
This gives the information of the process are done.
|
|
222
|
+
"""
|
|
223
|
+
_info = self.suc_log_for_data_works(type)
|
|
224
|
+
if dim is not None:
|
|
225
|
+
_info += " || dimension : " + dim
|
|
226
|
+
print("-- Process Info --")
|
|
227
|
+
print(_info)
|
|
228
|
+
self.logs_update(logs={"page": "data-execute", "info": _info, "color": "green"})
|
|
229
|
+
|
|
230
|
+
def fail_log_create(self, e, type, dim=None):
|
|
231
|
+
"""
|
|
232
|
+
Logging system on creating E.A. or ML Works. This print processes are also shown at profile.html activities.
|
|
233
|
+
This gives the information of the process are failed.
|
|
234
|
+
"""
|
|
235
|
+
e_str = ''
|
|
236
|
+
if e is not None:
|
|
237
|
+
e_str = str(e)
|
|
238
|
+
e_str = e_str[:min(len(e_str), 100)]
|
|
239
|
+
fail_message = fail_log_for_data_works(type, e_str)
|
|
240
|
+
if dim is not None:
|
|
241
|
+
fail_message += " || dimension : " + dim
|
|
242
|
+
print(" FAIL ---- !!!!!!!!")
|
|
243
|
+
print("-- message :", fail_message)
|
|
244
|
+
print(" ----- description ::::::", e_str)
|
|
245
|
+
self.logs_update(logs={"page": "data-execute",
|
|
246
|
+
"info": fail_message.replace("'", " "),
|
|
247
|
+
"color": "red"})
|
|
248
|
+
|
|
249
|
+
def create_schedule(self):
|
|
250
|
+
tag = self.query_schedule_status()
|
|
251
|
+
time_period = list(tag['time_period'])[0]
|
|
252
|
+
if time_period == 'daily':
|
|
253
|
+
return schedule.every().day.at("00:00")
|
|
254
|
+
if time_period == 'weekly':
|
|
255
|
+
return schedule.every().monday.at("00:00")
|
|
256
|
+
if time_period == 'once':
|
|
257
|
+
return 'once'
|
|
258
|
+
|
|
259
|
+
def get_dim_configs(self, _conf, dim):
|
|
260
|
+
for ea in _conf:
|
|
261
|
+
if ea not in ['date', 'time_period']:
|
|
262
|
+
_conf[ea]['order_index'], _conf[ea]['download_index'] = dim, dim
|
|
263
|
+
return _conf
|
|
264
|
+
|
|
265
|
+
def data_works(self):
|
|
266
|
+
"""
|
|
267
|
+
Execute Exploratory Analysis and Machine Learning Works which are implemented in the platform.
|
|
268
|
+
This process is optional on the web interface so, it also checks 'is_mlworks' and 'is_exploratory'.
|
|
269
|
+
Exploratory Analysis;
|
|
270
|
+
- Funnels
|
|
271
|
+
- Cohorts
|
|
272
|
+
- Descriptive Statistics
|
|
273
|
+
- RFM
|
|
274
|
+
- Product Analytics
|
|
275
|
+
- Promotion Analytics
|
|
276
|
+
Machine Learning;
|
|
277
|
+
- Customer Segmentation
|
|
278
|
+
- CLV Prediction
|
|
279
|
+
- A/B Test
|
|
280
|
+
- Anomaly Detection
|
|
281
|
+
|
|
282
|
+
These jobs are created per main and dimensional models individually but, are stored in the 'reports' index.
|
|
283
|
+
"""
|
|
284
|
+
self.data_pipelines.data_work_pipelines_execution(ml_connection_structure=self.ml_connection_structure,
|
|
285
|
+
ea_connection_structure=self.ea_connection_structure)
|
|
286
|
+
|
|
287
|
+
try:
|
|
288
|
+
# checks if there is executable dimensions are stored in 'orders' index.
|
|
289
|
+
self.collect_dimensions_for_data_works()
|
|
290
|
+
if len(self.unique_dimensions) > 1:
|
|
291
|
+
print("-" * 5, "Execute Ml Works and Exploratory Analysis for the Dimensions!", "-" * 5)
|
|
292
|
+
for dim in self.unique_dimensions: # iteratively execute EA and ML works for each dimension
|
|
293
|
+
self.separator(dim=dim)
|
|
294
|
+
self.data_pipelines.data_work_pipelines_execution(
|
|
295
|
+
ml_connection_structure=self.get_dim_configs(self.ml_connection_structure, dim),
|
|
296
|
+
ea_connection_structure=self.get_dim_configs(self.ea_connection_structure, dim), dim=dim)
|
|
297
|
+
except Exception as e: print(e)
|
|
298
|
+
self.create_build_in_reports.create_build_in_reports()
|
|
299
|
+
|
|
300
|
+
def jobs(self):
|
|
301
|
+
"""
|
|
302
|
+
Sequentially, this is the process of scheduling which is starting with data insert into the indexes.
|
|
303
|
+
The it continues with data works which includes ml works and exploratory analsis.
|
|
304
|
+
"""
|
|
305
|
+
self.create_index.execute_index() # create or update Orders and Downloads indexes
|
|
306
|
+
self.create_index = None # each schedule most be unique. Otherwise, class must be regenerated.
|
|
307
|
+
self.create_index = CreateIndex(data_connection_structure=self.data_connection_structure,
|
|
308
|
+
data_columns=self.data_columns,
|
|
309
|
+
actions=self.actions)
|
|
310
|
+
print("Orders and Downloads Indexes Creation processes are ended!")
|
|
311
|
+
self.data_works()
|
|
312
|
+
print("Exploratory Analysis and ML Works Creation processes are ended!")
|
|
313
|
+
|
|
314
|
+
def execute_schedule(self):
|
|
315
|
+
"""
|
|
316
|
+
ElasticSearch Service of Data Scheduling;
|
|
317
|
+
1. This process works on the thread, sequentially.
|
|
318
|
+
2. Checks time period; if the time period is 'once' it is triggered without scheduling.
|
|
319
|
+
3. After lunched for the scheduling (table name; schedule_data),
|
|
320
|
+
'max_date_of_order_data' will be updated on (check update_schedule_last_time)
|
|
321
|
+
4. If scheduling is deleted from the web-interface,
|
|
322
|
+
status columns on update_schedule_last_time will be updated or the whole row will be deleted.
|
|
323
|
+
In that case, the scheduling process will be killed.
|
|
324
|
+
During the whole process, It also checks the 'status' column on the 'schedule_data' table.
|
|
325
|
+
"""
|
|
326
|
+
s = self.create_schedule()
|
|
327
|
+
if s == 'once': # no need to schedule for once triggering process
|
|
328
|
+
print(self.es_tag, " - triggered for once !!!")
|
|
329
|
+
self.jobs()
|
|
330
|
+
else:
|
|
331
|
+
s.do(self.jobs)
|
|
332
|
+
while self.schedule:
|
|
333
|
+
schedule.run_pending()
|
|
334
|
+
try:
|
|
335
|
+
tag = self.query_schedule_status() # when schedule record is removed or it is canceled, returns 0
|
|
336
|
+
if len(tag) == 0:
|
|
337
|
+
print("schedule is cancelled")
|
|
338
|
+
self.schedule = False
|
|
339
|
+
except Exception as e:
|
|
340
|
+
self.schedule = False
|
|
341
|
+
time.sleep(100)
|
|
342
|
+
print("waiting ....")
|
|
343
|
+
|
|
344
|
+
def run_schedule_on_thread(self, function, args=None):
|
|
345
|
+
"""
|
|
346
|
+
allows us to create Orders and Downloads Indexes on the thread.
|
|
347
|
+
"""
|
|
348
|
+
process = threading.Thread(target=function, kwargs={} if args is None else args)
|
|
349
|
+
process.daemon = True
|
|
350
|
+
process.start()
|
|
351
|
+
print("scheduling is triggered!!")
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
es_connection:
|
|
2
|
+
CREATE TABLE es_connection (
|
|
3
|
+
id INTEGER NOT NULL,
|
|
4
|
+
tag VARCHAR,
|
|
5
|
+
host VARCHAR,
|
|
6
|
+
port VARCHAR,
|
|
7
|
+
directory VARCHAR,
|
|
8
|
+
url VARCHAR,
|
|
9
|
+
PRIMARY KEY (id)
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
data_connection:
|
|
13
|
+
CREATE TABLE data_connection (
|
|
14
|
+
id INTEGER NOT NULL,
|
|
15
|
+
orders_data_source_tag VARCHAR,
|
|
16
|
+
orders_data_source_type VARCHAR,
|
|
17
|
+
orders_data_query_path VARCHAR,
|
|
18
|
+
orders_password Binary,
|
|
19
|
+
orders_user VARCHAR,
|
|
20
|
+
orders_port VARCHAR,
|
|
21
|
+
orders_host VARCHAR,
|
|
22
|
+
orders_db VARCHAR,
|
|
23
|
+
downloads_data_source_tag VARCHAR,
|
|
24
|
+
downloads_data_source_type VARCHAR,
|
|
25
|
+
downloads_data_query_path VARCHAR,
|
|
26
|
+
downloads_password Binary,
|
|
27
|
+
downloads_user VARCHAR,
|
|
28
|
+
downloads_port VARCHAR,
|
|
29
|
+
downloads_host VARCHAR,
|
|
30
|
+
downloads_db VARCHAR,
|
|
31
|
+
products_data_source_tag VARCHAR,
|
|
32
|
+
products_data_source_type VARCHAR,
|
|
33
|
+
products_data_query_path VARCHAR,
|
|
34
|
+
products_password VARCHAR,
|
|
35
|
+
products_user VARCHAR,
|
|
36
|
+
products_port VARCHAR,
|
|
37
|
+
products_host VARCHAR,
|
|
38
|
+
products_db VARCHAR,
|
|
39
|
+
deliveries_data_source_tag VARCHAR,
|
|
40
|
+
deliveries_data_source_type VARCHAR,
|
|
41
|
+
deliveries_data_query_path VARCHAR,
|
|
42
|
+
deliveries_password VARCHAR,
|
|
43
|
+
deliveries_user VARCHAR,
|
|
44
|
+
deliveries_port VARCHAR,
|
|
45
|
+
deliveries_host VARCHAR,
|
|
46
|
+
deliveries_db VARCHAR,
|
|
47
|
+
dimension VARCHAR,
|
|
48
|
+
promotion_id VARCHAR,
|
|
49
|
+
PRIMARY KEY (id)
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
data_columns_integration:
|
|
53
|
+
CREATE TABLE data_columns_integration (
|
|
54
|
+
id INTEGER NOT NULL,
|
|
55
|
+
order_id VARCHAR,
|
|
56
|
+
order_id_2 VARCHAR,
|
|
57
|
+
client VARCHAR,
|
|
58
|
+
session_start_date VARCHAR,
|
|
59
|
+
payment_amount VARCHAR,
|
|
60
|
+
discount_amount VARCHAR,
|
|
61
|
+
date VARCHAR,
|
|
62
|
+
download_date VARCHAR,
|
|
63
|
+
signup_date VARCHAR,
|
|
64
|
+
data_type VARCHAR,
|
|
65
|
+
has_purchased VARCHAR,
|
|
66
|
+
product VARCHAR,
|
|
67
|
+
price VARCHAR,
|
|
68
|
+
category VARCHAR,
|
|
69
|
+
promotion_id VARCHAR,
|
|
70
|
+
actions VARCHAR,
|
|
71
|
+
dimension VARCHAR,
|
|
72
|
+
client_2 VARCHAR,
|
|
73
|
+
delivery_date VARCHAR,
|
|
74
|
+
prepare_date VARCHAR,
|
|
75
|
+
return_date VARCHAR,
|
|
76
|
+
latitude VARCHAR,
|
|
77
|
+
longitude VARCHAR,
|
|
78
|
+
PRIMARY KEY (id)
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
schedule_data:
|
|
82
|
+
CREATE TABLE schedule_data (
|
|
83
|
+
id INTEGER NOT NULL,
|
|
84
|
+
tag VARCHAR,
|
|
85
|
+
schedule_tag VARCHAR,
|
|
86
|
+
time_period VARCHAR,
|
|
87
|
+
status VARCHAR,
|
|
88
|
+
is_mlworks VARCHAR,
|
|
89
|
+
is_exploratory VARCHAR,
|
|
90
|
+
max_date_of_order_data VARCHAR,
|
|
91
|
+
PRIMARY KEY (id)
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
logs:
|
|
95
|
+
CREATE TABLE logs (
|
|
96
|
+
id INTEGER NOT NULL,
|
|
97
|
+
login_user VARCHAR,
|
|
98
|
+
log_time VARCHAR,
|
|
99
|
+
page VARCHAR,
|
|
100
|
+
color VARCHAR,
|
|
101
|
+
info VARCHAR,
|
|
102
|
+
PRIMARY KEY (id)
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
actions:
|
|
106
|
+
CREATE TABLE actions (
|
|
107
|
+
id INTEGER NOT NULL,
|
|
108
|
+
data_type VARCHAR,
|
|
109
|
+
action_name VARCHAR,
|
|
110
|
+
PRIMARY KEY (id)
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
chat:
|
|
114
|
+
CREATE TABLE chat (
|
|
115
|
+
id INTEGER NOT NULL,
|
|
116
|
+
date VARCHAR,
|
|
117
|
+
message VARCHAR,
|
|
118
|
+
general_message VARCHAR,
|
|
119
|
+
user VARCHAR,
|
|
120
|
+
chat_type VARCHAR,
|
|
121
|
+
chart VARCHAR,
|
|
122
|
+
user_logo VARCHAR,
|
|
123
|
+
PRIMARY KEY (id)
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
user_avatar:
|
|
127
|
+
CREATE TABLE user_avatar (
|
|
128
|
+
id INTEGER NOT NULL,
|
|
129
|
+
user VARCHAR,
|
|
130
|
+
user_avatar VARCHAR,
|
|
131
|
+
PRIMARY KEY (id)
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
columns:
|
|
135
|
+
es_connection:
|
|
136
|
+
- id
|
|
137
|
+
- tag
|
|
138
|
+
- host
|
|
139
|
+
- port
|
|
140
|
+
- directory
|
|
141
|
+
- url
|
|
142
|
+
|
|
143
|
+
data_connection:
|
|
144
|
+
- id
|
|
145
|
+
- orders_data_source_tag
|
|
146
|
+
- orders_data_source_type
|
|
147
|
+
- orders_data_query_path
|
|
148
|
+
- orders_password
|
|
149
|
+
- orders_user
|
|
150
|
+
- orders_port
|
|
151
|
+
- orders_host
|
|
152
|
+
- orders_db
|
|
153
|
+
- downloads_data_source_tag
|
|
154
|
+
- downloads_data_source_type
|
|
155
|
+
- downloads_data_query_path
|
|
156
|
+
- downloads_password
|
|
157
|
+
- downloads_user
|
|
158
|
+
- downloads_port
|
|
159
|
+
- downloads_host
|
|
160
|
+
- downloads_db
|
|
161
|
+
- products_data_source_tag
|
|
162
|
+
- products_data_source_type
|
|
163
|
+
- products_data_query_path
|
|
164
|
+
- products_password
|
|
165
|
+
- products_user
|
|
166
|
+
- products_port
|
|
167
|
+
- products_host
|
|
168
|
+
- products_db
|
|
169
|
+
- deliveries_data_source_tag
|
|
170
|
+
- deliveries_data_source_type
|
|
171
|
+
- deliveries_data_query_path
|
|
172
|
+
- deliveries_password
|
|
173
|
+
- deliveries_user
|
|
174
|
+
- deliveries_port
|
|
175
|
+
- deliveries_host
|
|
176
|
+
- deliveries_db
|
|
177
|
+
- products_db
|
|
178
|
+
- dimension
|
|
179
|
+
- promotion_id
|
|
180
|
+
|
|
181
|
+
data_columns_integration:
|
|
182
|
+
- id
|
|
183
|
+
- order_id
|
|
184
|
+
- order_id_2
|
|
185
|
+
- client
|
|
186
|
+
- session_start_date
|
|
187
|
+
- payment_amount
|
|
188
|
+
- discount_amount
|
|
189
|
+
- date
|
|
190
|
+
- download_date
|
|
191
|
+
- signup_date
|
|
192
|
+
- data_type
|
|
193
|
+
- has_purchased
|
|
194
|
+
- product
|
|
195
|
+
- price
|
|
196
|
+
- category
|
|
197
|
+
- promotion_id
|
|
198
|
+
- actions
|
|
199
|
+
- dimension
|
|
200
|
+
- client_2
|
|
201
|
+
- delivery_date
|
|
202
|
+
- prepare_date
|
|
203
|
+
- return_date
|
|
204
|
+
- latitude
|
|
205
|
+
- longitude
|
|
206
|
+
|
|
207
|
+
schedule_data:
|
|
208
|
+
- id
|
|
209
|
+
- tag
|
|
210
|
+
- schedule_tag
|
|
211
|
+
- time_period
|
|
212
|
+
- is_mlworks
|
|
213
|
+
- is_exploratory
|
|
214
|
+
- max_date_of_order_data
|
|
215
|
+
|
|
216
|
+
logs:
|
|
217
|
+
- id
|
|
218
|
+
- login_user
|
|
219
|
+
- log_time
|
|
220
|
+
- page
|
|
221
|
+
- color
|
|
222
|
+
- info
|
|
223
|
+
|
|
224
|
+
actions:
|
|
225
|
+
- id
|
|
226
|
+
- data_type
|
|
227
|
+
- action_name
|
|
228
|
+
|
|
229
|
+
chat:
|
|
230
|
+
- id
|
|
231
|
+
- date
|
|
232
|
+
- message
|
|
233
|
+
- general_message
|
|
234
|
+
- user
|
|
235
|
+
- chat_type
|
|
236
|
+
- chart
|
|
237
|
+
- user_logo
|
|
238
|
+
|
|
239
|
+
user_avatar:
|
|
240
|
+
- id
|
|
241
|
+
- user
|
|
242
|
+
- user_avatar
|
|
243
|
+
|
|
244
|
+
tables:
|
|
245
|
+
SELECT name, tbl_name FROM sqlite_master where type ='table'
|