mdbq 2.3.9__tar.gz → 2.4.0__tar.gz

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 (51) hide show
  1. {mdbq-2.3.9 → mdbq-2.4.0}/PKG-INFO +1 -1
  2. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/aggregation/query_data.py +48 -1
  3. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/req_post/req_tb.py +2 -2
  4. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq.egg-info/PKG-INFO +1 -1
  5. {mdbq-2.3.9 → mdbq-2.4.0}/setup.py +1 -1
  6. {mdbq-2.3.9 → mdbq-2.4.0}/README.txt +0 -0
  7. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/__init__.py +0 -0
  8. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/__version__.py +0 -0
  9. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/aggregation/__init__.py +0 -0
  10. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/aggregation/aggregation.py +0 -0
  11. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/aggregation/df_types.py +0 -0
  12. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/aggregation/mysql_types.py +0 -0
  13. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/aggregation/optimize_data.py +0 -0
  14. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/bdup/__init__.py +0 -0
  15. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/bdup/bdup.py +0 -0
  16. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/clean/__init__.py +0 -0
  17. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/clean/data_clean.py +0 -0
  18. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/company/__init__.py +0 -0
  19. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/company/copysh.py +0 -0
  20. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/company/home_sh.py +0 -0
  21. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/config/__init__.py +0 -0
  22. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/config/get_myconf.py +0 -0
  23. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/config/products.py +0 -0
  24. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/config/set_support.py +0 -0
  25. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/config/update_conf.py +0 -0
  26. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/dataframe/__init__.py +0 -0
  27. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/dataframe/converter.py +0 -0
  28. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/log/__init__.py +0 -0
  29. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/log/mylogger.py +0 -0
  30. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/mongo/__init__.py +0 -0
  31. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/mongo/mongo.py +0 -0
  32. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/mysql/__init__.py +0 -0
  33. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/mysql/mysql.py +0 -0
  34. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/mysql/s_query.py +0 -0
  35. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/mysql/year_month_day.py +0 -0
  36. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/other/__init__.py +0 -0
  37. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/other/porxy.py +0 -0
  38. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/other/pov_city.py +0 -0
  39. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/other/sku_picture.py +0 -0
  40. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/other/ua_sj.py +0 -0
  41. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/pbix/__init__.py +0 -0
  42. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/pbix/pbix_refresh.py +0 -0
  43. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/pbix/refresh_all.py +0 -0
  44. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/pbix/refresh_all_old.py +0 -0
  45. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/req_post/__init__.py +0 -0
  46. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/spider/__init__.py +0 -0
  47. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq/spider/aikucun.py +0 -0
  48. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq.egg-info/SOURCES.txt +0 -0
  49. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq.egg-info/dependency_links.txt +0 -0
  50. {mdbq-2.3.9 → mdbq-2.4.0}/mdbq.egg-info/top_level.txt +0 -0
  51. {mdbq-2.3.9 → mdbq-2.4.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mdbq
3
- Version: 2.3.9
3
+ Version: 2.4.0
4
4
  Home-page: https://pypi.org/project/mdbsql
5
5
  Author: xigua,
6
6
  Author-email: 2587125111@qq.com
@@ -736,6 +736,44 @@ class MysqlDatasQuery:
736
736
  )
737
737
  return df
738
738
 
