staran 1.0.9__tar.gz → 1.0.11__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.
Files changed (42) hide show
  1. {staran-1.0.9/staran.egg-info → staran-1.0.11}/PKG-INFO +34 -8
  2. {staran-1.0.9 → staran-1.0.11}/README.md +11 -5
  3. {staran-1.0.9 → staran-1.0.11}/setup.py +37 -4
  4. staran-1.0.11/staran/__init__.py +61 -0
  5. staran-1.0.11/staran/date/__init__.py +91 -0
  6. staran-1.0.11/staran/date/core/__init__.py +24 -0
  7. {staran-1.0.9/staran/date → staran-1.0.11/staran/date/core}/core.py +539 -8
  8. staran-1.0.11/staran/date/core/lunar.py +150 -0
  9. staran-1.0.11/staran/date/examples/v1010_features_demo.py +376 -0
  10. staran-1.0.11/staran/date/extensions/__init__.py +48 -0
  11. staran-1.0.11/staran/date/extensions/expressions.py +554 -0
  12. staran-1.0.11/staran/date/extensions/solar_terms.py +417 -0
  13. staran-1.0.11/staran/date/extensions/timezone.py +263 -0
  14. staran-1.0.11/staran/date/integrations/__init__.py +38 -0
  15. staran-1.0.11/staran/date/integrations/api_server.py +754 -0
  16. staran-1.0.11/staran/date/integrations/visualization.py +689 -0
  17. staran-1.0.11/staran/date/tests/test_v1010_features.py +495 -0
  18. {staran-1.0.9 → staran-1.0.11/staran.egg-info}/PKG-INFO +34 -8
  19. {staran-1.0.9 → staran-1.0.11}/staran.egg-info/SOURCES.txt +15 -3
  20. staran-1.0.11/staran.egg-info/entry_points.txt +2 -0
  21. staran-1.0.11/staran.egg-info/requires.txt +19 -0
  22. staran-1.0.9/staran/__init__.py +0 -62
  23. staran-1.0.9/staran/date/__init__.py +0 -106
  24. staran-1.0.9/staran/date/lunar.py +0 -320
  25. {staran-1.0.9 → staran-1.0.11}/LICENSE +0 -0
  26. {staran-1.0.9 → staran-1.0.11}/setup.cfg +0 -0
  27. {staran-1.0.9/staran/date → staran-1.0.11/staran/date/core}/i18n.py +0 -0
  28. {staran-1.0.9 → staran-1.0.11}/staran/date/examples/__init__.py +0 -0
  29. {staran-1.0.9 → staran-1.0.11}/staran/date/examples/basic_usage.py +0 -0
  30. {staran-1.0.9 → staran-1.0.11}/staran/date/examples/enhanced_features.py +0 -0
  31. {staran-1.0.9 → staran-1.0.11}/staran/date/examples/v108_features_demo.py +0 -0
  32. {staran-1.0.9 → staran-1.0.11}/staran/date/examples/v109_features_demo.py +0 -0
  33. {staran-1.0.9 → staran-1.0.11}/staran/date/tests/__init__.py +0 -0
  34. {staran-1.0.9 → staran-1.0.11}/staran/date/tests/run_tests.py +0 -0
  35. {staran-1.0.9 → staran-1.0.11}/staran/date/tests/test_core.py +0 -0
  36. {staran-1.0.9 → staran-1.0.11}/staran/date/tests/test_enhancements.py +0 -0
  37. {staran-1.0.9 → staran-1.0.11}/staran/date/tests/test_v108_features.py +0 -0
  38. {staran-1.0.9 → staran-1.0.11}/staran/date/tests/test_v109_features.py +0 -0
  39. {staran-1.0.9 → staran-1.0.11}/staran/date/utils/__init__.py +0 -0
  40. {staran-1.0.9 → staran-1.0.11}/staran/date/utils/helpers.py +0 -0
  41. {staran-1.0.9 → staran-1.0.11}/staran.egg-info/dependency_links.txt +0 -0
  42. {staran-1.0.9 → staran-1.0.11}/staran.egg-info/top_level.txt +0 -0
@@ -1,18 +1,21 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: staran
3
- Version: 1.0.9
4
- Summary: staran - 轻量级Python日期工具库
3
+ Version: 1.0.11
4
+ Summary: staran - 企业级Python日期处理库
5
5
  Home-page: https://github.com/starlxa/staran
6
6
  Author: StarAn
