mpdt 0.2.2__tar.gz → 0.2.3__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 (30) hide show
  1. {mpdt-0.2.2 → mpdt-0.2.3}/PKG-INFO +1 -1
  2. {mpdt-0.2.2 → mpdt-0.2.3}/mpdt/__init__.py +1 -1
  3. {mpdt-0.2.2 → mpdt-0.2.3}/mpdt/fetchers/publish_list.py +5 -0
  4. {mpdt-0.2.2 → mpdt-0.2.3}/mpdt.egg-info/PKG-INFO +1 -1
  5. {mpdt-0.2.2 → mpdt-0.2.3}/pyproject.toml +1 -1
  6. {mpdt-0.2.2 → mpdt-0.2.3}/tests/test_fetchers.py +14 -0
  7. {mpdt-0.2.2 → mpdt-0.2.3}/LICENSE +0 -0
  8. {mpdt-0.2.2 → mpdt-0.2.3}/README.md +0 -0
  9. {mpdt-0.2.2 → mpdt-0.2.3}/mpdt/__main__.py +0 -0
  10. {mpdt-0.2.2 → mpdt-0.2.3}/mpdt/cli.py +0 -0
  11. {mpdt-0.2.2 → mpdt-0.2.3}/mpdt/config.py +0 -0
  12. {mpdt-0.2.2 → mpdt-0.2.3}/mpdt/errors.py +0 -0
  13. {mpdt-0.2.2 → mpdt-0.2.3}/mpdt/fetchers/__init__.py +0 -0
  14. {mpdt-0.2.2 → mpdt-0.2.3}/mpdt/fetchers/article_detail.py +0 -0
  15. {mpdt-0.2.2 → mpdt-0.2.3}/mpdt/fetchers/datacube.py +0 -0
  16. {mpdt-0.2.2 → mpdt-0.2.3}/mpdt/metrics.py +0 -0
  17. {mpdt-0.2.2 → mpdt-0.2.3}/mpdt/report.py +0 -0
  18. {mpdt-0.2.2 → mpdt-0.2.3}/mpdt/session.py +0 -0
  19. {mpdt-0.2.2 → mpdt-0.2.3}/mpdt/store.py +0 -0
  20. {mpdt-0.2.2 → mpdt-0.2.3}/mpdt.egg-info/SOURCES.txt +0 -0
  21. {mpdt-0.2.2 → mpdt-0.2.3}/mpdt.egg-info/dependency_links.txt +0 -0
  22. {mpdt-0.2.2 → mpdt-0.2.3}/mpdt.egg-info/entry_points.txt +0 -0
  23. {mpdt-0.2.2 → mpdt-0.2.3}/mpdt.egg-info/requires.txt +0 -0
  24. {mpdt-0.2.2 → mpdt-0.2.3}/mpdt.egg-info/top_level.txt +0 -0
  25. {mpdt-0.2.2 → mpdt-0.2.3}/setup.cfg +0 -0
  26. {mpdt-0.2.2 → mpdt-0.2.3}/tests/test_cli.py +0 -0
  27. {mpdt-0.2.2 → mpdt-0.2.3}/tests/test_config.py +0 -0
  28. {mpdt-0.2.2 → mpdt-0.2.3}/tests/test_metrics.py +0 -0
  29. {mpdt-0.2.2 → mpdt-0.2.3}/tests/test_report.py +0 -0
  30. {mpdt-0.2.2 → mpdt-0.2.3}/tests/test_store.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mpdt
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: 公众号运营数据本地 CLI:把后台三源数据抓回本机 SQLite,一键生成周报
5
5
  Author: ttxs69
6
6
  License: MIT
@@ -6,4 +6,4 @@
6
6
  3 凭据问题(token 刷新失败)
7
7
  4 上游接口异常(结构变更,含原始返回片段)
8
8
  """
9
- __version__ = '0.2.2'
9
+ __version__ = '0.2.3'
@@ -53,6 +53,11 @@ def parse_publish_list(raw: str) -> dict:
53
53
  if not isinstance(info, dict):
54
54
  continue
55
55
  ct = (info.get('publish_info') or {}).get('create_time')
56
+ if not (isinstance(ct, int) and ct > 0):
57
+ # 贴图类(type=9 群发图)publish_info 为空对象,群发时间在 sent_info.time
58
+ # (R70 实证:2247485215 sent_info.time=1792145145 = 2026-10-16 18:05:45+08,
59
+ # 与 publish-read.py 实查 create_time 一致;保持 article 侧口径=群发时刻)
60
+ ct = (info.get('sent_info') or {}).get('time')
56
61
  pub_date = ''
57
62
  if isinstance(ct, int) and ct > 0:
58
63
  pub_date = _dt.datetime.fromtimestamp(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mpdt
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: 公众号运营数据本地 CLI:把后台三源数据抓回本机 SQLite,一键生成周报
5
5
  Author: ttxs69
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "mpdt"
7
- version = "0.2.2"
7
+ version = "0.2.3"
8
8
  description = "公众号运营数据本地 CLI:把后台三源数据抓回本机 SQLite,一键生成周报"
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
@@ -28,6 +28,20 @@ class TestPublishList(unittest.TestCase):
28
28
  for k in ('appmsgid', 'itemidx', 'title', 'read_num', 'share_num', 'like_num'):
29
29
  self.assertIn(k, a)
30
30
 
31
+ def test_pic_type_gets_publish_date_from_sent_info(self):
32
+ # R70:贴图类 publish_info 为空对象,时间戳在 sent_info.time(群发时间)。
33
+ # 实证:2247485215 sent_info.time=1792145145 → 2026-10-16 18:05:45+08,
34
+ # 与 PIC-rea 实查 t0(publish-read.py create_time)完全一致。
35
+ out = parse_publish_list(self.raw)
36
+ by_id = {a['appmsgid']: a for a in out['articles']}
37
+ a = by_id.get(2247485215)
38
+ self.assertIsNotNone(a, 'fixture 应含贴图样本 2247485215')
39
+ self.assertEqual(a['publish_date'], '2026-10-16')
40
+ self.assertEqual(a['create_time'], 1792145145)
41
+ b = by_id.get(2247485156)
42
+ self.assertIsNotNone(b, 'fixture 应含贴图样本 2247485156')
43
+ self.assertEqual(b['publish_date'], '2026-10-16')
44
+
31
45
  def test_structure_change_raises_upstream_4(self):
32
46
  with self.assertRaises(UpstreamError):
33
47
  parse_publish_list('{"base_resp":{"ret":0},"publish_page":"not json"}')
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