my-utils6608 0.1.3__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_utils6608/__init__.py
ADDED
|
@@ -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_utils6608/greeter.py
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: my-utils6608
|
|
3
|
+
Version: 0.1.3
|
|
4
|
+
Summary: 一个用于学习 Python 公共库构建和发布的示例工程
|
|
5
|
+
Requires-Python: >=3.14
|
|
6
|
+
Requires-Dist: markdown>=3.5
|
|
7
|
+
Requires-Dist: python-dateutil>=2.8
|
|
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 my-utils
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## 使用
|
|
27
|
+
|
|
28
|
+
```python
|
|
29
|
+
from my_utils6608 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 my_utils6608.greeter import greet
|
|
42
|
+
greet("小明") # => "你好, 小明!"
|
|
43
|
+
```
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
my_utils6608/__init__.py,sha256=J9-g5kbV398pJQqjpDXAaJBeOpHVCaV8rAP8wxmhSAg,186
|
|
2
|
+
my_utils6608/greeter.py,sha256=OmN98Fyltn2vit0AkH3r_PAjrvgf5jw0JjVo0X8Tcpw,97
|
|
3
|
+
my_utils6608/date/__init__.py,sha256=AZwGvXP9CAfNqI3oMO8c3pDidE6yIj_cU0DY02_idl0,288
|
|
4
|
+
my_utils6608/markdown/__init__.py,sha256=YCmY7My3XmHFxy-tg8N1KgU7v6Bok5S1nRwyaMZSjEE,228
|
|
5
|
+
my_utils6608-0.1.3.dist-info/METADATA,sha256=kz2Me1O5F9QKmNq1WXKfgADcCJt2YRoUGZOIS0EZn9o,1149
|
|
6
|
+
my_utils6608-0.1.3.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
|
|
7
|
+
my_utils6608-0.1.3.dist-info/RECORD,,
|