staran 1.0.1__tar.gz → 1.0.4__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.4/PKG-INFO +145 -0
- staran-1.0.4/README.md +106 -0
- {staran-1.0.1 → staran-1.0.4}/setup.py +1 -1
- staran-1.0.4/staran/__init__.py +62 -0
- staran-1.0.4/staran/date/__init__.py +37 -0
- staran-1.0.4/staran/date/core.py +549 -0
- staran-1.0.4/staran/date/examples/__init__.py +11 -0
- staran-1.0.4/staran/date/examples/basic_usage.py +177 -0
- staran-1.0.4/staran/date/tests/__init__.py +11 -0
- staran-1.0.4/staran/date/tests/run_tests.py +109 -0
- staran-1.0.1/staran/tools/tests/test_date.py → staran-1.0.4/staran/date/tests/test_core.py +289 -335
- staran-1.0.4/staran/date/utils/__init__.py +11 -0
- staran-1.0.4/staran/date/utils/helpers.py +203 -0
- staran-1.0.4/staran.egg-info/PKG-INFO +145 -0
- staran-1.0.4/staran.egg-info/SOURCES.txt +17 -0
- staran-1.0.1/PKG-INFO +0 -37
- staran-1.0.1/README.md +0 -0
- staran-1.0.1/staran/__init__.py +0 -10
- staran-1.0.1/staran/tools/__init__.py +0 -43
- staran-1.0.1/staran/tools/date.py +0 -405
- staran-1.0.1/staran/tools/tests/__init__.py +0 -119
- staran-1.0.1/staran/tools/tests/run_tests.py +0 -241
- staran-1.0.1/staran/tools/tests/test_api_compatibility.py +0 -319
- staran-1.0.1/staran/tools/tests/test_logging.py +0 -402
- staran-1.0.1/staran.egg-info/PKG-INFO +0 -37
- staran-1.0.1/staran.egg-info/SOURCES.txt +0 -15
- {staran-1.0.1 → staran-1.0.4}/LICENSE +0 -0
- {staran-1.0.1 → staran-1.0.4}/setup.cfg +0 -0
- {staran-1.0.1 → staran-1.0.4}/staran.egg-info/dependency_links.txt +0 -0
- {staran-1.0.1 → staran-1.0.4}/staran.egg-info/top_level.txt +0 -0
staran-1.0.4/PKG-INFO
ADDED
@@ -0,0 +1,145 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: staran
|
3
|
+
Version: 1.0.4
|
4
|
+
Summary: staran - 轻量级Python日期工具库
|
5
|
+
Home-page: https://github.com/starlxa/staran
|
6
|
+
Author: StarAn
|
7
|
+
Author-email: starlxa@icloud.com
|
8
|
+
License: MIT
|
9
|
+
Project-URL: Bug Reports, https://github.com/starlxa/staran/issues
|
10
|
+
Project-URL: Source, https://github.com/starlxa/staran
|
11
|
+
Keywords: date datetime utilities time-processing
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
13
|
+
Classifier: Intended Audience :: Developers
|
14
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
15
|
+
Classifier: Topic :: Utilities
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
17
|
+
Classifier: Programming Language :: Python :: 3.7
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
23
|
+
Classifier: Operating System :: OS Independent
|
24
|
+
Requires-Python: >=3.7
|
25
|
+
Description-Content-Type: text/markdown
|
26
|
+
License-File: LICENSE
|
27
|
+
Dynamic: author
|
28
|
+
Dynamic: author-email
|
29
|
+
Dynamic: classifier
|
30
|
+
Dynamic: description
|
31
|
+
Dynamic: description-content-type
|
32
|
+
Dynamic: home-page
|
33
|
+
Dynamic: keywords
|
34
|
+
Dynamic: license
|
35
|
+
Dynamic: license-file
|
36
|
+
Dynamic: project-url
|
37
|
+
Dynamic: requires-python
|
38
|
+
Dynamic: summary
|
39
|
+
|
40
|
+
# Staran v1.0.4 - 企业级多功能工具库
|
41
|
+
|
42
|
+
[](https://python.org)
|
43
|
+
[](LICENSE)
|
44
|
+
[](#测试)
|
45
|
+
|
46
|
+
一个现代化的Python多功能工具库,为企业应用提供一系列高质量、零依赖的解决方案。
|
47
|
+
|
48
|
+
## 🚀 核心理念
|
49
|
+
|
50
|
+
`staran` 旨在成为一个可扩展的工具库,包含多个独立的、高质量的模块。每个模块都专注于解决特定领域的问题,并遵循统一的设计标准。
|
51
|
+
|
52
|
+
### 当前模块
|
53
|
+
- **`date`**: 企业级日期处理工具 (v1.0.4)
|
54
|
+
|
55
|
+
### 未来模块
|
56
|
+
- `file`: 文件处理工具
|
57
|
+
- `crypto`: 加解密工具
|
58
|
+
- ...
|
59
|
+
|
60
|
+
## 📁 项目结构
|
61
|
+
|
62
|
+
```
|
63
|
+
staran/
|
64
|
+
├── __init__.py # 主包入口
|
65
|
+
└── date/ # 日期工具模块
|
66
|
+
├── __init__.py # date模块入口
|
67
|
+
├── core.py # 核心Date类
|
68
|
+
├── api_reference.md # API参考文档
|
69
|
+
└── tests/ # date模块的测试
|
70
|
+
```
|
71
|
+
|
72
|
+
---
|
73
|
+
|
74
|
+
## ✨ `date` 模块 - 企业级日期处理
|
75
|
+
|
76
|
+
`date` 模块提供了强大的日期处理功能,具有统一API、智能格式记忆和企业级日志等特性。
|
77
|
+
|
78
|
+
### 快速开始
|
79
|
+
|
80
|
+
#### 安装
|
81
|
+
|
82
|
+
```bash
|
83
|
+
pip install staran
|
84
|
+
```
|
85
|
+
|
86
|
+
#### 基本用法
|
87
|
+
|
88
|
+
```python
|
89
|
+
from staran.date import Date, today
|
90
|
+
|
91
|
+
# 快速创建日期
|
92
|
+
today_date = today()
|
93
|
+
print(today_date) # 2025-07-29
|
94
|
+
|
95
|
+
# 从字符串创建
|
96
|
+
date = Date.from_string("20250415")
|
97
|
+
print(date.format_chinese()) # 2025年04月15日
|
98
|
+
|
99
|
+
# 日期运算(保持格式)
|
100
|
+
future = date.add_months(3)
|
101
|
+
print(future) # 20250715
|
102
|
+
```
|
103
|
+
|
104
|
+
### 📚 文档
|
105
|
+
|
106
|
+
有关 `date` 模块的完整 API 和用法,请参阅 **[`date` 模块 API 参考](staran/date/api_reference.md)**。
|
107
|
+
|
108
|
+
## 🧪 测试
|
109
|
+
|
110
|
+
运行 `date` 模块的完整测试套件:
|
111
|
+
|
112
|
+
```bash
|
113
|
+
# 彩色测试输出
|
114
|
+
python -m staran.date.tests.run_tests
|
115
|
+
|
116
|
+
# 标准unittest
|
117
|
+
python -m unittest staran.date.tests.test_core
|
118
|
+
```
|
119
|
+
|
120
|
+
测试覆盖率:**100%**(64项测试,涵盖所有功能模块)
|
121
|
+
|
122
|
+
## 📄 许可证
|
123
|
+
|
124
|
+
MIT License - 详见 [LICENSE](LICENSE) 文件
|
125
|
+
|
126
|
+
## 🤝 贡献
|
127
|
+
|
128
|
+
欢迎为 `staran` 贡献新的工具模块或改进现有模块!
|
129
|
+
|
130
|
+
1. Fork 本项目
|
131
|
+
2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)
|
132
|
+
3. 提交更改 (`git commit -m 'Add some AmazingFeature'`)
|
133
|
+
4. 推送到分支 (`git push origin feature/AmazingFeature`)
|
134
|
+
5. 开启Pull Request
|
135
|
+
|
136
|
+
## 📞 支持
|
137
|
+
|
138
|
+
- 📧 Email: simon@wsi.hk
|
139
|
+
- 📖 文档: https://staran.readthedocs.io/
|
140
|
+
- 🐛 问题报告: https://github.com/starlxa/staran/issues
|
141
|
+
|
142
|
+
---
|
143
|
+
|
144
|
+
**Staran v1.0.4** - 让工具开发变得简单而强大 ✨
|
145
|
+
|
staran-1.0.4/README.md
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
# Staran v1.0.4 - 企业级多功能工具库
|
2
|
+
|
3
|
+
[](https://python.org)
|
4
|
+
[](LICENSE)
|
5
|
+
[](#测试)
|
6
|
+
|
7
|
+
一个现代化的Python多功能工具库,为企业应用提供一系列高质量、零依赖的解决方案。
|
8
|
+
|
9
|
+
## 🚀 核心理念
|
10
|
+
|
11
|
+
`staran` 旨在成为一个可扩展的工具库,包含多个独立的、高质量的模块。每个模块都专注于解决特定领域的问题,并遵循统一的设计标准。
|
12
|
+
|
13
|
+
### 当前模块
|
14
|
+
- **`date`**: 企业级日期处理工具 (v1.0.4)
|
15
|
+
|
16
|
+
### 未来模块
|
17
|
+
- `file`: 文件处理工具
|
18
|
+
- `crypto`: 加解密工具
|
19
|
+
- ...
|
20
|
+
|
21
|
+
## 📁 项目结构
|
22
|
+
|
23
|
+
```
|
24
|
+
staran/
|
25
|
+
├── __init__.py # 主包入口
|
26
|
+
└── date/ # 日期工具模块
|
27
|
+
├── __init__.py # date模块入口
|
28
|
+
├── core.py # 核心Date类
|
29
|
+
├── api_reference.md # API参考文档
|
30
|
+
└── tests/ # date模块的测试
|
31
|
+
```
|
32
|
+
|
33
|
+
---
|
34
|
+
|
35
|
+
## ✨ `date` 模块 - 企业级日期处理
|
36
|
+
|
37
|
+
`date` 模块提供了强大的日期处理功能,具有统一API、智能格式记忆和企业级日志等特性。
|
38
|
+
|
39
|
+
### 快速开始
|
40
|
+
|
41
|
+
#### 安装
|
42
|
+
|
43
|
+
```bash
|
44
|
+
pip install staran
|
45
|
+
```
|
46
|
+
|
47
|
+
#### 基本用法
|
48
|
+
|
49
|
+
```python
|
50
|
+
from staran.date import Date, today
|
51
|
+
|
52
|
+
# 快速创建日期
|
53
|
+
today_date = today()
|
54
|
+
print(today_date) # 2025-07-29
|
55
|
+
|
56
|
+
# 从字符串创建
|
57
|
+
date = Date.from_string("20250415")
|
58
|
+
print(date.format_chinese()) # 2025年04月15日
|
59
|
+
|
60
|
+
# 日期运算(保持格式)
|
61
|
+
future = date.add_months(3)
|
62
|
+
print(future) # 20250715
|
63
|
+
```
|
64
|
+
|
65
|
+
### 📚 文档
|
66
|
+
|
67
|
+
有关 `date` 模块的完整 API 和用法,请参阅 **[`date` 模块 API 参考](staran/date/api_reference.md)**。
|
68
|
+
|
69
|
+
## 🧪 测试
|
70
|
+
|
71
|
+
运行 `date` 模块的完整测试套件:
|
72
|
+
|
73
|
+
```bash
|
74
|
+
# 彩色测试输出
|
75
|
+
python -m staran.date.tests.run_tests
|
76
|
+
|
77
|
+
# 标准unittest
|
78
|
+
python -m unittest staran.date.tests.test_core
|
79
|
+
```
|
80
|
+
|
81
|
+
测试覆盖率:**100%**(64项测试,涵盖所有功能模块)
|
82
|
+
|
83
|
+
## 📄 许可证
|
84
|
+
|
85
|
+
MIT License - 详见 [LICENSE](LICENSE) 文件
|
86
|
+
|
87
|
+
## 🤝 贡献
|
88
|
+
|
89
|
+
欢迎为 `staran` 贡献新的工具模块或改进现有模块!
|
90
|
+
|
91
|
+
1. Fork 本项目
|
92
|
+
2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)
|
93
|
+
3. 提交更改 (`git commit -m 'Add some AmazingFeature'`)
|
94
|
+
4. 推送到分支 (`git push origin feature/AmazingFeature`)
|
95
|
+
5. 开启Pull Request
|
96
|
+
|
97
|
+
## 📞 支持
|
98
|
+
|
99
|
+
- 📧 Email: simon@wsi.hk
|
100
|
+
- 📖 文档: https://staran.readthedocs.io/
|
101
|
+
- 🐛 问题报告: https://github.com/starlxa/staran/issues
|
102
|
+
|
103
|
+
---
|
104
|
+
|
105
|
+
**Staran v1.0.4** - 让工具开发变得简单而强大 ✨
|
106
|
+
|
@@ -0,0 +1,62 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
"""
|
5
|
+
Staran - 企业级多功能工具库
|
6
|
+
==========================
|
7
|
+
|
8
|
+
一个现代化的Python多功能工具库,为企业应用提供一系列高质量、零依赖的解决方案。
|
9
|
+
|
10
|
+
当前模块:
|
11
|
+
- **date**: 企业级日期处理 (v1.0.2)
|
12
|
+
|
13
|
+
未来模块:
|
14
|
+
- file: 文件处理工具
|
15
|
+
- crypto: 加解密工具
|
16
|
+
- ...
|
17
|
+
|
18
|
+
快速开始 (日期处理):
|
19
|
+
>>> from staran.date import Date
|
20
|
+
>>>
|
21
|
+
>>> today = Date.today()
|
22
|
+
>>> print(today)
|
23
|
+
20250729
|
24
|
+
|
25
|
+
>>> date = Date.from_string("20250415")
|
26
|
+
>>> print(date.format_chinese())
|
27
|
+
2025年04月15日
|
28
|
+
"""
|
29
|
+
|
30
|
+
__version__ = "1.0.3"
|
31
|
+
__author__ = "Staran Team"
|
32
|
+
__email__ = "team@staran.dev"
|
33
|
+
__license__ = "MIT"
|
34
|
+
|
35
|
+
# 导入核心模块
|
36
|
+
from .date import (
|
37
|
+
Date,
|
38
|
+
DateLogger,
|
39
|
+
today,
|
40
|
+
from_string,
|
41
|
+
DateError,
|
42
|
+
InvalidDateFormatError,
|
43
|
+
InvalidDateValueError
|
44
|
+
)
|
45
|
+
|
46
|
+
# 定义公共API
|
47
|
+
__all__ = [
|
48
|
+
# Date 模块
|
49
|
+
'Date',
|
50
|
+
'DateLogger',
|
51
|
+
'today',
|
52
|
+
'from_string',
|
53
|
+
'DateError',
|
54
|
+
'InvalidDateFormatError',
|
55
|
+
'InvalidDateValueError',
|
56
|
+
|
57
|
+
# 元数据
|
58
|
+
'__version__',
|
59
|
+
'__author__',
|
60
|
+
'__email__',
|
61
|
+
'__license__'
|
62
|
+
]
|
@@ -0,0 +1,37 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
"""
|
5
|
+
Staran Date 模块
|
6
|
+
================
|
7
|
+
|
8
|
+
提供企业级日期处理功能。
|
9
|
+
"""
|
10
|
+
|
11
|
+
__version__ = "1.0.2"
|
12
|
+
__author__ = "Staran Team"
|
13
|
+
__email__ = "team@staran.dev"
|
14
|
+
|
15
|
+
# 导入核心类和功能
|
16
|
+
from .core import Date, DateLogger
|
17
|
+
|
18
|
+
# 导出便捷函数
|
19
|
+
def today() -> Date:
|
20
|
+
"""
|
21
|
+
创建今日的Date对象
|
22
|
+
"""
|
23
|
+
return Date.today()
|
24
|
+
|
25
|
+
def from_string(date_string: str) -> Date:
|
26
|
+
"""
|
27
|
+
从字符串创建Date对象
|
28
|
+
"""
|
29
|
+
return Date.from_string(date_string)
|
30
|
+
|
31
|
+
# 定义公共API
|
32
|
+
__all__ = [
|
33
|
+
'Date',
|
34
|
+
'DateLogger',
|
35
|
+
'today',
|
36
|
+
'from_string'
|
37
|
+
]
|