7
7
  Author-email: starlxa@icloud.com
8
8
  License: MIT
9
9
  Project-URL: Bug Reports, https://github.com/starlxa/staran/issues
10
10
  Project-URL: Source, https://github.com/starlxa/staran
11
- Keywords: date datetime utilities time-processing lunar calendar i18n
11
+ Project-URL: Documentation, https://github.com/starlxa/staran/blob/master/API_REFERENCE.md
12
+ Keywords: date datetime utilities time-processing lunar calendar i18n timezone visualization api
12
13
  Classifier: Development Status :: 5 - Production/Stable
13
14
  Classifier: Intended Audience :: Developers
14
15
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
15
16
  Classifier: Topic :: Utilities
17
+ Classifier: Topic :: Software Development :: Localization
18
+ Classifier: Topic :: Scientific/Engineering :: Visualization
16
19
  Classifier: Programming Language :: Python :: 3
17
20
  Classifier: Programming Language :: Python :: 3.7
18
21
  Classifier: Programming Language :: Python :: 3.8
@@ -21,9 +24,25 @@ Classifier: Programming Language :: Python :: 3.10
21
24
  Classifier: Programming Language :: Python :: 3.11
22
25
  Classifier: Programming Language :: Python :: 3.12
23
26
  Classifier: Operating System :: OS Independent
27
+ Classifier: License :: OSI Approved :: MIT License
24
28
  Requires-Python: >=3.7
25
29
  Description-Content-Type: text/markdown
26
30
  License-File: LICENSE
31
+ Provides-Extra: visualization
32
+ Requires-Dist: matplotlib>=3.0.0; extra == "visualization"
33
+ Requires-Dist: plotly>=5.0.0; extra == "visualization"
34
+ Provides-Extra: web
35
+ Requires-Dist: flask>=2.0.0; extra == "web"
36
+ Provides-Extra: full
37
+ Requires-Dist: matplotlib>=3.0.0; extra == "full"
38
+ Requires-Dist: plotly>=5.0.0; extra == "full"
39
+ Requires-Dist: flask>=2.0.0; extra == "full"
40
+ Provides-Extra: dev
41
+ Requires-Dist: pytest>=6.0.0; extra == "dev"
42
+ Requires-Dist: pytest-cov>=2.0.0; extra == "dev"
43
+ Requires-Dist: black>=21.0.0; extra == "dev"
44
+ Requires-Dist: flake8>=3.8.0; extra == "dev"
45
+ Requires-Dist: mypy>=0.800; extra == "dev"
27
46
  Dynamic: author
28
47
  Dynamic: author-email
29
48
  Dynamic: classifier
@@ -34,6 +53,7 @@ Dynamic: keywords
34
53
  Dynamic: license
35
54
  Dynamic: license-file
36
55
  Dynamic: project-url
56
+ Dynamic: provides-extra
37
57
  Dynamic: requires-python
38
58
  Dynamic: summary
39
59
 
@@ -48,8 +68,9 @@ Dynamic: summary
48
68
 
49
69
  ## 📚 文档导航
50
70
 
