staran 1.0.3__tar.gz → 1.0.5__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.
- {staran-1.0.3/staran.egg-info → staran-1.0.5}/PKG-INFO +12 -66
- {staran-1.0.3 → staran-1.0.5}/README.md +11 -65
- {staran-1.0.3 → staran-1.0.5}/setup.py +1 -1
- {staran-1.0.3 → staran-1.0.5}/staran/__init__.py +1 -1
- {staran-1.0.3 → staran-1.0.5/staran.egg-info}/PKG-INFO +12 -66
- {staran-1.0.3 → staran-1.0.5}/LICENSE +0 -0
- {staran-1.0.3 → staran-1.0.5}/setup.cfg +0 -0
- {staran-1.0.3 → staran-1.0.5}/staran/date/__init__.py +0 -0
- {staran-1.0.3 → staran-1.0.5}/staran/date/core.py +0 -0
- {staran-1.0.3 → staran-1.0.5}/staran/date/examples/__init__.py +0 -0
- {staran-1.0.3 → staran-1.0.5}/staran/date/examples/basic_usage.py +0 -0
- {staran-1.0.3 → staran-1.0.5}/staran/date/tests/__init__.py +0 -0
- {staran-1.0.3 → staran-1.0.5}/staran/date/tests/run_tests.py +0 -0
- {staran-1.0.3 → staran-1.0.5}/staran/date/tests/test_core.py +0 -0
- {staran-1.0.3 → staran-1.0.5}/staran/date/utils/__init__.py +0 -0
- {staran-1.0.3 → staran-1.0.5}/staran/date/utils/helpers.py +0 -0
- {staran-1.0.3 → staran-1.0.5}/staran.egg-info/SOURCES.txt +0 -0
- {staran-1.0.3 → staran-1.0.5}/staran.egg-info/dependency_links.txt +0 -0
- {staran-1.0.3 → staran-1.0.5}/staran.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: staran
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.5
|
4
4
|
Summary: staran - 轻量级Python日期工具库
|
5
5
|
Home-page: https://github.com/starlxa/staran
|
6
6
|
Author: StarAn
|
@@ -37,7 +37,7 @@ Dynamic: project-url
|
|
37
37
|
Dynamic: requires-python
|
38
38
|
Dynamic: summary
|
39
39
|
|
40
|
-
# Staran v1.0.
|
40
|
+
# Staran v1.0.5 - 企业级多功能工具库
|
41
41
|
|
42
42
|
[](https://python.org)
|
43
43
|
[](LICENSE)
|
@@ -50,7 +50,7 @@ Dynamic: summary
|
|
50
50
|
`staran` 旨在成为一个可扩展的工具库,包含多个独立的、高质量的模块。每个模块都专注于解决特定领域的问题,并遵循统一的设计标准。
|
51
51
|
|
52
52
|
### 当前模块
|
53
|
-
- **`date`**: 企业级日期处理工具 (v1.0.
|
53
|
+
- **`date`**: 企业级日期处理工具 (v1.0.5)
|
54
54
|
|
55
55
|
### 未来模块
|
56
56
|
- `file`: 文件处理工具
|
@@ -61,13 +61,12 @@ Dynamic: summary
|
|
61
61
|
|
62
62
|
```
|
63
63
|
staran/
|
64
|
-
├── __init__.py #
|
64
|
+
├── __init__.py # 主包入口
|
65
65
|
└── date/ # 日期工具模块
|
66
66
|
├── __init__.py # date模块入口
|
67
67
|
├── core.py # 核心Date类
|
68
|
-
├──
|
69
|
-
|
70
|
-
└── examples/ # date模块的示例
|
68
|
+
├── api_reference.md # API参考文档
|
69
|
+
└── tests/ # date模块的测试
|
71
70
|
```
|
72
71
|
|
73
72
|
---
|
@@ -102,62 +101,9 @@ future = date.add_months(3)
|
|
102
101
|
print(future) # 20250715
|
103
102
|
```
|
104
103
|
|
105
|
-
### 📚
|
104
|
+
### 📚 文档
|
106
105
|
|
107
|
-
|
108
|
-
|
109
|
-
```python
|
110
|
-
from staran.date import Date
|
111
|
-
|
112
|
-
# 多种创建方式
|
113
|
-
d1 = Date(2025, 4, 15) # 从参数
|
114
|
-
d2 = Date.from_string("202504") # 从字符串(智能解析)
|
115
|
-
d3 = Date.from_string("20250415") # 完整格式
|
116
|
-
d4 = Date.from_string("2025") # 年份格式
|
117
|
-
d5 = Date.today() # 今日
|
118
|
-
```
|
119
|
-
|
120
|
-
#### 2. 智能格式记忆
|
121
|
-
|
122
|
-
`date` 模块会记住输入格式,并在运算后保持相同格式:
|
123
|
-
|
124
|
-
```python
|
125
|
-
year_date = Date.from_string("2025")
|
126
|
-
print(year_date.add_years(1)) # 2026
|
127
|
-
|
128
|
-
month_date = Date.from_string("202504")
|
129
|
-
print(month_date.add_months(2)) # 202506
|
130
|
-
|
131
|
-
full_date = Date.from_string("20250415")
|
132
|
-
print(full_date.add_days(10)) # 20250425
|
133
|
-
```
|
134
|
-
|
135
|
-
#### 3. 统一API命名
|
136
|
-
|
137
|
-
`date` 模块遵循统一的API命名规范,如 `from_*`, `to_*`, `get_*`, `is_*`, `add_*/subtract_*` 等,具体请参考 `staran/date/examples/basic_usage.py`。
|
138
|
-
|
139
|
-
#### 4. 异常处理
|
140
|
-
|
141
|
-
`date` 模块提供了一套清晰的异常类,以便更好地处理错误:
|
142
|
-
|
143
|
-
- `DateError`: 所有日期相关错误的基类。
|
144
|
-
- `InvalidDateFormatError`: 当输入字符串格式不正确时抛出。
|
145
|
-
- `InvalidDateValueError`: 当日期值无效时(如月份为13)抛出。
|
146
|
-
|
147
|
-
**示例:**
|
148
|
-
```python
|
149
|
-
from staran.date import Date, InvalidDateValueError, InvalidDateFormatError
|
150
|
-
|
151
|
-
try:
|
152
|
-
Date("2025", 13, 1)
|
153
|
-
except InvalidDateValueError as e:
|
154
|
-
print(e)
|
155
|
-
|
156
|
-
try:
|
157
|
-
Date("invalid-date")
|
158
|
-
except InvalidDateFormatError as e:
|
159
|
-
print(e)
|
160
|
-
```
|
106
|
+
有关 `date` 模块的完整 API 和用法,请参阅 **[`date` 模块 API 参考](https://github.com/StarLxa/staran/blob/master/staran/date/api_reference.md)**。
|
161
107
|
|
162
108
|
## 🧪 测试
|
163
109
|
|
@@ -189,10 +135,10 @@ MIT License - 详见 [LICENSE](LICENSE) 文件
|
|
189
135
|
|
190
136
|
## 📞 支持
|
191
137
|
|
192
|
-
- 📧 Email:
|
193
|
-
-
|
194
|
-
- 🐛 问题报告: https://github.com/starlxa/staran/issues
|
138
|
+
- 📧 Email: simon@wsi.hk
|
139
|
+
- 问题报告: https://github.com/starlxa/staran/issues
|
195
140
|
|
196
141
|
---
|
197
142
|
|
198
|
-
**Staran v1.0.
|
143
|
+
**Staran v1.0.5** - 让工具开发变得简单而强大 ✨
|
144
|
+
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Staran v1.0.
|
1
|
+
# Staran v1.0.5 - 企业级多功能工具库
|
2
2
|
|
3
3
|
[](https://python.org)
|
4
4
|
[](LICENSE)
|
@@ -11,7 +11,7 @@
|
|
11
11
|
`staran` 旨在成为一个可扩展的工具库,包含多个独立的、高质量的模块。每个模块都专注于解决特定领域的问题,并遵循统一的设计标准。
|
12
12
|
|
13
13
|
### 当前模块
|
14
|
-
- **`date`**: 企业级日期处理工具 (v1.0.
|
14
|
+
- **`date`**: 企业级日期处理工具 (v1.0.5)
|
15
15
|
|
16
16
|
### 未来模块
|
17
17
|
- `file`: 文件处理工具
|
@@ -22,13 +22,12 @@
|
|
22
22
|
|
23
23
|
```
|
24
24
|
staran/
|
25
|
-
├── __init__.py #
|
25
|
+
├── __init__.py # 主包入口
|
26
26
|
└── date/ # 日期工具模块
|
27
27
|
├── __init__.py # date模块入口
|
28
28
|
├── core.py # 核心Date类
|
29
|
-
├──
|
30
|
-
|
31
|
-
└── examples/ # date模块的示例
|
29
|
+
├── api_reference.md # API参考文档
|
30
|
+
└── tests/ # date模块的测试
|
32
31
|
```
|
33
32
|
|
34
33
|
---
|
@@ -63,62 +62,9 @@ future = date.add_months(3)
|
|
63
62
|
print(future) # 20250715
|
64
63
|
```
|
65
64
|
|
66
|
-
### 📚
|
65
|
+
### 📚 文档
|
67
66
|
|
68
|
-
|
69
|
-
|
70
|
-
```python
|
71
|
-
from staran.date import Date
|
72
|
-
|
73
|
-
# 多种创建方式
|
74
|
-
d1 = Date(2025, 4, 15) # 从参数
|
75
|
-
d2 = Date.from_string("202504") # 从字符串(智能解析)
|
76
|
-
d3 = Date.from_string("20250415") # 完整格式
|
77
|
-
d4 = Date.from_string("2025") # 年份格式
|
78
|
-
d5 = Date.today() # 今日
|
79
|
-
```
|
80
|
-
|
81
|
-
#### 2. 智能格式记忆
|
82
|
-
|
83
|
-
`date` 模块会记住输入格式,并在运算后保持相同格式:
|
84
|
-
|
85
|
-
```python
|
86
|
-
year_date = Date.from_string("2025")
|
87
|
-
print(year_date.add_years(1)) # 2026
|
88
|
-
|
89
|
-
month_date = Date.from_string("202504")
|
90
|
-
print(month_date.add_months(2)) # 202506
|
91
|
-
|
92
|
-
full_date = Date.from_string("20250415")
|
93
|
-
print(full_date.add_days(10)) # 20250425
|
94
|
-
```
|
95
|
-
|
96
|
-
#### 3. 统一API命名
|
97
|
-
|
98
|
-
`date` 模块遵循统一的API命名规范,如 `from_*`, `to_*`, `get_*`, `is_*`, `add_*/subtract_*` 等,具体请参考 `staran/date/examples/basic_usage.py`。
|
99
|
-
|
100
|
-
#### 4. 异常处理
|
101
|
-
|
102
|
-
`date` 模块提供了一套清晰的异常类,以便更好地处理错误:
|
103
|
-
|
104
|
-
- `DateError`: 所有日期相关错误的基类。
|
105
|
-
- `InvalidDateFormatError`: 当输入字符串格式不正确时抛出。
|
106
|
-
- `InvalidDateValueError`: 当日期值无效时(如月份为13)抛出。
|
107
|
-
|
108
|
-
**示例:**
|
109
|
-
```python
|
110
|
-
from staran.date import Date, InvalidDateValueError, InvalidDateFormatError
|
111
|
-
|
112
|
-
try:
|
113
|
-
Date("2025", 13, 1)
|
114
|
-
except InvalidDateValueError as e:
|
115
|
-
print(e)
|
116
|
-
|
117
|
-
try:
|
118
|
-
Date("invalid-date")
|
119
|
-
except InvalidDateFormatError as e:
|
120
|
-
print(e)
|
121
|
-
```
|
67
|
+
有关 `date` 模块的完整 API 和用法,请参阅 **[`date` 模块 API 参考](https://github.com/StarLxa/staran/blob/master/staran/date/api_reference.md)**。
|
122
68
|
|
123
69
|
## 🧪 测试
|
124
70
|
|
@@ -150,10 +96,10 @@ MIT License - 详见 [LICENSE](LICENSE) 文件
|
|
150
96
|
|
151
97
|
## 📞 支持
|
152
98
|
|
153
|
-
- 📧 Email:
|
154
|
-
-
|
155
|
-
- 🐛 问题报告: https://github.com/starlxa/staran/issues
|
99
|
+
- 📧 Email: simon@wsi.hk
|
100
|
+
- 问题报告: https://github.com/starlxa/staran/issues
|
156
101
|
|
157
102
|
---
|
158
103
|
|
159
|
-
**Staran v1.0.
|
104
|
+
**Staran v1.0.5** - 让工具开发变得简单而强大 ✨
|
105
|
+
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: staran
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.5
|
4
4
|
Summary: staran - 轻量级Python日期工具库
|
5
5
|
Home-page: https://github.com/starlxa/staran
|
6
6
|
Author: StarAn
|
@@ -37,7 +37,7 @@ Dynamic: project-url
|
|
37
37
|
Dynamic: requires-python
|
38
38
|
Dynamic: summary
|
39
39
|
|
40
|
-
# Staran v1.0.
|
40
|
+
# Staran v1.0.5 - 企业级多功能工具库
|
41
41
|
|
42
42
|
[](https://python.org)
|
43
43
|
[](LICENSE)
|
@@ -50,7 +50,7 @@ Dynamic: summary
|
|
50
50
|
`staran` 旨在成为一个可扩展的工具库,包含多个独立的、高质量的模块。每个模块都专注于解决特定领域的问题,并遵循统一的设计标准。
|
51
51
|
|
52
52
|
### 当前模块
|
53
|
-
- **`date`**: 企业级日期处理工具 (v1.0.
|
53
|
+
- **`date`**: 企业级日期处理工具 (v1.0.5)
|
54
54
|
|
55
55
|
### 未来模块
|
56
56
|
- `file`: 文件处理工具
|
@@ -61,13 +61,12 @@ Dynamic: summary
|
|
61
61
|
|
62
62
|
```
|
63
63
|
staran/
|
64
|
-
├── __init__.py #
|
64
|
+
├── __init__.py # 主包入口
|
65
65
|
└── date/ # 日期工具模块
|
66
66
|
├── __init__.py # date模块入口
|
67
67
|
├── core.py # 核心Date类
|
68
|
-
├──
|
69
|
-
|
70
|
-
└── examples/ # date模块的示例
|
68
|
+
├── api_reference.md # API参考文档
|
69
|
+
└── tests/ # date模块的测试
|
71
70
|
```
|
72
71
|
|
73
72
|
---
|
@@ -102,62 +101,9 @@ future = date.add_months(3)
|
|
102
101
|
print(future) # 20250715
|
103
102
|
```
|
104
103
|
|
105
|
-
### 📚
|
104
|
+
### 📚 文档
|
106
105
|
|
107
|
-
|
108
|
-
|
109
|
-
```python
|
110
|
-
from staran.date import Date
|
111
|
-
|
112
|
-
# 多种创建方式
|
113
|
-
d1 = Date(2025, 4, 15) # 从参数
|
114
|
-
d2 = Date.from_string("202504") # 从字符串(智能解析)
|
115
|
-
d3 = Date.from_string("20250415") # 完整格式
|
116
|
-
d4 = Date.from_string("2025") # 年份格式
|
117
|
-
d5 = Date.today() # 今日
|
118
|
-
```
|
119
|
-
|
120
|
-
#### 2. 智能格式记忆
|
121
|
-
|
122
|
-
`date` 模块会记住输入格式,并在运算后保持相同格式:
|
123
|
-
|
124
|
-
```python
|
125
|
-
year_date = Date.from_string("2025")
|
126
|
-
print(year_date.add_years(1)) # 2026
|
127
|
-
|
128
|
-
month_date = Date.from_string("202504")
|
129
|
-
print(month_date.add_months(2)) # 202506
|
130
|
-
|
131
|
-
full_date = Date.from_string("20250415")
|
132
|
-
print(full_date.add_days(10)) # 20250425
|
133
|
-
```
|
134
|
-
|
135
|
-
#### 3. 统一API命名
|
136
|
-
|
137
|
-
`date` 模块遵循统一的API命名规范,如 `from_*`, `to_*`, `get_*`, `is_*`, `add_*/subtract_*` 等,具体请参考 `staran/date/examples/basic_usage.py`。
|
138
|
-
|
139
|
-
#### 4. 异常处理
|
140
|
-
|
141
|
-
`date` 模块提供了一套清晰的异常类,以便更好地处理错误:
|
142
|
-
|
143
|
-
- `DateError`: 所有日期相关错误的基类。
|
144
|
-
- `InvalidDateFormatError`: 当输入字符串格式不正确时抛出。
|
145
|
-
- `InvalidDateValueError`: 当日期值无效时(如月份为13)抛出。
|
146
|
-
|
147
|
-
**示例:**
|
148
|
-
```python
|
149
|
-
from staran.date import Date, InvalidDateValueError, InvalidDateFormatError
|
150
|
-
|
151
|
-
try:
|
152
|
-
Date("2025", 13, 1)
|
153
|
-
except InvalidDateValueError as e:
|
154
|
-
print(e)
|
155
|
-
|
156
|
-
try:
|
157
|
-
Date("invalid-date")
|
158
|
-
except InvalidDateFormatError as e:
|
159
|
-
print(e)
|
160
|
-
```
|
106
|
+
有关 `date` 模块的完整 API 和用法,请参阅 **[`date` 模块 API 参考](https://github.com/StarLxa/staran/blob/master/staran/date/api_reference.md)**。
|
161
107
|
|
162
108
|
## 🧪 测试
|
163
109
|
|
@@ -189,10 +135,10 @@ MIT License - 详见 [LICENSE](LICENSE) 文件
|
|
189
135
|
|
190
136
|
## 📞 支持
|
191
137
|
|
192
|
-
- 📧 Email:
|
193
|
-
-
|
194
|
-
- 🐛 问题报告: https://github.com/starlxa/staran/issues
|
138
|
+
- 📧 Email: simon@wsi.hk
|
139
|
+
- 问题报告: https://github.com/starlxa/staran/issues
|
195
140
|
|
196
141
|
---
|
197
142
|
|
198
|
-
**Staran v1.0.
|
143
|
+
**Staran v1.0.5** - 让工具开发变得简单而强大 ✨
|
144
|
+
|
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
|