Skip to main content

pywlf

Common utils for python3.

pywlf 提供一系列命令式工具函数,涵盖日志、文件、日期、图片、邮件等常见开发场景。

Utils

模块 说明
wlflog 彩色控制台日志(log_info / log_warn / log_error / log_exception)
wlffile 文件目录操作:编码检测与转换、json/xlsx 读写、md5、目录管理等
wlfimg 图片处理:png/jpg/gif 等格式转 webp(支持动图、透明通道)
wlfdate 日期时间操作:时间戳互转、日期平移、日/月/年范围计算等
wlfcore 通用方法:uid 生成、数值分段、耗时统计装饰器等
wlfconst 常量枚举:系统类型、日期格式等
wlfemail 邮件发送(EmailSender,支持附件)
wlfres API 统一返回体(ApiResponse / Result,基于 pydantic 泛型)

Installation

pip install pywlf
# 或使用 uv
uv add pywlf

Quickuse

# 彩色日志
from pywlf.wlflog import log_info, log_warn
log_info('this is a test!')

# 图片转 webp(转换成功后删除源文件)
from pywlf.wlfimg import to_webp
to_webp('D:/pics/logo.png')        # 单文件
to_webp('D:/pics', quality=90)     # 整个目录(当前层)

# 统一返回体
from pywlf.wlfres import Result
return Result.success({'id': 1})

Development

本项目使用 uv 管理依赖与打包:

uv sync          # 安装依赖(自动创建 .venv)
uv run mt.py     # 在项目环境中运行脚本
bash upload.sh   # 一键发布 PyPI:版本号+1 → uv build → uv publish

更多常用命令见 wlf.sh(命令速查手册)。

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pywlf-0.0.12.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pywlf-0.0.12-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file pywlf-0.0.12.tar.gz.

File metadata

  • Download URL: pywlf-0.0.12.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pywlf-0.0.12.tar.gz
Algorithm Hash digest
SHA256 559cdff76d3199a8a992cfa122a063f5f51ff97b340e0dc38e2485aee8776c50
MD5 0c86ce207b767097604aa22bb6672d3c
BLAKE2b-256 a54ff63bca44f6e38c5e254fcb29ecee99f9cc80753ff500fe40ca0d342f8e8e

See more details on using hashes here.

File details

Details for the file pywlf-0.0.12-py3-none-any.whl.

File metadata

  • Download URL: pywlf-0.0.12-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pywlf-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 1ae1e71f4d2ea9606667ad7ff8f4390141b26686d91f00fdee51d5e1ba572003
MD5 7ee2d2d9a665342ddb33eee9c53f03de
BLAKE2b-256 aec1da27fd78dbbbce6cebf304e076aae567fe92459121183cbf49fc47529986

See more details on using hashes here.

Release history Release notifications | RSS feed

0.0.15

2 files

0.0.14

2 files

0.0.13

2 files

This release

0.0.12 This release

2 files

0.0.11

2 files

0.0.10

2 files

0.0.9

2 files

0.0.8

2 files

0.0.6

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page