ezKit 2.0.24__tar.gz → 2.0.26__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ezKit
3
- Version: 2.0.24
3
+ Version: 2.0.26
4
4
  Summary: Easy Kit
5
5
  Author: septvean
6
6
  Author-email: septvean@gmail.com
@@ -1,6 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  from dataclasses import dataclass
4
+ from datetime import datetime, timedelta, timezone
4
5
  from typing import Any
5
6
 
6
7
  import requests
@@ -93,4 +94,12 @@ def format_bandwidth(info: dict) -> str:
93
94
  # 使用率
94
95
  usage = (info["data_counter"] / info["plan_monthly_data"]) * 100
95
96
 
96
- return f"{used:.2f}/{total:.2f} GB ({usage:.2f}%)"
97
+ return f"{used:.2f}/{total} GB ({usage:.2f}%)"
98
+
99
+
100
+ def expiration_date(info: dict) -> str:
101
+ # 过期时间
102
+ # 通过 getLiveServiceInfo 获取 data_next_reset 字段 (秒级时间戳)
103
+ # 将时间戳转为 UTC+8 时间
104
+ date = datetime.fromtimestamp(info["data_next_reset"], tz=timezone(timedelta(hours=8))).strftime("%Y-%m-%d")
105
+ return date
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ezKit
3
- Version: 2.0.24
3
+ Version: 2.0.26
4
4
  Summary: Easy Kit
5
5
  Author: septvean
6
6
  Author-email: septvean@gmail.com
@@ -4,7 +4,7 @@ from setuptools import find_packages, setup
4
4
 
5
5
  setup(
6
6
  name="ezKit",
7
- version="2.0.24",
7
+ version="2.0.26",
8
8
  author="septvean",
9
9
  author_email="septvean@gmail.com",
10
10
  description="Easy Kit",
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