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.
Files changed (254) hide show
  1. customeranalytics/__init__.py +319 -0
  2. customeranalytics/configs.py +480 -0
  3. customeranalytics/data_storage_configurations/__init__.py +245 -0
  4. customeranalytics/data_storage_configurations/data_access.py +165 -0
  5. customeranalytics/data_storage_configurations/data_works_pipeline.py +207 -0
  6. customeranalytics/data_storage_configurations/es_create_index.py +544 -0
  7. customeranalytics/data_storage_configurations/logger.py +36 -0
  8. customeranalytics/data_storage_configurations/query_es.py +157 -0
  9. customeranalytics/data_storage_configurations/reports.py +684 -0
  10. customeranalytics/data_storage_configurations/schedule_data_integration.py +355 -0
  11. customeranalytics/docs/queries.yaml +245 -0
  12. customeranalytics/docs/web_configs.yaml +2 -0
  13. customeranalytics/exploratory_analysis/__init__.py +109 -0
  14. customeranalytics/exploratory_analysis/churn.py +232 -0
  15. customeranalytics/exploratory_analysis/cohorts.py +535 -0
  16. customeranalytics/exploratory_analysis/descriptive_statistics.py +470 -0
  17. customeranalytics/exploratory_analysis/funnels.py +407 -0
  18. customeranalytics/exploratory_analysis/product_analytics.py +340 -0
  19. customeranalytics/exploratory_analysis/promotion_analytics.py +299 -0
  20. customeranalytics/exploratory_analysis/rfm.py +202 -0
  21. customeranalytics/exploratory_analysis/sample_data/sample_data_avg_order_count_per_promo_per_cust.csv +99 -0
  22. customeranalytics/exploratory_analysis/sample_data/sample_data_chart_1_search.csv +2 -0
  23. customeranalytics/exploratory_analysis/sample_data/sample_data_chart_2_search.csv +46 -0
  24. customeranalytics/exploratory_analysis/sample_data/sample_data_chart_3_search.csv +2 -0
  25. customeranalytics/exploratory_analysis/sample_data/sample_data_chart_4_search.csv +2 -0
  26. customeranalytics/exploratory_analysis/sample_data/sample_data_churn.csv +2 -0
  27. customeranalytics/exploratory_analysis/sample_data/sample_data_churn_weekly.csv +10 -0
  28. customeranalytics/exploratory_analysis/sample_data/sample_data_client_feature_predicted.csv +1590 -0
  29. customeranalytics/exploratory_analysis/sample_data/sample_data_client_kpis.csv +7060 -0
  30. customeranalytics/exploratory_analysis/sample_data/sample_data_clvrfm_anomaly.csv +561 -0
  31. customeranalytics/exploratory_analysis/sample_data/sample_data_clvsegments_amount.csv +8 -0
  32. customeranalytics/exploratory_analysis/sample_data/sample_data_customer_journey.csv +18 -0
  33. customeranalytics/exploratory_analysis/sample_data/sample_data_daily_clv.csv +103 -0
  34. customeranalytics/exploratory_analysis/sample_data/sample_data_daily_cohort_downloads.csv +68 -0
  35. customeranalytics/exploratory_analysis/sample_data/sample_data_daily_cohort_from_1_to_2.csv +66 -0
  36. customeranalytics/exploratory_analysis/sample_data/sample_data_daily_cohort_from_2_to_3.csv +64 -0
  37. customeranalytics/exploratory_analysis/sample_data/sample_data_daily_cohort_from_3_to_4.csv +55 -0
  38. customeranalytics/exploratory_analysis/sample_data/sample_data_daily_dimension_values.csv +199 -0
  39. customeranalytics/exploratory_analysis/sample_data/sample_data_daily_funnel.csv +36 -0
  40. customeranalytics/exploratory_analysis/sample_data/sample_data_daily_funnel_downloads.csv +68 -0
  41. customeranalytics/exploratory_analysis/sample_data/sample_data_daily_inorganic_ratio.csv +6070 -0
  42. customeranalytics/exploratory_analysis/sample_data/sample_data_daily_orders.csv +57 -0
  43. customeranalytics/exploratory_analysis/sample_data/sample_data_daily_organic_orders.csv +64 -0
  44. customeranalytics/exploratory_analysis/sample_data/sample_data_daily_products_of_sales.csv +12574 -0
  45. customeranalytics/exploratory_analysis/sample_data/sample_data_daily_promotion_discount.csv +64 -0
  46. customeranalytics/exploratory_analysis/sample_data/sample_data_daily_promotion_revenue.csv +6070 -0
  47. customeranalytics/exploratory_analysis/sample_data/sample_data_dcohort_anomaly.csv +6 -0
  48. customeranalytics/exploratory_analysis/sample_data/sample_data_dcohort_anomaly_2.csv +118 -0
  49. customeranalytics/exploratory_analysis/sample_data/sample_data_deliver.csv +47 -0
  50. customeranalytics/exploratory_analysis/sample_data/sample_data_deliver_kpis.csv +2 -0
  51. customeranalytics/exploratory_analysis/sample_data/sample_data_deliver_weekday_hour.csv +25 -0
  52. customeranalytics/exploratory_analysis/sample_data/sample_data_dfunnel_anomaly.csv +118 -0
  53. customeranalytics/exploratory_analysis/sample_data/sample_data_dimension_kpis.csv +199 -0
  54. customeranalytics/exploratory_analysis/sample_data/sample_data_dorders_anomaly.csv +85 -0
  55. customeranalytics/exploratory_analysis/sample_data/sample_data_frequency_clusters.csv +6 -0
  56. customeranalytics/exploratory_analysis/sample_data/sample_data_frequency_recency.csv +3740 -0
  57. customeranalytics/exploratory_analysis/sample_data/sample_data_hourly_funnel.csv +25 -0
  58. customeranalytics/exploratory_analysis/sample_data/sample_data_hourly_funnel_downloads.csv +25 -0
  59. customeranalytics/exploratory_analysis/sample_data/sample_data_hourly_inorganic_ratio.csv +2353 -0
  60. customeranalytics/exploratory_analysis/sample_data/sample_data_hourly_orders.csv +25 -0
  61. customeranalytics/exploratory_analysis/sample_data/sample_data_hourly_organic_orders.csv +2353 -0
  62. customeranalytics/exploratory_analysis/sample_data/sample_data_inorganic_orders_per_promotion_per_day.csv +6070 -0
  63. customeranalytics/exploratory_analysis/sample_data/sample_data_kpis.csv +2 -0
  64. customeranalytics/exploratory_analysis/sample_data/sample_data_monetary_clusters.csv +6 -0
  65. customeranalytics/exploratory_analysis/sample_data/sample_data_monetary_frequency.csv +3740 -0
  66. customeranalytics/exploratory_analysis/sample_data/sample_data_monthly_funnel.csv +5 -0
  67. customeranalytics/exploratory_analysis/sample_data/sample_data_monthly_funnel_downloads.csv +5 -0
  68. customeranalytics/exploratory_analysis/sample_data/sample_data_monthly_orders.csv +4 -0
  69. customeranalytics/exploratory_analysis/sample_data/sample_data_most_combined_products.csv +11 -0
  70. customeranalytics/exploratory_analysis/sample_data/sample_data_most_ordered_categories.csv +11 -0
  71. customeranalytics/exploratory_analysis/sample_data/sample_data_most_ordered_products.csv +11 -0
  72. customeranalytics/exploratory_analysis/sample_data/sample_data_order_and_payment_amount_differences.csv +91 -0
  73. customeranalytics/exploratory_analysis/sample_data/sample_data_prepare.csv +101 -0
  74. customeranalytics/exploratory_analysis/sample_data/sample_data_prepare_weekday_hour.csv +25 -0
  75. customeranalytics/exploratory_analysis/sample_data/sample_data_product_kpis.csv +201 -0
  76. customeranalytics/exploratory_analysis/sample_data/sample_data_product_usage_before_after_amount_accept.csv +11 -0
  77. customeranalytics/exploratory_analysis/sample_data/sample_data_product_usage_before_after_amount_reject.csv +7 -0
  78. customeranalytics/exploratory_analysis/sample_data/sample_data_product_usage_before_after_orders_accept.csv +11 -0
  79. customeranalytics/exploratory_analysis/sample_data/sample_data_product_usage_before_after_orders_reject.csv +11 -0
  80. customeranalytics/exploratory_analysis/sample_data/sample_data_promotion_comparison.csv +91 -0
  81. customeranalytics/exploratory_analysis/sample_data/sample_data_promotion_kpis.csv +99 -0
  82. customeranalytics/exploratory_analysis/sample_data/sample_data_promotion_number_of_customer.csv +99 -0
  83. customeranalytics/exploratory_analysis/sample_data/sample_data_promotion_usage_before_after_amount_accept.csv +81 -0
  84. customeranalytics/exploratory_analysis/sample_data/sample_data_promotion_usage_before_after_amount_reject.csv +11 -0
  85. customeranalytics/exploratory_analysis/sample_data/sample_data_promotion_usage_before_after_orders_accept.csv +55 -0
  86. customeranalytics/exploratory_analysis/sample_data/sample_data_promotion_usage_before_after_orders_reject.csv +37 -0
  87. customeranalytics/exploratory_analysis/sample_data/sample_data_purchase_amount_distribution.csv +22 -0
  88. customeranalytics/exploratory_analysis/sample_data/sample_data_recency_clusters.csv +6 -0
  89. customeranalytics/exploratory_analysis/sample_data/sample_data_recency_monetary.csv +3740 -0
  90. customeranalytics/exploratory_analysis/sample_data/sample_data_rfm.csv +2001 -0
  91. customeranalytics/exploratory_analysis/sample_data/sample_data_ride.csv +101 -0
  92. customeranalytics/exploratory_analysis/sample_data/sample_data_ride_weekday_hour.csv +25 -0
  93. customeranalytics/exploratory_analysis/sample_data/sample_data_segmentation.csv +11 -0
  94. customeranalytics/exploratory_analysis/sample_data/sample_data_segments_change_daily_before_after_amount.csv +10 -0
  95. customeranalytics/exploratory_analysis/sample_data/sample_data_segments_change_daily_before_after_orders.csv +9 -0
  96. customeranalytics/exploratory_analysis/sample_data/sample_data_segments_change_monthly_before_after_amount.csv +10 -0
  97. customeranalytics/exploratory_analysis/sample_data/sample_data_segments_change_monthly_before_after_orders.csv +11 -0
  98. customeranalytics/exploratory_analysis/sample_data/sample_data_segments_change_weekly_before_after_amount.csv +10 -0
  99. customeranalytics/exploratory_analysis/sample_data/sample_data_segments_change_weekly_before_after_orders.csv +10 -0
  100. customeranalytics/exploratory_analysis/sample_data/sample_data_user_counts_per_order_seq.csv +47 -0
  101. customeranalytics/exploratory_analysis/sample_data/sample_data_weekly_average_order_per_user.csv +13 -0
  102. customeranalytics/exploratory_analysis/sample_data/sample_data_weekly_average_payment_amount.csv +13 -0
  103. customeranalytics/exploratory_analysis/sample_data/sample_data_weekly_average_session_per_user.csv +13 -0
  104. customeranalytics/exploratory_analysis/sample_data/sample_data_weekly_cohort_downloads.csv +13 -0
  105. customeranalytics/exploratory_analysis/sample_data/sample_data_weekly_cohort_from_1_to_2.csv +13 -0
  106. customeranalytics/exploratory_analysis/sample_data/sample_data_weekly_cohort_from_2_to_3.csv +13 -0
  107. customeranalytics/exploratory_analysis/sample_data/sample_data_weekly_cohort_from_3_to_4.csv +12 -0
  108. customeranalytics/exploratory_analysis/sample_data/sample_data_weekly_funnel.csv +25 -0
  109. customeranalytics/exploratory_analysis/sample_data/sample_data_weekly_funnel_downloads.csv +25 -0
  110. customeranalytics/exploratory_analysis/sample_data/sample_data_weekly_orders.csv +10 -0
  111. customeranalytics/ml_process/__init__.py +64 -0
  112. customeranalytics/ml_process/ab_test.py +615 -0
  113. customeranalytics/ml_process/anomaly_detection.py +456 -0
  114. customeranalytics/ml_process/clv_prediction.py +301 -0
  115. customeranalytics/ml_process/customer_segmentation.py +354 -0
  116. customeranalytics/ml_process/delivery_analytics.py +754 -0
  117. customeranalytics/utils.py +186 -0
  118. customeranalytics/web/app/__init__.py +37 -0
  119. customeranalytics/web/app/base/__init__.py +9 -0
  120. customeranalytics/web/app/base/forms.py +16 -0
  121. customeranalytics/web/app/base/models.py +43 -0
  122. customeranalytics/web/app/base/routes.py +126 -0
  123. customeranalytics/web/app/base/static/assets/css/app.css +20 -0
  124. customeranalytics/web/app/base/static/assets/fonts/Inter-Black.woff +0 -0
  125. customeranalytics/web/app/base/static/assets/fonts/Inter-Black.woff2 +0 -0
  126. customeranalytics/web/app/base/static/assets/fonts/Inter-BlackItalic.woff +0 -0
  127. customeranalytics/web/app/base/static/assets/fonts/Inter-BlackItalic.woff2 +0 -0
  128. customeranalytics/web/app/base/static/assets/fonts/Inter-Bold.woff +0 -0
  129. customeranalytics/web/app/base/static/assets/fonts/Inter-Bold.woff2 +0 -0
  130. customeranalytics/web/app/base/static/assets/fonts/Inter-BoldItalic.woff +0 -0
  131. customeranalytics/web/app/base/static/assets/fonts/Inter-BoldItalic.woff2 +0 -0
  132. customeranalytics/web/app/base/static/assets/fonts/Inter-ExtraBold.woff +0 -0
  133. customeranalytics/web/app/base/static/assets/fonts/Inter-ExtraBold.woff2 +0 -0
  134. customeranalytics/web/app/base/static/assets/fonts/Inter-ExtraBoldItalic.woff +0 -0
  135. customeranalytics/web/app/base/static/assets/fonts/Inter-ExtraBoldItalic.woff2 +0 -0
  136. customeranalytics/web/app/base/static/assets/fonts/Inter-ExtraLight-BETA.woff +0 -0
  137. customeranalytics/web/app/base/static/assets/fonts/Inter-ExtraLight-BETA.woff2 +0 -0
  138. customeranalytics/web/app/base/static/assets/fonts/Inter-ExtraLightItalic-BETA.woff +0 -0
  139. customeranalytics/web/app/base/static/assets/fonts/Inter-ExtraLightItalic-BETA.woff2 +0 -0
  140. customeranalytics/web/app/base/static/assets/fonts/Inter-Italic.woff +0 -0
  141. customeranalytics/web/app/base/static/assets/fonts/Inter-Italic.woff2 +0 -0
  142. customeranalytics/web/app/base/static/assets/fonts/Inter-Light-BETA.woff +0 -0
  143. customeranalytics/web/app/base/static/assets/fonts/Inter-Light-BETA.woff2 +0 -0
  144. customeranalytics/web/app/base/static/assets/fonts/Inter-LightItalic-BETA.woff +0 -0
  145. customeranalytics/web/app/base/static/assets/fonts/Inter-LightItalic-BETA.woff2 +0 -0
  146. customeranalytics/web/app/base/static/assets/fonts/Inter-Medium.woff +0 -0
  147. customeranalytics/web/app/base/static/assets/fonts/Inter-Medium.woff2 +0 -0
  148. customeranalytics/web/app/base/static/assets/fonts/Inter-MediumItalic.woff +0 -0
  149. customeranalytics/web/app/base/static/assets/fonts/Inter-MediumItalic.woff2 +0 -0
  150. customeranalytics/web/app/base/static/assets/fonts/Inter-Regular.woff +0 -0
  151. customeranalytics/web/app/base/static/assets/fonts/Inter-Regular.woff2 +0 -0
  152. customeranalytics/web/app/base/static/assets/fonts/Inter-SemiBold.woff +0 -0
  153. customeranalytics/web/app/base/static/assets/fonts/Inter-SemiBold.woff2 +0 -0
  154. customeranalytics/web/app/base/static/assets/fonts/Inter-SemiBoldItalic.woff +0 -0
  155. customeranalytics/web/app/base/static/assets/fonts/Inter-SemiBoldItalic.woff2 +0 -0
  156. customeranalytics/web/app/base/static/assets/fonts/Inter-Thin-BETA.woff +0 -0
  157. customeranalytics/web/app/base/static/assets/fonts/Inter-Thin-BETA.woff2 +0 -0
  158. customeranalytics/web/app/base/static/assets/fonts/Inter-ThinItalic-BETA.woff +0 -0
  159. customeranalytics/web/app/base/static/assets/fonts/Inter-ThinItalic-BETA.woff2 +0 -0
  160. customeranalytics/web/app/base/static/assets/fonts/Inter-italic.var.woff2 +0 -0
  161. customeranalytics/web/app/base/static/assets/fonts/Inter-upright.var.woff2 +0 -0
  162. customeranalytics/web/app/base/static/assets/fonts/Inter.var.woff2 +0 -0
  163. customeranalytics/web/app/base/static/assets/fonts/fa-brands-400.eot +0 -0
  164. customeranalytics/web/app/base/static/assets/fonts/fa-brands-400.svg +3570 -0
  165. customeranalytics/web/app/base/static/assets/fonts/fa-brands-400.ttf +0 -0
  166. customeranalytics/web/app/base/static/assets/fonts/fa-brands-400.woff +0 -0
  167. customeranalytics/web/app/base/static/assets/fonts/fa-brands-400.woff2 +0 -0
  168. customeranalytics/web/app/base/static/assets/fonts/fa-regular-400.eot +0 -0
  169. customeranalytics/web/app/base/static/assets/fonts/fa-regular-400.svg +801 -0
  170. customeranalytics/web/app/base/static/assets/fonts/fa-regular-400.ttf +0 -0
  171. customeranalytics/web/app/base/static/assets/fonts/fa-regular-400.woff +0 -0
  172. customeranalytics/web/app/base/static/assets/fonts/fa-regular-400.woff2 +0 -0
  173. customeranalytics/web/app/base/static/assets/fonts/fa-solid-900.eot +0 -0
  174. customeranalytics/web/app/base/static/assets/fonts/fa-solid-900.svg +5028 -0
  175. customeranalytics/web/app/base/static/assets/fonts/fa-solid-900.ttf +0 -0
  176. customeranalytics/web/app/base/static/assets/fonts/fa-solid-900.woff +0 -0
  177. customeranalytics/web/app/base/static/assets/fonts/fa-solid-900.woff2 +0 -0
  178. customeranalytics/web/app/base/static/assets/img/avatars/avatar-1.png +0 -0
  179. customeranalytics/web/app/base/static/assets/img/avatars/avatar-2.png +0 -0
  180. customeranalytics/web/app/base/static/assets/img/avatars/avatar-3.png +0 -0
  181. customeranalytics/web/app/base/static/assets/img/avatars/avatar-4.png +0 -0
  182. customeranalytics/web/app/base/static/assets/img/avatars/avatar-5.png +0 -0
  183. customeranalytics/web/app/base/static/assets/img/avatars/info.jpeg +0 -0
  184. customeranalytics/web/app/base/static/assets/img/icons/customanality.png +0 -0
  185. customeranalytics/web/app/base/static/assets/img/icons/icon-48x48.png +0 -0
  186. customeranalytics/web/app/base/static/assets/js/app.js +2 -0
  187. customeranalytics/web/app/base/static/assets/js/app.js.LICENSE +566 -0
  188. customeranalytics/web/app/base/static/assets/js/app.js.LICENSE.txt +556 -0
  189. customeranalytics/web/app/base/static/assets/js/modules/bootstrap.js +15 -0
  190. customeranalytics/web/app/base/static/assets/js/modules/chartjs.js +4 -0
  191. customeranalytics/web/app/base/static/assets/js/modules/feather.js +8 -0
  192. customeranalytics/web/app/base/static/assets/js/modules/flatpickr.js +4 -0
  193. customeranalytics/web/app/base/static/assets/js/modules/moment.js +4 -0
  194. customeranalytics/web/app/base/static/assets/js/modules/sidebar.js +23 -0
  195. customeranalytics/web/app/base/static/assets/js/modules/theme.js +16 -0
  196. customeranalytics/web/app/base/templates/accounts/login.html +81 -0
  197. customeranalytics/web/app/base/templates/accounts/register.html +80 -0
  198. customeranalytics/web/app/base/templates/includes/footer.html +28 -0
  199. customeranalytics/web/app/base/templates/includes/navigation.html +51 -0
  200. customeranalytics/web/app/base/templates/includes/scripts.html +3 -0
  201. customeranalytics/web/app/base/templates/includes/sidebar.html +146 -0
  202. customeranalytics/web/app/base/templates/layouts/base-fullscreen.html +36 -0
  203. customeranalytics/web/app/base/templates/layouts/base.html +84 -0
  204. customeranalytics/web/app/base/util.py +30 -0
  205. customeranalytics/web/app/home/__init__.py +9 -0
  206. customeranalytics/web/app/home/forms.py +1039 -0
  207. customeranalytics/web/app/home/models.py +438 -0
  208. customeranalytics/web/app/home/profiles.py +310 -0
  209. customeranalytics/web/app/home/routes.py +386 -0
  210. customeranalytics/web/app/home/search.py +288 -0
  211. customeranalytics/web/app/home/static/assets/img/avatars/avatar-1.png +0 -0
  212. customeranalytics/web/app/home/static/assets/img/avatars/avatar-2.png +0 -0
  213. customeranalytics/web/app/home/static/assets/img/avatars/avatar-3.png +0 -0
  214. customeranalytics/web/app/home/static/assets/img/avatars/avatar-4.png +0 -0
  215. customeranalytics/web/app/home/static/assets/img/avatars/avatar-5.png +0 -0
  216. customeranalytics/web/app/home/static/assets/img/icons/customanality.png +0 -0
  217. customeranalytics/web/app/home/static/assets/img/icons/icon-48x48.png +0 -0
  218. customeranalytics/web/app/home/templates/abtest-product.html +280 -0
  219. customeranalytics/web/app/home/templates/abtest-promotion.html +362 -0
  220. customeranalytics/web/app/home/templates/abtest-segments.html +298 -0
  221. customeranalytics/web/app/home/templates/add-data-delivery.html +184 -0
  222. customeranalytics/web/app/home/templates/add-data-product.html +177 -0
  223. customeranalytics/web/app/home/templates/add-data-purchase.html +392 -0
  224. customeranalytics/web/app/home/templates/anomaly.html +261 -0
  225. customeranalytics/web/app/home/templates/clv.html +211 -0
  226. customeranalytics/web/app/home/templates/cohorts.html +308 -0
  227. customeranalytics/web/app/home/templates/customer-segmentation.html +308 -0
  228. customeranalytics/web/app/home/templates/data-es.html +152 -0
  229. customeranalytics/web/app/home/templates/data-execute.html +397 -0
  230. customeranalytics/web/app/home/templates/delivery.html +404 -0
  231. customeranalytics/web/app/home/templates/funnel-customer.html +240 -0
  232. customeranalytics/web/app/home/templates/funnel-session.html +236 -0
  233. customeranalytics/web/app/home/templates/index.html +524 -0
  234. customeranalytics/web/app/home/templates/index2.html +515 -0
  235. customeranalytics/web/app/home/templates/page-403.html +46 -0
  236. customeranalytics/web/app/home/templates/page-404.html +45 -0
  237. customeranalytics/web/app/home/templates/page-500.html +45 -0
  238. customeranalytics/web/app/home/templates/pages-blank.html +33 -0
  239. customeranalytics/web/app/home/templates/pages-sign-in.html +67 -0
  240. customeranalytics/web/app/home/templates/pages-sign-up.html +61 -0
  241. customeranalytics/web/app/home/templates/product.html +203 -0
  242. customeranalytics/web/app/home/templates/profile.html +1009 -0
  243. customeranalytics/web/app/home/templates/rfm.html +254 -0
  244. customeranalytics/web/app/home/templates/search.html +167 -0
  245. customeranalytics/web/app/home/templates/settings.html +205 -0
  246. customeranalytics/web/app/home/templates/stats-desc.html +230 -0
  247. customeranalytics/web/app/home/templates/stats-purchase.html +221 -0
  248. customeranalytics/web/config.py +30 -0
  249. customeranalytics/web/db.sqlite3 +0 -0
  250. customeranalytics/web/run.py +30 -0
  251. customeranalytics-0.1.dist-info/METADATA +1102 -0
  252. customeranalytics-0.1.dist-info/RECORD +254 -0
  253. customeranalytics-0.1.dist-info/WHEEL +4 -0
  254. customeranalytics-0.1.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,230 @@