739
+ def dmp_crowd(self):
740
+ start_date, end_date = self.months_data(num=self.months)
741
+ projection = {
742
+ '日期': 1,
743
+ '人群id': 1,
744
+ '人群规模': 1,
745
+ '用户年龄': 1,
746
+ '消费能力等级': 1,
747
+ '用户性别': 1,
748
+ }
749
+ # projection = {}
750
+ df_crowd = self.download.data_to_df(
751
+ db_name='达摩盘2',
752
+ table_name='我的人群属性',
753
+ start_date=start_date,
754
+ end_date=end_date,
755
+ projection=projection,
756
+ )
757
+ df_crowd.sort_values('日期', ascending=True, ignore_index=True, inplace=True)
758
+ df_crowd.drop_duplicates(subset=['人群id',], keep='last', inplace=True, ignore_index=True)
759
+ df_crowd.pop('日期')
760
+ # print(df_crowd)
761
+
762
+ projection = {}
763
+ df_dmp = self.download.data_to_df(
764
+ db_name='推广数据2',
765
+ table_name='达摩盘_dmp报表',
766
+ start_date=start_date,
767
+ end_date=end_date,
768
+ projection=projection,
769
+ )
770
+ df_dmp.sort_values('日期', ascending=True, ignore_index=True, inplace=True)
771
+ df_dmp.drop_duplicates(subset=['日期', '人群id', '消耗(元)'], keep='last', inplace=True, ignore_index=True)
772
+ df = pd.merge(df_dmp, df_crowd, left_on=['人群id'], right_on=['人群id'], how='left')
773
+ # df.to_csv('/Users/xigua/Downloads/test3.csv', index=False, header=True, encoding='utf-8_sig')
774
+ return df
775
+
776
+
739
777
 
740
778
  class GroupBy:
741
779
  """
@@ -881,7 +919,7 @@ class GroupBy:
881
919
  '成交gmv',
882
920
  ], keep='last', inplace=True, ignore_index=True)
883
921
  return df
884
- elif '人群报表' in table_name:
922
+ elif '天猫_人群报表' in table_name and '达摩盘' not in table_name:
885
923
  df.rename(columns={
886
924
  '场景名字': '营销场景',
887
925
  '主体id': '商品id',
@@ -1403,6 +1441,9 @@ class GroupBy:
1403
1441
  df.sort_values(['日期', '店铺', '花费'], ascending=[False, False, False], ignore_index=True, inplace=True)
1404
1442
  # df.to_csv('/Users/xigua/Downloads/test.csv', encoding='utf-8_sig', index=False, header=True)
1405
1443
  return df
1444
+ elif '达摩盘_人群报表' in table_name:
1445
+ return df
1446
+
1406
1447
  else:
1407
1448
  print(f'<{table_name}>: Groupby 类尚未配置,数据为空')
1408
1449
  return pd.DataFrame({})
@@ -1942,6 +1983,12 @@ def data_aggregation(service_databases=[{}], months=1):
1942
1983
  '唯一主键': [],
1943
1984
  '数据主体': sdq.aikucun_bd_spu(),
1944
1985
  },
1986
+ {
1987
+ '数据库名': '聚合数据',
1988
+ '集合名': '达摩盘_人群报表',
1989
+ '唯一主键': [],
1990
+ '数据主体': sdq.dmp_crowd(),
1991
+ },
1945
1992
  ]
1946
1993
  for items in data_dict: # 遍历返回结果
1947
1994
  db_name, table_name, unique_key_list, df = items['数据库名'], items['集合名'], items['唯一主键'], items['数据主体']
@@ -574,8 +574,8 @@ def company_run(service_databases=[]):
574
574
  r.is_json_file = False
575
575
 
576
576
  my_data_list = [
577
- r.ys_ll_data(), # 双 11预售实时流量分析
578
- r.qxg_hx_data(), # 抢先购 预热期核心指标
577
+ # r.ys_ll_data(), # 双 11预售实时流量分析
578
+ # r.qxg_hx_data(), # 抢先购 预热期核心指标
579
579
  r.qxg_ll() # 抢先购 流量来源
580
580
  ]
581
581
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mdbq
3
- Version: 2.3.9
3
+ Version: 2.4.0
4
4
  Home-page: https://pypi.org/project/mdbsql
5
5
  Author: xigua,
6
6
  Author-email: 2587125111@qq.com
@@ -3,7 +3,7 @@
3
3
  from setuptools import setup, find_packages
4
4
 
5
5
  setup(name='mdbq',
6
- version='2.3.9',
6
+ version='2.4.0',
7
7
  author='xigua, ',
8
8
  author_email="2587125111@qq.com",
9
9
  url='https://pypi.org/project/mdbsql',
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes