staran 1.0.3__py3-none-any.whl → 1.0.5__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 CHANGED
@@ -27,7 +27,7 @@ Staran - 企业级多功能工具库
27
27
  2025年04月15日
28
28
  """
29
29
 
30
- __version__ = "1.0.3"
30
+ __version__ = "1.0.5"
31
31
  __author__ = "Staran Team"
32
32
  __email__ = "team@staran.dev"
33
33
  __license__ = "MIT"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: staran
3
- Version: 1.0.3
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.3 - 企业级多功能工具库
40
+ # Staran v1.0.5 - 企业级多功能工具库
41
41
 
42
42
  [![Python Version](https://img.shields.io/badge/python-3.7%2B-blue.svg)](https://python.org)
43
43
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
@@ -50,7 +50,7 @@ Dynamic: summary
50
50
  `staran` 旨在成为一个可扩展的工具库,包含多个独立的、高质量的模块。每个模块都专注于解决特定领域的问题,并遵循统一的设计标准。
51
51
 
52
52
  ### 当前模块
53
- - **`date`**: 企业级日期处理工具 (v1.0.3)
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
- ├── tests/ # date模块的测试
69
- ├── utils/ # date模块的工具函数
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
- ### 📚 `date` 模块详细文档
104
+ ### 📚 文档
106
105
 
107
- #### 1. 创建日期对象
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: team@staran.dev
193
- - 📖 文档: https://staran.readthedocs.io/
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.3** - 让工具开发变得简单而强大 ✨
143
+ **Staran v1.0.5** - 让工具开发变得简单而强大 ✨
144
+
@@ -1,4 +1,4 @@
1
- staran/__init__.py,sha256=tHIqYKvkrhwhUKQ-H2DLHj0JjvOY5QbkTrk7_pfLaFI,1172
1
+ staran/__init__.py,sha256=k-GSK864ZTJMK7QPJdUPyVL2ljrkNdm397kB4nvjnb4,1172
2
2
  staran/date/__init__.py,sha256=nm6tx-Qq9ntiwPGG4ieDTSl8MhTn3KugZyGLfUUBiaA,615
3
3
  staran/date/core.py,sha256=E-fs3lfX4ZVeh0YN8Vjmt3wv-UOrrfW8bETj-R8Js8E,18595
4
4
  staran/date/examples/__init__.py,sha256=5q6uxzeIhPcFo64gXybEozx4E4lt8TEEibFC-dF_EV0,163
@@ -8,8 +8,8 @@ staran/date/tests/run_tests.py,sha256=Ix4qm_gF5blbSfVx05Deoml35BdQ7eIYERRPSw5AAP
8
8
  staran/date/tests/test_core.py,sha256=V7aTXAjNaHrdSWHE5aoem2u8s00ilI-Skbxo0fgqjvk,16444
9
9
  staran/date/utils/__init__.py,sha256=W5DkeslSOINF7kq6wFz3l16fUmGI0XALNuJAALQeLLM,142
10
10
  staran/date/utils/helpers.py,sha256=9TlebdCr-YD4vrXjTFMXDG413gbSFwdUNyivAarIp5M,5553
11
- staran-1.0.3.dist-info/licenses/LICENSE,sha256=2EmsBIyDCono4iVXNpv5_px9qt2b7hfPq1WuyGVMNP4,1361
12
- staran-1.0.3.dist-info/METADATA,sha256=a8Ct1x3Sm_fqFJlBc7k4yzGzYtFUwFGEmfqNn_586XI,5528
13
- staran-1.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
- staran-1.0.3.dist-info/top_level.txt,sha256=NOUZtXSh5oSIEjHrC0lQ9WmoKtD010Q00dghWyag-Zs,7
15
- staran-1.0.3.dist-info/RECORD,,
11
+ staran-1.0.5.dist-info/licenses/LICENSE,sha256=2EmsBIyDCono4iVXNpv5_px9qt2b7hfPq1WuyGVMNP4,1361
12
+ staran-1.0.5.dist-info/METADATA,sha256=iogtK1RwT2buy5szeHTBcBINtJCSG2Uhjs3hM1whvV4,4016
13
+ staran-1.0.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
+ staran-1.0.5.dist-info/top_level.txt,sha256=NOUZtXSh5oSIEjHrC0lQ9WmoKtD010Q00dghWyag-Zs,7
15
+ staran-1.0.5.dist-info/RECORD,,
File without changes