1
+ {% extends "layouts/base.html" %}
2
+
3
+ {% block title %} Descriptive Statistics {% endblock %}
4
+
5
+ <!-- Specific Page CSS goes HERE -->
6
+ {% block stylesheets %}{% endblock stylesheets %}
7
+
8
+ {% block content %}
9
+
10
+ <main class="content">
11
+ <div class="container-fluid p-0">
12
+ <h5 class="h3 mb-3">Descriptive Statistics</h5>
13
+ <div class="col-md-12">
14
+ <div class="card">
15
+ <div class="card-body">
16
+ <div class="row">
17
+ <div class="accordion" id="accordionExample">
18
+ <div class="card">
19
+ <div class="card-header" id="headingOne">
20
+ <h5 class="card-title my-1">
21
+ <a href="#" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne" style="color:green;font-size:12px">
22
+ Filters
23
+ </a>
24
+ </h5>
25
+ </div>
26
+ <div id="collapseOne" class="collapse" aria-labelledby="headingOne" data-parent="#accordionExample">
27
+ <form method="POST">
28
+ <div class="row">
29
+ <div class="col-md-6">
30
+ <div class="card">
31
+ <div class="card-body">
32
+ <div class="card">
33
+ <div class="card-header">
34
+ <h5 class="card-title mb-0">Dimension selection</h5>
35
+ </div>
36
+ <div class="card-body">
37
+ <select name="index" id="index" class="form-control">
38
+ {% for d in filters['dimensions'] %}
39
+ {% if d == 'There is no available report. Please execute Schedule Data Process' %}
40
+ <option value= "main">{{ d }}</option>
41
+ {% endif %}
42
+ {% if d != 'There is no available report. Please execute Schedule Data Process' %}
43
+ <option value="{{ d }}">{{ d }}</option>
44
+ {% endif %}
45
+ {% endfor %}
46
+ </select>
47
+ </div>
48
+ </div>
49
+ </div>
50
+ </div>
51
+ </div>
52
+
53
+ <div class="col-md-6">
54
+ <div class="card flex-fil">
55
+ <div class="card-body col-12">
56
+ <div class="col-12 ">
57
+ <div class="align-self-center w-100">
58
+ <div class="chart">
59
+ <input name="date" id="datetimepicker-dashboard" hidden>
60
+ </div>
61
+ </div>
62
+ </div>
63
+ </div>
64
+ </div>
65
+ </div>
66
+
67
+ <div class="card-header">
68
+ <button type="submit" class="btn btn-pill btn-primary">Apply</button>
69
+ </div>
70
+ </div>
71
+ </form>
72
+ </div>
73
+ </div>
74
+
75
+ <div class="card">
76
+ <div class="card-header" id="headingTwo">
77
+ <h5 class="card-title my-1">
78
+ <a href="#" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="true" aria-controls="collapseOne" style="color:green;font-size:12px">
79
+ Infos
80
+ </a>
81
+ </h5>
82
+ </div>
83
+ <div id="collapseTwo" class="collapse show" aria-labelledby="headingTwo" data-parent="#accordionExample">
84
+ <div class="card-body ">
85
+ <ul>
86
+ <li>
87
+ <div class="card-header">
88
+ <h5 class="card-title" style="color:green;">Weekly Average Session Count per Customer</h5>
89
+ Each customer's total unique session count per week is calculated.
90
+ By using this aggregated date average session count per customer per week is calculated.
91
+ This might give us the clue of which weeks the customers of engagement to the business are increased/decreased.
92
+ In addition to that, It gives us information about the customers` session frequency per week.
93
+ </div>
94
+ </li>
95
+ <li>
96
+ <div class="card-header">
97
+ <h5 class="card-title" style="color:green;">Weekly Average Purchase Count per Customer</h5>
98
+ Each customer's total order count per week is calculated.
99
+ By using this aggregated date average order count per customer per week is calculated.
100
+ This might give us the clue of which weeks the customers of order possibilities are increased/decreased.
101
+ In addition to that, It gives us information about the customers` purchase frequency per week.
102
+ </div>
103
+ </li>
104
+ <li>
105
+ <div class="card-header">
106
+ <h5 class="card-title" style="color:green;">Payment Amount Distribution</h5>
107
+ This chart is a histogram which shows the bins of total customers.
108
+ Each bin represents a range of payment amounts related to purchased orders.
109
+ </div>
110
+ </li>
111
+ <li>
112
+ <div class="card-header">
113
+ <h5 class="card-title" style="color:green;">Weekly Average Payment Amount</h5>
114
+ Average payment amount of orders user who has orders
115
+ </div>
116
+ </li>
117
+ </ul>
118
+ </div>
119
+ </div>
120
+ </div>
121
+ </div>
122
+
123
+ <div class="col-md-6">
124
+ <div class="card">
125
+ <div class="card-header">
126
+ <h5 class="card-title">Weekly Average Session Count per Customer {% if data_type['weekly_average_session_per_user'] == False %} <strong style="color:red;"> sample data </strong> {% endif %}</h5>
127
+ </div>
128
+ <div id="w_ses_per_user_id" class="plotly-gra ph-div" style="height:400px;"></div>
129
+ </div>
130
+ </div>
131
+ <div class="col-md-6">
132
+ <div class="card">
133
+ <div class="card-header">
134
+ <h5 class="card-title">Weekly Average Purchase Count per Customer {% if data_type['weekly_average_order_per_user'] == False %} <strong style="color:red;"> sample data </strong> {% endif %}</h5>
135
+ </div>
136
+ <div class="card-body">
137
+ <div id="w_order_per_user_id" class="plotly-gra ph-div" style="height:400px;"></div>
138
+ </div>
139
+ </div>
140
+ </div>
141
+ </div>
142
+ <div class="row">
143
+ <div class="col-md-6">
144
+ <div class="card">
145
+ <div class="card-header">
146
+ <h5 class="card-title">Payment Amount Distribution {% if data_type['purchase_amount_distribution'] == False %} <strong style="color:red;"> sample data </strong> {% endif %}</h5>
147
+ </div>
148
+ <div class="card-body">
149
+ <div id="p_a_d_id" class="plotly-gra ph-div" style="height:400px;"></div>
150
+ </div>
151
+ </div>
152
+ </div>
153
+ <div class="col-md-6">
154
+ <div class="card">
155
+ <div class="card-header">
156
+ <h5 class="card-title">Weekly Average Payment Amount {% if data_type['weekly_average_payment_amount'] == False %} <strong style="color:red;"> sample data </strong> {% endif %}</h5>
157
+ </div>
158
+ <div class="card-body">
159
+ <div id="w_avg_p_a_id" class="plotly-gra ph-div" style="height:400px;"></div>
160
+ </div>
161
+ </div>
162
+ </div>
163
+ </div>
164
+ </div>
165
+ </div>
166
+ </div>
167
+ </div>
168
+ </main>
169
+
170
+ {% endblock content %}
171
+
172
+ <!-- Specific Page JS goes HERE -->
173
+ {% block javascripts %}
174
+ <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
175
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script>
176
+ <script>
177
+
178
+ var w_ses_per_user = {{weekly_average_session_per_user | safe}};
179
+
180
+ Plotly.plot('w_ses_per_user_id', // the ID of the div, created above
181
+ w_ses_per_user.trace, w_ses_per_user.layout, {});
182
+
183
+ var w_order_per_user = {{weekly_average_order_per_user | safe}};
184
+
185
+ Plotly.plot('w_order_per_user_id', // the ID of the div, created above
186
+ w_order_per_user.trace, w_order_per_user.layout, {});
187
+
188
+ var p_a_d = {{purchase_amount_distribution | safe}};
189
+
190
+ Plotly.plot('p_a_d_id', // the ID of the div, created above
191
+ p_a_d.trace, p_a_d.layout, {});
192
+
193
+ var w_avg_p_a = {{weekly_average_payment_amount | safe}};
194
+
195
+ Plotly.plot('w_avg_p_a_id', // the ID of the div, created above
196
+ w_avg_p_a.trace, w_avg_p_a.layout, {});
197
+
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+ function myFunction() {
206
+ // Get the checkbox
207
+ var checkBox = document.getElementById("myCheck");
208
+ // Get the output text
209
+ var text = document.getElementById("text");
210
+
211
+ // If the checkbox is checked, display the output text
212
+ if (checkBox.checked == true){
213
+ text.style.display = "block";
214
+ } else {
215
+ text.style.display = "none";
216
+ }
217
+ }
218
+ </script>
219
+
220
+ <script>
221
+ document.addEventListener("DOMContentLoaded", function() {
222
+ document.getElementById("datetimepicker-dashboard").flatpickr({
223
+ inline: true,
224
+
225
+ prevArrow: "<span class=\"fas fa-chevron-left\" title=\"Previous month\"></span>",
226
+ nextArrow: "<span class=\"fas fa-chevron-right\" title=\"Next month\"></span>",
227
+ });
228
+ });
229
+ </script>
230
+ {% endblock javascripts %}
@@ -0,0 +1,221 @@
1
+ {% extends "layouts/base.html" %}
2
+
3
+ {% block title %} Stats Purchase {% endblock %}
4
+
5
+ <!-- Specific Page CSS goes HERE -->
6
+ {% block stylesheets %}{% endblock stylesheets %}
7
+
8
+ {% block content %}
9
+
10
+ <main class="content">
11
+ <div class="container-fluid p-0">
12
+ <h5 class="h3 mb-3">Purchase Of Statistics</h5>
13
+ <div class="col-md-12">
14
+ <div class="card">
15
+ <div class="card-body">
16
+ <div class="row">
17
+ <div class="accordion" id="accordionExample">
18
+ <div class="card">
19
+ <div class="card-header" id="headingOne">
20
+ <h5 class="card-title my-1">
21
+ <a href="#" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne" style="color:green;font-size:12px">
22
+ Filters
23
+ </a>
24
+ </h5>
25
+ </div>
26
+ <div id="collapseOne" class="collapse" aria-labelledby="headingOne" data-parent="#accordionExample">
27
+ <form method="POST">
28
+ <div class="row">
29
+ <div class="col-md-6">
30
+ <div class="card">
31
+ <div class="card-body">
32
+ <div class="card">
33
+ <div class="card-header">
34
+ <h5 class="card-title mb-0">Dimension selection</h5>
35
+ </div>
36
+ <div class="card-body">
37
+ <select name="index" id="index" class="form-control">
38
+ {% for d in filters['dimensions'] %}
39
+ {% if d == 'There is no available report. Please execute Schedule Data Process' %}
40
+ <option value= "main">{{ d }}</option>
41
+ {% endif %}
42
+ {% if d != 'There is no available report. Please execute Schedule Data Process' %}
43
+ <option value="{{ d }}">{{ d }}</option>
44
+ {% endif %}
45
+ {% endfor %}
46
+ </select>
47
+ </div>
48
+ </div>
49
+ </div>
50
+ </div>
51
+ </div>
52
+
53
+ <div class="col-md-6">
54
+ <div class="card flex-fil">
55
+ <div class="card-body col-12">
56
+ <div class="col-12 ">
57
+ <div class="align-self-center w-100">
58
+ <div class="chart">
59
+ <input name="date" id="datetimepicker-dashboard" hidden>
60
+ </div>
61
+ </div>
62
+ </div>
63
+ </div>
64
+ </div>
65
+ </div>
66
+
67
+ <div class="card-header">
68
+ <button type="submit" class="btn btn-pill btn-primary">Apply</button>
69
+ </div>
70
+ </div>
71
+ </form>
72
+ </div>
73
+ </div>
74
+
75
+ <div class="card">
76
+ <div class="card-header" id="headingTwo">
77
+ <h5 class="card-title my-1">
78
+ <a href="#" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="true" aria-controls="collapseOne" style="color:green;font-size:12px">
79
+ Infos
80
+ </a>
81
+ </h5>
82
+ </div>
83
+ <div id="collapseTwo" class="collapse show" aria-labelledby="headingTwo" data-parent="#accordionExample">
84
+ <div class="card-body ">
85
+ <ul>
86
+ <li>
87
+ <div class="card-header">
88
+ <h5 class="card-title" style="color:green;">Daily Orders</h5>
89
+ Total number of orders per day.
90
+ Total number of unique session IDs which has has_purchase (has_purchase = True) breakdown with day.
91
+ </div>
92
+ </li>
93
+ <li>
94
+ <div class="card-header">
95
+ <h5 class="card-title" style="color:green;">Hourly Orders</h5>
96
+ Average of total order count per day.
97
+ Total number of order count per day and per hour is aggregated.
98
+ Next step is calculating average order count per hour by using aggregated data from the previous step.
99
+ </div>
100
+ </li>
101
+ <li>
102
+ <div class="card-header">
103
+ <h5 class="card-title" style="color:green;">Weekly Orders</h5>
104
+ Total number of orders per week. Each week is represented by Mondays.
105
+ </div>
106
+ </li>
107
+ <li>
108
+ <div class="card-header">
109
+ <h5 class="card-title" style="color:green;">Monthly Orders</h5>
110
+ Total number of orders per month;
111
+ total number of purchase unique session IDs are counted per month.
112
+ </div>
113
+ </li>
114
+ </ul>
115
+ </div>
116
+ </div>
117
+ </div>
118
+ </div>
119
+
120
+ <div class="col-md-6">
121
+ <div class="card">
122
+ <div class="card-header">
123
+ <h5 class="card-title">Daily Orders {% if data_type['daily_orders'] == False %} <strong style="color:red;"> sample data </strong> {% endif %}</h5>
124
+ </div>
125
+ <div id="d_orders_id" class="plotly-gra ph-div" style="height:400px;"></div>
126
+ </div>
127
+ </div>
128
+ <div class="col-md-6">
129
+ <div class="card">
130
+ <div class="card-header">
131
+ <h5 class="card-title">Hourly Orders {% if data_type['hourly_orders'] == False %} <strong style="color:red;"> sample data </strong> {% endif %}</h5>
132
+ </div>
133
+ <div class="card-body">
134
+ <div id="h_orders_id" class="plotly-gra ph-div" style="height:400px;"></div>
135
+ </div>
136
+ </div>
137
+ </div>
138
+ </div>
139
+ <div class="row">
140
+ <div class="col-md-6">
141
+ <div class="card">
142
+ <div class="card-header">
143
+ <h5 class="card-title">Weekly Orders {% if data_type['weekly_orders'] == False %} <strong style="color:red;"> sample data </strong> {% endif %}</h5>
144
+ </div>
145
+ <div class="card-body">
146
+ <div id="w_orders_id" class="plotly-gra ph-div" style="height:400px;"></div>
147
+ </div>
148
+ </div>
149
+ </div>
150
+ <div class="col-md-6">
151
+ <div class="card">
152
+ <div class="card-header">
153
+ <h5 class="card-title">Monthly Orders {% if data_type['monthly_orders'] == False %} <strong style="color:red;"> sample data </strong> {% endif %}</h5>
154
+ </div>
155
+ <div class="card-body">
156
+ <div id="m_orders_id" class="plotly-gra ph-div" style="height:400px;"></div>
157
+ </div>
158
+ </div>
159
+ </div>
160
+ </div>
161
+ </div>
162
+ </div>
163
+ </div>
164
+ </div>
165
+ </main>
166
+
167
+ {% endblock content %}
168
+
169
+ <!-- Specific Page JS goes HERE -->
170
+ {% block javascripts %}
171
+ <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
172
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script>
173
+ <script>
174
+
175
+ var d_orders = {{daily_orders | safe}};
176
+
177
+ Plotly.plot('d_orders_id', // the ID of the div, created above
178
+ d_orders.trace, d_orders.layout, {});
179
+
180
+ var h_orders = {{hourly_orders | safe}};
181
+
182
+ Plotly.plot('h_orders_id', // the ID of the div, created above
183
+ h_orders.trace, h_orders.layout, {});
184
+
185
+ var w_orders = {{weekly_orders | safe}};
186
+
187
+ Plotly.plot('w_orders_id', // the ID of the div, created above
188
+ w_orders.trace, w_orders.layout, {});
189
+
190
+ var m_orders = {{monthly_orders | safe}};
191
+
192
+ Plotly.plot('m_orders_id', // the ID of the div, created above
193
+ m_orders.trace, m_orders.layout, {});
194
+
195
+
196
+ function myFunction() {
197
+ // Get the checkbox
198
+ var checkBox = document.getElementById("myCheck");
199
+ // Get the output text
200
+ var text = document.getElementById("text");
201
+
202
+ // If the checkbox is checked, display the output text
203
+ if (checkBox.checked == true){
204
+ text.style.display = "block";
205
+ } else {
206
+ text.style.display = "none";
207
+ }
208
+ }
209
+ </script>
210
+
211
+ <script>
212
+ document.addEventListener("DOMContentLoaded", function() {
213
+ document.getElementById("datetimepicker-dashboard").flatpickr({
214
+ inline: true,
215
+
216
+ prevArrow: "<span class=\"fas fa-chevron-left\" title=\"Previous month\"></span>",
217
+ nextArrow: "<span class=\"fas fa-chevron-right\" title=\"Next month\"></span>",
218
+ });
219
+ });
220
+ </script>
221
+ {% endblock javascripts %}
@@ -0,0 +1,30 @@
1
+ import os
2
+ from decouple import config
3
+
4
+ try: from utils import read_yaml, abspath_for_sample_data
5
+ except: from customeranalytics.utils import read_yaml, abspath_for_sample_data
6
+
7
+
8
+ class Config(object):
9
+ basedir = os.path.abspath(os.path.dirname(__file__))
10
+ SECRET_KEY = config('SECRET_KEY', default='S#perS3crEt_007')
11
+ SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'db.sqlite3')
12
+ SQLALCHEMY_TRACK_MODIFICATIONS = False
13
+
14
+
15
+ class ProductionConfig(Config):
16
+ DEBUG = False
17
+ ALLOWED_IMAGE_EXTENSIONS = ["JPEG", "JPG", "PNG", "GIF"]
18
+ MAX_IMAGE_FILESIZE = 0.5 * 1024 * 1024
19
+
20
+
21
+ class DebugConfig(Config):
22
+ DEBUG = True
23
+ ALLOWED_IMAGE_EXTENSIONS = ["JPEG", "JPG", "PNG", "GIF"]
24
+ MAX_IMAGE_FILESIZE = 0.5 * 1024 * 1024
25
+
26
+
27
+ config_dict = {'Production': ProductionConfig, 'Debug': DebugConfig}
28
+ web_configs = read_yaml(os.path.join(abspath_for_sample_data(), "docs"), "web_configs.yaml")
29
+
30
+
Binary file
@@ -0,0 +1,30 @@
1
+ ## TODO: this will be updated
2
+ import sys, os, inspect
3
+ currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
4
+ parentdir = os.path.dirname(currentdir)
5
+ sys.path.insert(0, parentdir)
6
+
7
+ from flask_migrate import Migrate
8
+ from sys import exit
9
+ from decouple import config
10
+
11
+ try:
12
+ from web.config import config_dict, web_configs
13
+ from web.app import create_app, db
14
+
15
+ except Exception as e:
16
+ from customeranalytics.web.config import config_dict, web_configs
17
+ from customeranalytics.web.app import create_app, db
18
+
19
+
20
+ try:
21
+ # Load the configuration using the default values
22
+ app_config = config_dict['Debug']
23
+ except KeyError:
24
+ exit('Error: Invalid <config_mode>. Expected values [Debug, Production] ')
25
+
26
+ app = create_app(app_config)
27
+ Migrate(app, db)
28
+
29
+ if __name__ == "__main__":
30
+ app.run(port=web_configs['port'], host=web_configs['host'])