staran 0.1.0__py3-none-any.whl → 0.1.2__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.
- staran/__init__.py +21 -0
- staran/tools/__init__.py +20 -0
- staran/tools/date.py +207 -0
- staran-0.1.2.dist-info/METADATA +225 -0
- staran-0.1.2.dist-info/RECORD +8 -0
- {staran-0.1.0.dist-info → staran-0.1.2.dist-info}/WHEEL +0 -0
- staran-0.1.2.dist-info/top_level.txt +1 -0
- ._staran-0.1.0.dist-info +0 -0
- ._tools +0 -0
- staran-0.1.0.dist-info/._METADATA +0 -0
- staran-0.1.0.dist-info/._PKG-INFO +0 -0
- staran-0.1.0.dist-info/._SOURCES.txt +0 -0
- staran-0.1.0.dist-info/._WHEEL +0 -0
- staran-0.1.0.dist-info/._licenses +0 -0
- staran-0.1.0.dist-info/._requires.txt +0 -0
- staran-0.1.0.dist-info/._top_level.txt +0 -0
- staran-0.1.0.dist-info/METADATA +0 -26
- staran-0.1.0.dist-info/RECORD +0 -26
- staran-0.1.0.dist-info/licenses/._LICENSE +0 -0
- staran-0.1.0.dist-info/top_level.txt +0 -1
- tools/.___init__.py +0 -0
- tools/._date +0 -0
- tools/__init__.py +0 -70
- tools/date/.___init__.py +0 -0
- tools/date/._build_simple.py +0 -0
- tools/date/._date.py +0 -0
- tools/date/._platform_utils.py +0 -0
- tools/date/__init__.py +0 -60
- tools/date/build_simple.py +0 -109
- tools/date/date.py +0 -857
- tools/date/platform_utils.py +0 -189
- {staran-0.1.0.dist-info → staran-0.1.2.dist-info}/licenses/LICENSE +0 -0
staran/__init__.py
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
"""
|
5
|
+
Staran - 简化的Python工具库
|
6
|
+
提供日期处理等实用功能,基于Python标准库实现
|
7
|
+
"""
|
8
|
+
|
9
|
+
# 导入主要功能
|
10
|
+
from .tools import Date
|
11
|
+
|
12
|
+
# 主要导出
|
13
|
+
__all__ = [
|
14
|
+
'Date'
|
15
|
+
]
|
16
|
+
|
17
|
+
# 包信息
|
18
|
+
__version__ = '1.0.0'
|
19
|
+
__author__ = 'Staran Team'
|
20
|
+
__description__ = 'Simple Python utilities based on standard library'
|
21
|
+
__license__ = 'MIT'
|
staran/tools/__init__.py
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
"""
|
5
|
+
Staran Tools - 简化的工具集合
|
6
|
+
提供日期处理等实用功能
|
7
|
+
"""
|
8
|
+
|
9
|
+
# 导入date模块的主要类和函数
|
10
|
+
from .date import Date
|
11
|
+
|
12
|
+
# 主要导出
|
13
|
+
__all__ = [
|
14
|
+
'Date'
|
15
|
+
]
|
16
|
+
|
17
|
+
# 模块信息
|
18
|
+
__version__ = '1.0.0'
|
19
|
+
__author__ = 'Staran Team'
|
20
|
+
__description__ = 'Staran simple tools collection'
|
staran/tools/date.py
ADDED
@@ -0,0 +1,207 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
"""
|
5
|
+
简化的Date类 - 纯Python实现
|
6
|
+
使用datetime包提供日期处理功能
|
7
|
+
"""
|
8
|
+
|
9
|
+
import datetime
|
10
|
+
import calendar
|
11
|
+
import re
|
12
|
+
|
13
|
+
class Date:
|
14
|
+
"""简化的日期类,基于Python datetime实现"""
|
15
|
+
|
16
|
+
def __init__(self, *args, **kwargs):
|
17
|
+
"""
|
18
|
+
初始化日期对象
|
19
|
+
支持多种创建方式:
|
20
|
+
- Date() - 今日
|
21
|
+
- Date(year, month, day) - 指定日期
|
22
|
+
- Date('20240615') - 从字符串
|
23
|
+
- Date(year=2024, month=6, day=15) - 关键字参数
|
24
|
+
"""
|
25
|
+
if not args and not kwargs:
|
26
|
+
# 无参数 - 今日
|
27
|
+
today = datetime.date.today()
|
28
|
+
self.year, self.month, self.day = today.year, today.month, today.day
|
29
|
+
elif len(args) == 1 and isinstance(args[0], str):
|
30
|
+
# 字符串参数
|
31
|
+
self._init_from_string(args[0])
|
32
|
+
elif len(args) == 1 and isinstance(args[0], int):
|
33
|
+
# 单个整数参数 - 视为时间戳
|
34
|
+
dt = datetime.datetime.fromtimestamp(args[0])
|
35
|
+
self.year, self.month, self.day = dt.year, dt.month, dt.day
|
36
|
+
elif len(args) in [2, 3]:
|
37
|
+
# 位置参数
|
38
|
+
self._init_from_args(args)
|
39
|
+
elif kwargs:
|
40
|
+
# 关键字参数
|
41
|
+
self._init_from_kwargs(kwargs)
|
42
|
+
else:
|
43
|
+
raise ValueError("Invalid arguments for Date initialization")
|
44
|
+
|
45
|
+
# 验证日期有效性
|
46
|
+
self._validate_date()
|
47
|
+
|
48
|
+
def _init_from_string(self, date_string):
|
49
|
+
"""从字符串初始化日期"""
|
50
|
+
# 移除所有分隔符
|
51
|
+
clean_string = re.sub(r'[^\d]', '', date_string)
|
52
|
+
|
53
|
+
if len(clean_string) == 6: # YYYYMM
|
54
|
+
self.year = int(clean_string[:4])
|
55
|
+
self.month = int(clean_string[4:6])
|
56
|
+
self.day = 1
|
57
|
+
elif len(clean_string) == 8: # YYYYMMDD
|
58
|
+
self.year = int(clean_string[:4])
|
59
|
+
self.month = int(clean_string[4:6])
|
60
|
+
self.day = int(clean_string[6:8])
|
61
|
+
else:
|
62
|
+
raise ValueError(f"Date string must be 6 (YYYYMM) or 8 (YYYYMMDD) digits after removing separators, got {len(clean_string)}")
|
63
|
+
|
64
|
+
def _init_from_args(self, args):
|
65
|
+
"""从位置参数初始化日期"""
|
66
|
+
if len(args) == 2:
|
67
|
+
self.year, self.month = args
|
68
|
+
self.day = 1
|
69
|
+
elif len(args) == 3:
|
70
|
+
self.year, self.month, self.day = args
|
71
|
+
else:
|
72
|
+
raise ValueError("Expected 2 or 3 positional arguments")
|
73
|
+
|
74
|
+
def _init_from_kwargs(self, kwargs):
|
75
|
+
"""从关键字参数初始化日期"""
|
76
|
+
self.year = kwargs.get('year')
|
77
|
+
self.month = kwargs.get('month')
|
78
|
+
self.day = kwargs.get('day', 1)
|
79
|
+
|
80
|
+
if self.year is None or self.month is None:
|
81
|
+
raise ValueError("year and month are required")
|
82
|
+
|
83
|
+
def _validate_date(self):
|
84
|
+
"""验证日期有效性"""
|
85
|
+
if not isinstance(self.year, int) or self.year <= 0:
|
86
|
+
raise ValueError(f"Year must be positive, got {self.year}")
|
87
|
+
|
88
|
+
if not isinstance(self.month, int) or not (1 <= self.month <= 12):
|
89
|
+
raise ValueError(f"Month must be between 1 and 12, got {self.month}")
|
90
|
+
|
91
|
+
if not isinstance(self.day, int) or self.day <= 0:
|
92
|
+
raise ValueError(f"Day must be positive, got {self.day}")
|
93
|
+
|
94
|
+
# 检查日期是否在该月的有效范围内
|
95
|
+
max_day = calendar.monthrange(self.year, self.month)[1]
|
96
|
+
if self.day > max_day:
|
97
|
+
raise ValueError(f"Day {self.day} is invalid for {self.year}-{self.month:02d}")
|
98
|
+
|
99
|
+
def to_timestamp(self):
|
100
|
+
"""转换为时间戳"""
|
101
|
+
dt = datetime.datetime.combine(
|
102
|
+
datetime.date(self.year, self.month, self.day),
|
103
|
+
datetime.time()
|
104
|
+
)
|
105
|
+
return dt.timestamp()
|
106
|
+
|
107
|
+
def to_date(self):
|
108
|
+
"""转换为Python datetime.date对象"""
|
109
|
+
return datetime.date(self.year, self.month, self.day)
|
110
|
+
|
111
|
+
def to_datetime(self):
|
112
|
+
"""转换为Python datetime.datetime对象"""
|
113
|
+
return datetime.datetime(self.year, self.month, self.day)
|
114
|
+
|
115
|
+
def format(self, fmt='%Y-%m-%d'):
|
116
|
+
"""格式化日期字符串"""
|
117
|
+
return self.to_date().strftime(fmt)
|
118
|
+
|
119
|
+
def weekday(self):
|
120
|
+
"""返回星期几(0=Monday, 6=Sunday)"""
|
121
|
+
return self.to_date().weekday()
|
122
|
+
|
123
|
+
def isoweekday(self):
|
124
|
+
"""返回星期几(1=Monday, 7=Sunday)"""
|
125
|
+
return self.to_date().isoweekday()
|
126
|
+
|
127
|
+
def is_leap_year(self):
|
128
|
+
"""判断是否为闰年"""
|
129
|
+
return calendar.isleap(self.year)
|
130
|
+
|
131
|
+
def days_in_month(self):
|
132
|
+
"""返回当月天数"""
|
133
|
+
return calendar.monthrange(self.year, self.month)[1]
|
134
|
+
|
135
|
+
def days_in_year(self):
|
136
|
+
"""返回当年天数"""
|
137
|
+
return 366 if self.is_leap_year() else 365
|
138
|
+
|
139
|
+
def add_days(self, days):
|
140
|
+
"""增加天数,返回新的Date对象"""
|
141
|
+
new_date = self.to_date() + datetime.timedelta(days=days)
|
142
|
+
return Date(new_date.year, new_date.month, new_date.day)
|
143
|
+
|
144
|
+
def add_months(self, months):
|
145
|
+
"""增加月数,返回新的Date对象"""
|
146
|
+
new_month = self.month + months
|
147
|
+
new_year = self.year
|
148
|
+
|
149
|
+
while new_month > 12:
|
150
|
+
new_month -= 12
|
151
|
+
new_year += 1
|
152
|
+
while new_month < 1:
|
153
|
+
new_month += 12
|
154
|
+
new_year -= 1
|
155
|
+
|
156
|
+
# 处理日期溢出(如1月31日+1个月=2月28/29日)
|
157
|
+
max_day = calendar.monthrange(new_year, new_month)[1]
|
158
|
+
new_day = min(self.day, max_day)
|
159
|
+
|
160
|
+
return Date(new_year, new_month, new_day)
|
161
|
+
|
162
|
+
def difference(self, other):
|
163
|
+
"""计算与另一个日期的天数差"""
|
164
|
+
if not isinstance(other, Date):
|
165
|
+
raise TypeError("Expected Date object")
|
166
|
+
|
167
|
+
date1 = self.to_date()
|
168
|
+
date2 = other.to_date()
|
169
|
+
return (date1 - date2).days
|
170
|
+
|
171
|
+
def __str__(self):
|
172
|
+
"""字符串表示"""
|
173
|
+
return f"{self.year}-{self.month:02d}-{self.day:02d}"
|
174
|
+
|
175
|
+
def __repr__(self):
|
176
|
+
"""调试表示"""
|
177
|
+
return f"Date({self.year}, {self.month}, {self.day})"
|
178
|
+
|
179
|
+
def __eq__(self, other):
|
180
|
+
"""相等比较"""
|
181
|
+
if not isinstance(other, Date):
|
182
|
+
return False
|
183
|
+
return (self.year, self.month, self.day) == (other.year, other.month, other.day)
|
184
|
+
|
185
|
+
def __lt__(self, other):
|
186
|
+
"""小于比较"""
|
187
|
+
if not isinstance(other, Date):
|
188
|
+
return NotImplemented
|
189
|
+
return (self.year, self.month, self.day) < (other.year, other.month, other.day)
|
190
|
+
|
191
|
+
def __le__(self, other):
|
192
|
+
"""小于等于比较"""
|
193
|
+
return self < other or self == other
|
194
|
+
|
195
|
+
def __gt__(self, other):
|
196
|
+
"""大于比较"""
|
197
|
+
if not isinstance(other, Date):
|
198
|
+
return NotImplemented
|
199
|
+
return (self.year, self.month, self.day) > (other.year, other.month, other.day)
|
200
|
+
|
201
|
+
def __ge__(self, other):
|
202
|
+
"""大于等于比较"""
|
203
|
+
return self > other or self == other
|
204
|
+
|
205
|
+
def __hash__(self):
|
206
|
+
"""哈希值"""
|
207
|
+
return hash((self.year, self.month, self.day))
|
@@ -0,0 +1,225 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: staran
|
3
|
+
Version: 0.1.2
|
4
|
+
Summary: staran - 高性能Python工具库
|
5
|
+
Home-page: https://github.com/starlxa/staran
|
6
|
+
Author: StarAn
|
7
|
+
Author-email: starlxa@icloud.com
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
10
|
+
Requires-Python: >=3.7
|
11
|
+
Description-Content-Type: text/markdown
|
12
|
+
License-File: LICENSE
|
13
|
+
Requires-Dist: numpy>=1.20
|
14
|
+
Requires-Dist: pandas
|
15
|
+
Dynamic: author
|
16
|
+
Dynamic: author-email
|
17
|
+
Dynamic: classifier
|
18
|
+
Dynamic: description
|
19
|
+
Dynamic: description-content-type
|
20
|
+
Dynamic: home-page
|
21
|
+
Dynamic: license-file
|
22
|
+
Dynamic: requires-dist
|
23
|
+
Dynamic: requires-python
|
24
|
+
Dynamic: summary
|
25
|
+
|
26
|
+
# Staran - 简化的Python日期工具库
|
27
|
+
|
28
|
+
## 📅 简洁高效的日期处理
|
29
|
+
|
30
|
+
Staran是一个基于Python标准库的简洁日期工具库,提供直观易用的API,无需复杂依赖。
|
31
|
+
|
32
|
+
## 🚀 快速开始
|
33
|
+
|
34
|
+
### 安装
|
35
|
+
```bash
|
36
|
+
pip install staran
|
37
|
+
```
|
38
|
+
|
39
|
+
### 基本使用
|
40
|
+
|
41
|
+
```python
|
42
|
+
from staran import Date, today, from_string
|
43
|
+
|
44
|
+
# 创建日期
|
45
|
+
today_date = today() # 今日
|
46
|
+
birthday = Date(1990, 5, 15) # 指定日期
|
47
|
+
event = from_string('20240615') # 从字符串
|
48
|
+
|
49
|
+
print(f"今天是: {today_date}")
|
50
|
+
print(f"生日: {birthday}")
|
51
|
+
print(f"活动日期: {event}")
|
52
|
+
```
|
53
|
+
|
54
|
+
## 📖 功能特性
|
55
|
+
|
56
|
+
### 1. 多种创建方式
|
57
|
+
```python
|
58
|
+
from tools.date import Date
|
59
|
+
|
60
|
+
# 方式1: 无参数 - 今日
|
61
|
+
today = Date()
|
62
|
+
|
63
|
+
# 方式2: 指定年月日
|
64
|
+
birthday = Date(1990, 5, 15)
|
65
|
+
|
66
|
+
# 方式3: 从字符串
|
67
|
+
event1 = Date('20240615') # YYYYMMDD
|
68
|
+
event2 = Date('2024-06-15') # 带分隔符
|
69
|
+
monthly = Date('202406') # YYYYMM (日期默认为1号)
|
70
|
+
|
71
|
+
# 方式4: 关键字参数
|
72
|
+
deadline = Date(year=2024, month=12, day=31)
|
73
|
+
```
|
74
|
+
|
75
|
+
### 2. 日期运算
|
76
|
+
```python
|
77
|
+
date = Date(2024, 6, 15)
|
78
|
+
|
79
|
+
# 加减天数
|
80
|
+
tomorrow = date.add_days(1)
|
81
|
+
last_week = date.add_days(-7)
|
82
|
+
|
83
|
+
# 加减月份
|
84
|
+
next_month = date.add_months(1)
|
85
|
+
last_year = date.add_months(-12)
|
86
|
+
|
87
|
+
# 计算日期差
|
88
|
+
diff_days = date.difference(Date(2024, 6, 1)) # 14天
|
89
|
+
```
|
90
|
+
|
91
|
+
### 3. 格式化和转换
|
92
|
+
```python
|
93
|
+
date = Date(2024, 6, 15)
|
94
|
+
|
95
|
+
# 格式化
|
96
|
+
print(date.format('%Y-%m-%d')) # 2024-06-15
|
97
|
+
print(date.format('%Y年%m月%d日')) # 2024年06月15日
|
98
|
+
|
99
|
+
# 转换
|
100
|
+
timestamp = date.to_timestamp() # 时间戳
|
101
|
+
dt_date = date.to_date() # datetime.date对象
|
102
|
+
dt_datetime = date.to_datetime() # datetime.datetime对象
|
103
|
+
```
|
104
|
+
|
105
|
+
### 4. 日期信息
|
106
|
+
```python
|
107
|
+
date = Date(2024, 6, 15)
|
108
|
+
|
109
|
+
# 基本信息
|
110
|
+
print(f"是否闰年: {date.is_leap_year()}") # False
|
111
|
+
print(f"星期几: {date.weekday()}") # 5 (Saturday)
|
112
|
+
print(f"当月天数: {date.days_in_month()}") # 30
|
113
|
+
print(f"当年天数: {date.days_in_year()}") # 365
|
114
|
+
```
|
115
|
+
|
116
|
+
### 5. 日期比较
|
117
|
+
```python
|
118
|
+
date1 = Date(2024, 6, 15)
|
119
|
+
date2 = Date(2024, 6, 16)
|
120
|
+
|
121
|
+
print(date1 < date2) # True
|
122
|
+
print(date1 == Date(2024, 6, 15)) # True
|
123
|
+
print(date1 >= date2) # False
|
124
|
+
```
|
125
|
+
|
126
|
+
## 🎯 设计理念
|
127
|
+
|
128
|
+
### 简洁性
|
129
|
+
- 基于Python标准库,无额外依赖
|
130
|
+
- 直观的API设计
|
131
|
+
- 清晰的错误消息
|
132
|
+
|
133
|
+
### 可靠性
|
134
|
+
- 完整的日期验证
|
135
|
+
- 处理边界情况(如闰年、月末)
|
136
|
+
- 标准的Python对象行为
|
137
|
+
|
138
|
+
### 实用性
|
139
|
+
- 支持常见的日期操作
|
140
|
+
- 灵活的创建方式
|
141
|
+
- 便捷的格式化选项
|
142
|
+
|
143
|
+
## 📁 项目结构
|
144
|
+
|
145
|
+
```
|
146
|
+
staran/
|
147
|
+
├── __init__.py # 主包入口
|
148
|
+
├── setup.py # 安装配置
|
149
|
+
├── LICENSE # MIT许可证
|
150
|
+
├── README.md # 本文档
|
151
|
+
├── test_simple.py # 功能测试
|
152
|
+
└── tools/ # 核心模块
|
153
|
+
├── __init__.py # 工具模块入口
|
154
|
+
└── date/ # 日期功能
|
155
|
+
├── __init__.py # 日期模块入口
|
156
|
+
└── date.py # Date类实现
|
157
|
+
```
|
158
|
+
|
159
|
+
## 🧪 测试
|
160
|
+
|
161
|
+
```bash
|
162
|
+
# 运行测试
|
163
|
+
python test_simple.py
|
164
|
+
```
|
165
|
+
|
166
|
+
预期输出:
|
167
|
+
```
|
168
|
+
📅 简化Date类测试
|
169
|
+
==============================
|
170
|
+
1. 基本创建:
|
171
|
+
今日: 2025-07-28
|
172
|
+
指定日期: 2024-06-15
|
173
|
+
从字符串: 2024-06-15
|
174
|
+
|
175
|
+
2. 日期操作:
|
176
|
+
明天: 2025-07-29
|
177
|
+
下月: 2025-08-28
|
178
|
+
|
179
|
+
3. 时间戳转换:
|
180
|
+
2024-06-15 时间戳: 1718380800.0
|
181
|
+
|
182
|
+
4. 格式化:
|
183
|
+
格式化: 2024年06月15日
|
184
|
+
|
185
|
+
5. 日期比较:
|
186
|
+
2024-06-15 < 2024-06-16: True
|
187
|
+
2024-06-15 == Date(2024, 6, 15): True
|
188
|
+
|
189
|
+
✅ 所有测试通过!
|
190
|
+
```
|
191
|
+
|
192
|
+
## 📋 API参考
|
193
|
+
|
194
|
+
### Date类
|
195
|
+
|
196
|
+
#### 构造方法
|
197
|
+
- `Date()` - 创建今日日期
|
198
|
+
- `Date(year, month, day)` - 指定年月日
|
199
|
+
- `Date(date_string)` - 从字符串创建
|
200
|
+
- `Date(year=y, month=m, day=d)` - 关键字参数
|
201
|
+
|
202
|
+
#### 核心方法
|
203
|
+
- `add_days(days)` - 增加/减少天数
|
204
|
+
- `add_months(months)` - 增加/减少月数
|
205
|
+
- `difference(other)` - 计算日期差
|
206
|
+
- `format(fmt)` - 格式化字符串
|
207
|
+
- `to_timestamp()` - 转换为时间戳
|
208
|
+
- `is_leap_year()` - 判断闰年
|
209
|
+
|
210
|
+
#### 便捷函数
|
211
|
+
- `today()` - 获取今日
|
212
|
+
- `from_string(s)` - 从字符串创建
|
213
|
+
- `from_timestamp(ts)` - 从时间戳创建
|
214
|
+
|
215
|
+
## 📄 许可证
|
216
|
+
|
217
|
+
MIT License - 详见 [LICENSE](LICENSE) 文件
|
218
|
+
|
219
|
+
## 🤝 贡献
|
220
|
+
|
221
|
+
欢迎提交Issue和Pull Request!
|
222
|
+
|
223
|
+
---
|
224
|
+
|
225
|
+
**Staran** - 让日期处理变得简单 🌟
|
@@ -0,0 +1,8 @@
|
|
1
|
+
staran/__init__.py,sha256=wSMdNd2y24sehitRAG7wOaewvcMQGbzWCKf9RMTt-3I,393
|
2
|
+
staran/tools/__init__.py,sha256=FHWxsrVTBYoqcZaMgbZacRbDZWliqUN8gsS4F0I_rDQ,348
|
3
|
+
staran/tools/date.py,sha256=UNydI8UyxgjcI1FTnLe0efPK_W6xE_xzgo1bhPU4xNM,7181
|
4
|
+
staran-0.1.2.dist-info/licenses/LICENSE,sha256=2EmsBIyDCono4iVXNpv5_px9qt2b7hfPq1WuyGVMNP4,1361
|
5
|
+
staran-0.1.2.dist-info/METADATA,sha256=VVS6or4C42EOP3_gaZrMT6ZJDBOqJI_PrUCGgA4sPEg,5046
|
6
|
+
staran-0.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
7
|
+
staran-0.1.2.dist-info/top_level.txt,sha256=NOUZtXSh5oSIEjHrC0lQ9WmoKtD010Q00dghWyag-Zs,7
|
8
|
+
staran-0.1.2.dist-info/RECORD,,
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
staran
|
._staran-0.1.0.dist-info
DELETED
Binary file
|
._tools
DELETED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
staran-0.1.0.dist-info/._WHEEL
DELETED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
staran-0.1.0.dist-info/METADATA
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: staran
|
3
|
-
Version: 0.1.0
|
4
|
-
Summary: A short description of your package
|
5
|
-
Home-page: https://github.com/starlxa/staran
|
6
|
-
Author: StarAn
|
7
|
-
Author-email: starlxa@icloud.com
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
9
|
-
Classifier: License :: OSI Approved :: MIT License
|
10
|
-
Requires-Python: >=3.7
|
11
|
-
Description-Content-Type: text/markdown
|
12
|
-
License-File: LICENSE
|
13
|
-
Requires-Dist: numpy>=1.20
|
14
|
-
Requires-Dist: pandas
|
15
|
-
Dynamic: author
|
16
|
-
Dynamic: author-email
|
17
|
-
Dynamic: classifier
|
18
|
-
Dynamic: description
|
19
|
-
Dynamic: description-content-type
|
20
|
-
Dynamic: home-page
|
21
|
-
Dynamic: license-file
|
22
|
-
Dynamic: requires-dist
|
23
|
-
Dynamic: requires-python
|
24
|
-
Dynamic: summary
|
25
|
-
|
26
|
-
## STARAN TOOL
|
staran-0.1.0.dist-info/RECORD
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
._staran-0.1.0.dist-info,sha256=3_uwfdZqkY0vpvvPcxyU7-uCuMfSkGWarTVY5AY-mtg,4096
|
2
|
-
._tools,sha256=3_uwfdZqkY0vpvvPcxyU7-uCuMfSkGWarTVY5AY-mtg,4096
|
3
|
-
staran-0.1.0.dist-info/licenses/._LICENSE,sha256=3_uwfdZqkY0vpvvPcxyU7-uCuMfSkGWarTVY5AY-mtg,4096
|
4
|
-
staran-0.1.0.dist-info/licenses/LICENSE,sha256=2EmsBIyDCono4iVXNpv5_px9qt2b7hfPq1WuyGVMNP4,1361
|
5
|
-
tools/.___init__.py,sha256=3_uwfdZqkY0vpvvPcxyU7-uCuMfSkGWarTVY5AY-mtg,4096
|
6
|
-
tools/._date,sha256=3_uwfdZqkY0vpvvPcxyU7-uCuMfSkGWarTVY5AY-mtg,4096
|
7
|
-
tools/__init__.py,sha256=EfuYgERy0MGLzOrniACgZFc4r_ODDcMl9FAvl0h5b_8,1451
|
8
|
-
tools/date/.___init__.py,sha256=3_uwfdZqkY0vpvvPcxyU7-uCuMfSkGWarTVY5AY-mtg,4096
|
9
|
-
tools/date/._build_simple.py,sha256=3_uwfdZqkY0vpvvPcxyU7-uCuMfSkGWarTVY5AY-mtg,4096
|
10
|
-
tools/date/._date.py,sha256=3_uwfdZqkY0vpvvPcxyU7-uCuMfSkGWarTVY5AY-mtg,4096
|
11
|
-
tools/date/._platform_utils.py,sha256=3_uwfdZqkY0vpvvPcxyU7-uCuMfSkGWarTVY5AY-mtg,4096
|
12
|
-
tools/date/__init__.py,sha256=pC-SxWTrimjy2cSzwm-zkcV2b3Kg3zqWkJrNaehFXjA,1370
|
13
|
-
tools/date/build_simple.py,sha256=ImbpceY3DRY4mAodJtN8RazmVAlhZ5_Lly-dujIa_qs,3006
|
14
|
-
tools/date/date.py,sha256=-T_8NSUyEb5Ww3wHeM6h9BvWP7djzZk3NdryYqpz4uE,28552
|
15
|
-
tools/date/platform_utils.py,sha256=FVQ_YT4J_EG80pwHFnJn1Ijgc-VYBZJMQq9tT41WS0w,6911
|
16
|
-
staran-0.1.0.dist-info/._METADATA,sha256=3_uwfdZqkY0vpvvPcxyU7-uCuMfSkGWarTVY5AY-mtg,4096
|
17
|
-
staran-0.1.0.dist-info/._PKG-INFO,sha256=3_uwfdZqkY0vpvvPcxyU7-uCuMfSkGWarTVY5AY-mtg,4096
|
18
|
-
staran-0.1.0.dist-info/._SOURCES.txt,sha256=3_uwfdZqkY0vpvvPcxyU7-uCuMfSkGWarTVY5AY-mtg,4096
|
19
|
-
staran-0.1.0.dist-info/._WHEEL,sha256=3_uwfdZqkY0vpvvPcxyU7-uCuMfSkGWarTVY5AY-mtg,4096
|
20
|
-
staran-0.1.0.dist-info/._licenses,sha256=3_uwfdZqkY0vpvvPcxyU7-uCuMfSkGWarTVY5AY-mtg,4096
|
21
|
-
staran-0.1.0.dist-info/._requires.txt,sha256=3_uwfdZqkY0vpvvPcxyU7-uCuMfSkGWarTVY5AY-mtg,4096
|
22
|
-
staran-0.1.0.dist-info/._top_level.txt,sha256=3_uwfdZqkY0vpvvPcxyU7-uCuMfSkGWarTVY5AY-mtg,4096
|
23
|
-
staran-0.1.0.dist-info/METADATA,sha256=hy7Zw4GbAqRX2nOMjSI5bxOCzDIyXASZ-TkeIAjGMOQ,656
|
24
|
-
staran-0.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
25
|
-
staran-0.1.0.dist-info/top_level.txt,sha256=Ib4ZA2MPBpiT0tC-0qt5RcP9g42gLddRbx9PiYGa-Fc,6
|
26
|
-
staran-0.1.0.dist-info/RECORD,,
|
Binary file
|
@@ -1 +0,0 @@
|
|
1
|
-
tools
|
tools/.___init__.py
DELETED
Binary file
|
tools/._date
DELETED
Binary file
|
tools/__init__.py
DELETED
@@ -1,70 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python3
|
2
|
-
# -*- coding: utf-8 -*-
|
3
|
-
|
4
|
-
"""
|
5
|
-
Staran Tools - 高性能工具集合
|
6
|
-
包含日期处理等各种实用工具
|
7
|
-
"""
|
8
|
-
|
9
|
-
# 导入date模块的主要类和函数
|
10
|
-
from .date import (
|
11
|
-
Date,
|
12
|
-
get_today,
|
13
|
-
date_to_timestamp,
|
14
|
-
days_between,
|
15
|
-
is_leap_year_c,
|
16
|
-
has_c_extension,
|
17
|
-
get_platform_info,
|
18
|
-
PlatformDateUtils,
|
19
|
-
create_date,
|
20
|
-
today,
|
21
|
-
from_string,
|
22
|
-
from_timestamp
|
23
|
-
)
|
24
|
-
|
25
|
-
# 为了向后兼容,也可以通过time模块访问
|
26
|
-
from . import date as date_module
|
27
|
-
|
28
|
-
# 主要导出
|
29
|
-
__all__ = [
|
30
|
-
# 核心类
|
31
|
-
'Date',
|
32
|
-
'PlatformDateUtils',
|
33
|
-
|
34
|
-
# 核心函数
|
35
|
-
'get_today',
|
36
|
-
'date_to_timestamp',
|
37
|
-
'days_between',
|
38
|
-
'is_leap_year_c',
|
39
|
-
'has_c_extension',
|
40
|
-
'get_platform_info',
|
41
|
-
|
42
|
-
# 便捷函数
|
43
|
-
'create_date',
|
44
|
-
'today',
|
45
|
-
'from_string',
|
46
|
-
'from_timestamp',
|
47
|
-
|
48
|
-
# 子模块
|
49
|
-
'date_module'
|
50
|
-
]
|
51
|
-
|
52
|
-
# 模块信息
|
53
|
-
__version__ = '1.0.0'
|
54
|
-
__author__ = 'Staran Team'
|
55
|
-
__description__ = 'Staran high-performance tools collection'
|
56
|
-
|
57
|
-
# 模块级便捷函数
|
58
|
-
def get_module_info():
|
59
|
-
"""获取tools模块信息"""
|
60
|
-
return {
|
61
|
-
'version': __version__,
|
62
|
-
'author': __author__,
|
63
|
-
'description': __description__,
|
64
|
-
'available_modules': ['date'],
|
65
|
-
'date_c_extension': has_c_extension()
|
66
|
-
}
|
67
|
-
|
68
|
-
# 显示加载信息
|
69
|
-
print(f"🚀 Staran Tools v{__version__} 已加载")
|
70
|
-
print(f" 📅 Date模块: {'C扩展' if has_c_extension() else 'Python实现'}")
|
tools/date/.___init__.py
DELETED
Binary file
|
tools/date/._build_simple.py
DELETED
Binary file
|
tools/date/._date.py
DELETED
Binary file
|
tools/date/._platform_utils.py
DELETED
Binary file
|