zlc-utils 0.0.1__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.
my_utils/__init__.py ADDED
@@ -0,0 +1,5 @@
1
+ from my_utils.markdown import to_html, strip_markdown
2
+ from my_utils.date import format_date, days_until
3
+ from my_utils.greeter import greet
4
+
5
+ __all__ = ["to_html", "strip_markdown", "format_date", "days_until", "greet"]
@@ -0,0 +1,13 @@
1
+ from datetime import date
2
+
3
+ from dateutil.parser import parse
4
+
5
+
6
+ def format_date(d: date) -> str:
7
+ return d.strftime("%Y年%m月%d日")
8
+
9
+
10
+ def days_until(target: str) -> int:
11
+ target_date = parse(target).date()
12
+ delta = target_date - date.today()
13
+ return delta.days
my_utils/greeter.py ADDED
@@ -0,0 +1,3 @@
1
+ def greet(name: str) -> str:
2
+ print("greet function called")
3
+ return f"你好, {name}!"
@@ -0,0 +1,10 @@
1
+ import markdown # type: ignore
2
+
3
+
4
+ def to_html(text: str) -> str:
5
+ return markdown.markdown(text)
6
+
7
+
8
+ def strip_markdown(text: str) -> str:
9
+ html = markdown.markdown(text)
10
+ return html.removeprefix("<p>").removesuffix("</p>\n")
@@ -0,0 +1,43 @@
1
+ Metadata-Version: 2.4
2
+ Name: zlc_utils
3
+ Version: 0.0.1
4
+ Summary: 一个用于学习 Python 公共库构建和发布的示例工程
5
+ Requires-Python: >=3.14
6
+ Requires-Dist: markdown
7
+ Requires-Dist: python-dateutil
8
+ Description-Content-Type: text/markdown
9
+
10
+ # duyi-utils
11
+
12
+ 一个用于学习 Python 公共库构建和发布的示例工程。
13
+
14
+ ## 功能
15
+
16
+ - **日期工具** — 日期格式化、日期差值计算(依赖 `python-dateutil`)
17
+ - **Markdown 工具** — Markdown 转 HTML、去除 Markdown 标记(依赖 `Markdown`)
18
+ - **问候工具** — 简单的个性化问候
19
+
20
+ ## 安装
21
+
22
+ ```bash
23
+ pip install duyi-utils
24
+ ```
25
+
26
+ ## 使用
27
+
28
+ ```python
29
+ from duyi_utils import format_date, days_until, to_html, strip_markdown
30
+ from datetime import date
31
+
32
+ # 日期工具
33
+ format_date(date(2026, 6, 1)) # => "2026年06月01日"
34
+ days_until("2026-10-01") # => 剩余天数
35
+
36
+ # Markdown 工具
37
+ to_html("**Hello**") # => "<p><strong>Hello</strong></p>"
38
+ strip_markdown("**Hello**") # => "<strong>Hello</strong>"
39
+
40
+ # 问候工具
41
+ from duyi_utils.greeter import greet
42
+ greet("小明") # => "你好, 小明!"
43
+ ```
@@ -0,0 +1,7 @@
1
+ my_utils/__init__.py,sha256=lTqw-tl_kTH5eT0Q8sN4v0minreWTp60qa0N_ACIng4,217
2
+ my_utils/greeter.py,sha256=nuKQZ3Bk9gWcpLa8lMmjUCvXnJzBhgxlGP2Cz2e0hFY,93
3
+ my_utils/date/__init__.py,sha256=fmGM5H3ti2rNq2j4PyE-q8BRdmZVySkMjRGY2QvIr74,274
4
+ my_utils/markdown/__init__.py,sha256=fORedG1TvbX3PWAIFIUlJM997kk56WfKLUWtcoM7Yz8,233
5
+ zlc_utils-0.0.1.dist-info/METADATA,sha256=3dh-mPG-a20mIrHLuZHKn9mSiwdEprZ4yEPpqsLOCh8,1134
6
+ zlc_utils-0.0.1.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
7
+ zlc_utils-0.0.1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.31.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any