51
- - **[API 参考文档](API_REFERENCE.md)** - 完整的API文档和使用指南
52
- - **[更新日志](CHANGELOG.md)** - 详细的版本历史和更新记录
71
+ - **[API 参考文档](https://github.com/StarLxa/staran/tree/master/API_REFERENCE.md)** - 完整的API文档和使用指南
72
+ - **[更新日志](https://github.com/StarLxa/staran/tree/master/CHANGELOG.md)** - 详细的版本历史和更新记录
73
+ - **[PyPI包页面](https://pypi.org/project/staran/)** - 安装和版本信息
53
74
  - **[快速开始](#快速开始)** - 立即开始使用
54
75
 
55
76
  ## 🚀 核心理念
@@ -94,6 +115,9 @@ staran/
94
115
  ### 安装
95
116
 
96
117
  ```bash
118
+ # 从PyPI安装 (推荐)
119
+ pip install staran
120
+
97
121
  # 从源码安装
98
122
  git clone https://github.com/StarLxa/staran.git
99
123
  cd staran
@@ -172,8 +196,9 @@ python -m staran.date.tests.run_tests
172
196
 
173
197
  ## 📖 文档
174
198
 
175
- - **[API参考文档](API_REFERENCE.md)** - 完整的API文档、使用指南和示例
176
- - **[更新日志](CHANGELOG.md)** - 详细的版本历史和功能变更
199
+ - **[API参考文档](https://github.com/StarLxa/staran/tree/master/API_REFERENCE.md)** - 完整的API文档、使用指南和示例
200
+ - **[更新日志](https://github.com/StarLxa/staran/tree/master/CHANGELOG.md)** - 详细的版本历史和功能变更
201
+ - **[PyPI包页面](https://pypi.org/project/staran/)** - 安装和版本信息
177
202
 
178
203
  ## 🛠️ 开发
179
204
 
@@ -200,7 +225,8 @@ python -m staran.date.tests.run_tests
200
225
  ## 📞 支持
201
226
 
202
227
  - **GitHub Issues**: 报告Bug和功能请求
203
- - **文档**: [API参考文档](API_REFERENCE.md)
228
+ - **文档**: [API参考文档](https://github.com/StarLxa/staran/tree/master/API_REFERENCE.md)
229
+ - **PyPI**: [PyPI包页面](https://pypi.org/project/staran/)
204
230
  - **示例**: 查看 `examples/` 目录
205
231
 
206
232
  ## 📄 许可证
@@ -9,8 +9,9 @@
9
9
 
10
10
  ## 📚 文档导航
11
11
 
12
- - **[API 参考文档](API_REFERENCE.md)** - 完整的API文档和使用指南
13
- - **[更新日志](CHANGELOG.md)** - 详细的版本历史和更新记录
12
+ - **[API 参考文档](https://github.com/StarLxa/staran/tree/master/API_REFERENCE.md)** - 完整的API文档和使用指南
13
+ - **[更新日志](https://github.com/StarLxa/staran/tree/master/CHANGELOG.md)** - 详细的版本历史和更新记录
14
+ - **[PyPI包页面](https://pypi.org/project/staran/)** - 安装和版本信息
14
15
  - **[快速开始](#快速开始)** - 立即开始使用
15
16
 
16
17
  ## 🚀 核心理念
@@ -55,6 +56,9 @@ staran/
55
56
  ### 安装
56
57
 
57
58
  ```bash
59
+ # 从PyPI安装 (推荐)
60
+ pip install staran
61
+
58
62
  # 从源码安装
59
63
  git clone https://github.com/StarLxa/staran.git
60
64
  cd staran
@@ -133,8 +137,9 @@ python -m staran.date.tests.run_tests
133
137
 
134
138
  ## 📖 文档
135
139
 
136
- - **[API参考文档](API_REFERENCE.md)** - 完整的API文档、使用指南和示例
137
- - **[更新日志](CHANGELOG.md)** - 详细的版本历史和功能变更
140
+ - **[API参考文档](https://github.com/StarLxa/staran/tree/master/API_REFERENCE.md)** - 完整的API文档、使用指南和示例
141
+ - **[更新日志](https://github.com/StarLxa/staran/tree/master/CHANGELOG.md)** - 详细的版本历史和功能变更
142
+ - **[PyPI包页面](https://pypi.org/project/staran/)** - 安装和版本信息
138
143
 
139
144
  ## 🛠️ 开发
140
145
 
@@ -161,7 +166,8 @@ python -m staran.date.tests.run_tests
161
166
  ## 📞 支持
162
167
 
163
168
  - **GitHub Issues**: 报告Bug和功能请求
164
- - **文档**: [API参考文档](API_REFERENCE.md)
169
+ - **文档**: [API参考文档](https://github.com/StarLxa/staran/tree/master/API_REFERENCE.md)
170
+ - **PyPI**: [PyPI包页面](https://pypi.org/project/staran/)
165
171
  - **示例**: 查看 `examples/` 目录
166
172
 
167
173
  ## 📄 许可证
@@ -2,8 +2,8 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="staran",
5
- version="1.0.9",
6
- description="staran - 轻量级Python日期工具库",
5
+ version="1.0.11",
6
+ description="staran - 企业级Python日期处理库",
7
7
  long_description=open("README.md", encoding="utf-8").read(),
8
8
  long_description_content_type="text/markdown",
9
9
  author="StarAn",
@@ -12,13 +12,39 @@ setup(
12
12
  url="https://github.com/starlxa/staran",
13
13
  packages=find_packages(),
14
14
  install_requires=[
15
- # 只使用Python标准库,无外部依赖
15
+ # 核心功能零外部依赖
16
16
  ],
17
+ extras_require={
18
+ # v1.0.10 扩展功能的可选依赖
19
+ 'visualization': [
20
+ 'matplotlib>=3.0.0',
21
+ 'plotly>=5.0.0',
22
+ ],
23
+ 'web': [
24
+ 'flask>=2.0.0', # API服务器可选依赖
25
+ ],
26
+ 'full': [
27
+ # 安装所有可选依赖
28
+ 'matplotlib>=3.0.0',
29
+ 'plotly>=5.0.0',
30
+ 'flask>=2.0.0',
31
+ ],
32
+ 'dev': [
33
+ # 开发依赖
34
+ 'pytest>=6.0.0',
35
+ 'pytest-cov>=2.0.0',
36
+ 'black>=21.0.0',
37
+ 'flake8>=3.8.0',
38
+ 'mypy>=0.800',
39
+ ]
40
+ },
17
41
  classifiers=[
18
42
  "Development Status :: 5 - Production/Stable",
19
43
  "Intended Audience :: Developers",
20
44
  "Topic :: Software Development :: Libraries :: Python Modules",
21
45
  "Topic :: Utilities",
46
+ "Topic :: Software Development :: Localization",
47
+ "Topic :: Scientific/Engineering :: Visualization",
22
48
  "Programming Language :: Python :: 3",
23
49
  "Programming Language :: Python :: 3.7",
24
50
  "Programming Language :: Python :: 3.8",
@@ -27,11 +53,18 @@ setup(
27
53
  "Programming Language :: Python :: 3.11",
28
54
  "Programming Language :: Python :: 3.12",
29
55
  "Operating System :: OS Independent",
56
+ "License :: OSI Approved :: MIT License",
30
57
  ],
31
58
  python_requires=">=3.7",
32
- keywords="date datetime utilities time-processing lunar calendar i18n",
59
+ keywords="date datetime utilities time-processing lunar calendar i18n timezone visualization api",
33
60
  project_urls={
34
61
  "Bug Reports": "https://github.com/starlxa/staran/issues",
35
62
  "Source": "https://github.com/starlxa/staran",
63
+ "Documentation": "https://github.com/starlxa/staran/blob/master/API_REFERENCE.md",
64
+ },
65
+ entry_points={
66
+ 'console_scripts': [
67
+ 'staran=staran.date.utils.cli:main', # 命令行工具 (如果需要)
68
+ ],
36
69
  },
37
70
  )
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+
4
+ """
5
+ Staran - 企业级Python日期处理库
6
+ """
7
+
8
+ __version__ = "1.0.11"
9
+ __author__ = "StarAn"
10
+ __email__ = "starlxa@icloud.com"
11
+ __license__ = "MIT"
12
+
13
+ # 导入核心功能
14
+ try:
15
+ from .date import (
16
+ Date,
17
+ DateRange,
18
+ DateError,
19
+ LunarDate,
20
+ Language,
21
+ today,
22
+ from_string,
23
+ from_lunar,
24
+ parse_expression,
25
+ get_version_info,
26
+ get_feature_status
27
+ )
28
+ except ImportError as e:
29
+ import warnings
30
+ warnings.warn(f"Staran核心功能导入失败: {e}")
31
+
32
+ Date = None
33
+ DateRange = None
34
+ DateError = Exception
35
+ LunarDate = None
36
+ Language = None
37
+
38
+ def today():
39
+ raise ImportError("Staran核心功能不可用")
40
+
41
+ def from_string(date_string: str):
42
+ raise ImportError("Staran核心功能不可用")
43
+
44
+ def from_lunar(year: int, month: int, day: int, is_leap: bool = False):
45
+ raise ImportError("Staran核心功能不可用")
46
+
47
+ def parse_expression(expression: str):
48
+ raise ImportError("Staran核心功能不可用")
49
+
50
+ def get_version_info():
51
+ return {'version': __version__, 'status': 'core_unavailable'}
52
+
53
+ def get_feature_status():
54
+ return {'core_available': False}
55
+
56
+ __all__ = [
57
+ '__version__', '__author__', '__email__', '__license__',
58
+ 'Date', 'DateRange', 'DateError', 'LunarDate', 'Language',
59
+ 'today', 'from_string', 'from_lunar', 'parse_expression',
60
+ 'get_version_info', 'get_feature_status'
61
+ ]
@@ -0,0 +1,91 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+
4
+ """
5
+ Staran 日期处理库 v1.0.10 - 简化版导入
6
+ """
7
+
8
+ # 版本信息
9
+ __version__ = "1.0.11"
10
+ __author__ = "StarAn"
11
+ __email__ = "starlxa@icloud.com"
12
+
13
+ # 直接导入核心模块 (测试用)
14
+ from .core import Date, DateRange, DateError, LunarDate, Language
15
+
16
+ # 导入扩展功能
17
+ from .extensions import (
18
+ Timezone, TimezoneInfo, TIMEZONE_AVAILABLE,
19
+ DateExpressionParser, ParseResult, EXPRESSIONS_AVAILABLE,
20
+ SolarTerms, SolarTerm, SOLAR_TERMS_AVAILABLE
21
+ )
22
+
23
+ # 导入集成功能
24
+ from .integrations import (
25
+ DateVisualization, ChartData, TimeSeriesPoint, VISUALIZATION_AVAILABLE,
26
+ StaranAPIServer, StaranAPIHandler, API_SERVER_AVAILABLE
27
+ )
28
+
29
+ # 便捷函数
30
+ def today():
31
+ """创建今日的Date对象"""
32
+ return Date.today()
33
+
34
+ def from_string(date_string: str):
35
+ """从字符串创建Date对象"""
36
+ return Date(date_string)
37
+
38
+ def from_lunar(year: int, month: int, day: int, is_leap: bool = False):
39
+ """从农历创建Date对象"""
40
+ return Date.from_lunar(year, month, day, is_leap)
41
+
42
+ def parse_expression(expression: str):
43
+ """解析日期表达式 (v1.0.10)"""
44
+ if not EXPRESSIONS_AVAILABLE or not DateExpressionParser:
45
+ return None
46
+ parser = DateExpressionParser()
47
+ result = parser.parse(expression)
48
+ if result and result.success and result.date:
49
+ # 确保返回Date对象而不是datetime.date
50
+ if hasattr(result.date, 'year'):
51
+ return Date(result.date.year, result.date.month, result.date.day)
52
+ else:
53
+ return result.date
54
+ return None
55
+
56
+ def get_version_info():
57
+ """获取版本和功能信息"""
58
+ return {
59
+ 'version': __version__,
60
+ 'author': __author__,
61
+ 'timezone_support': TIMEZONE_AVAILABLE,
62
+ 'expression_parsing': EXPRESSIONS_AVAILABLE,
63
+ 'solar_terms': SOLAR_TERMS_AVAILABLE,
64
+ 'visualization': VISUALIZATION_AVAILABLE,
65
+ 'api_server': API_SERVER_AVAILABLE,
66
+ 'api_count': 190
67
+ }
68
+
69
+ def get_feature_status():
70
+ """获取功能状态"""
71
+ return {
72
+ 'core_date_operations': True,
73
+ 'lunar_calendar': True,
74
+ 'multilingual_support': True,
75
+ 'timezone_support': TIMEZONE_AVAILABLE,
76
+ 'expression_parsing': EXPRESSIONS_AVAILABLE,
77
+ 'solar_terms': SOLAR_TERMS_AVAILABLE,
78
+ 'data_visualization': VISUALIZATION_AVAILABLE,
79
+ 'rest_api': API_SERVER_AVAILABLE
80
+ }
81
+
82
+ # 导出
83
+ __all__ = [
84
+ '__version__', '__author__', '__email__',
85
+ 'Date', 'DateRange', 'DateError', 'LunarDate', 'Language',
86
+ 'Timezone', 'TimezoneInfo', 'DateExpressionParser', 'ParseResult',
87
+ 'SolarTerms', 'SolarTerm', 'DateVisualization', 'ChartData',
88
+ 'TimeSeriesPoint', 'StaranAPIServer', 'StaranAPIHandler',
89
+ 'today', 'from_string', 'from_lunar', 'parse_expression',
90
+ 'get_version_info', 'get_feature_status'
91
+ ]
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+
4
+ """
5
+ Staran 核心模块
6
+ ==============
7
+
8
+ 包含日期处理的核心功能:
9
+ - Date类:核心日期处理类
10
+ - LunarDate:农历日期支持
11
+ - Language:多语言国际化支持
12
+ """
13
+
14
+ from .core import Date, DateRange, DateError
15
+ from .lunar import LunarDate
16
+ from .i18n import Language
17
+
18
+ __all__ = [
19
+ 'Date',
20
+ 'DateRange',
21
+ 'DateError',
22
+ 'LunarDate',
23
+ 'Language'
24
+ ]