我的一个工具包
Project description
duyi-utils
一个用于学习 Python 公共库构建和发布的示例工程。
功能
- 日期工具 — 日期格式化、日期差值计算(依赖
python-dateutil) - Markdown 工具 — Markdown 转 HTML、去除 Markdown 标记(依赖
Markdown) - 问候工具 — 简单的个性化问候
安装
pip install duyi-utils
使用
from duyi_xw_utils import format_date, days_until, to_html, strip_markdown
from datetime import date
# 日期工具
format_date(date(2026, 6, 1)) # => "2026年06月01日"
days_until("2026-10-01") # => 剩余天数
# Markdown 工具
to_html("**Hello**") # => "<p><strong>Hello</strong></p>"
strip_markdown("**Hello**") # => "<strong>Hello</strong>"
# 问候工具
from duyi_xw_utils.greeter import greet
greet("小明") # => "你好, 小明!"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
duyi_xw_utils-0.1.4.tar.gz
(2.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file duyi_xw_utils-0.1.4.tar.gz.
File metadata
- Download URL: duyi_xw_utils-0.1.4.tar.gz
- Upload date:
- Size: 2.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2230c12dcc6d096afdd01fd55073fef98ed3adf4596db245fe94e7c4609e955
|
|
| MD5 |
6a86fcbf40d516d923a21a1c2ce90e07
|
|
| BLAKE2b-256 |
af474045041b468ef79d84e31174c4dcb147f09188d05ef9b54ed7f3f8afff52
|
File details
Details for the file duyi_xw_utils-0.1.4-py3-none-any.whl.
File metadata
- Download URL: duyi_xw_utils-0.1.4-py3-none-any.whl
- Upload date:
- Size: 2.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a76334d78e650c629b3f06e10da63237297df9796538a44aa05bcfe63cf1ac97
|
|
| MD5 |
c3d9c157a78c4c597b7087cd7db9f87d
|
|
| BLAKE2b-256 |
df299b502e352a6fc3be761b7852fd560d4355b723b5fbb2df1d0d84fe4b16ae
|